Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read a RemoteConfig instance #771

Closed
Tracked by #591
jeromy-cannon opened this issue Oct 30, 2024 · 0 comments · Fixed by #862
Closed
Tracked by #591

Read a RemoteConfig instance #771

jeromy-cannon opened this issue Oct 30, 2024 · 0 comments · Fixed by #862
Assignees
Labels
Internal Requirement P0 An issue impacting production environments or impacting multiple releases or multiple individuals.

Comments

@jeromy-cannon
Copy link
Contributor

jeromy-cannon commented Oct 30, 2024

Feature: read a RemoteConfig instance

  The RemoteConfig instance will be read from a Kubernetes ConfigMap. 
It will be stored as YAML in the Kubernetes ConfigMap.  
It will be parsed from YAML to JSON, then validated against a JSON Schema.  
The JSON Schema is created from a JSON Schema generator from the TypeScript class.  
A populated instance of the TypeScript class will be returned as a result of reading the RemoteConfig.

  Scenario: no RemoteConfig found for the given namespace/cluster/context 
    Given the namespace, cluster, and context
    When looking for the RemoteConfig
    And it is not found
    Then a SoloError will be thrown explaining for the given namespace/cluster/context that no RemoteConfig ConfigMap was found

  Scenario: a RemoteConfig is found but fails to be converted from YAML to JSON (invalid YAML)
    Given the namespace, cluster, and context
    When looking for the RemoteConfig 
    And one is found
    And an error occurs while trying to parse the YAML into JSON
    Then a SoloEror will be thrown explaining that for the given namespace/cluster/context that the RemoteConfig ConfigMap was found invalid and must be manually corrected

  Scenario: a RemoteConfig is found but fails the JSON Schema validation
    Given the namespace, cluster, and context
    When looking for the RemoteConfig 
    And one is found
    And successfully returns a JSON while parsing the YAML
    And fails the JSON schema validation with an error
    Then a SoloEror will be thrown explaining that for the given namespace/cluster/context that the RemoteConfig ConfigMap was found invalid due to a schema validation error
    And provide in the error the schema validation error
    And let the user know that it must be manually corrected

  Scenario: a RemoteConfig is found and a populated class instance is returned
    Given the namespace, cluster, and context
    When looking for the RemoteConfig 
    And one is found
    And successfully returns a JSON while parsing the YAML
    And passes the JSON schema validation
    Then the RemoteConfig will be populated with elements from the YAML
    And the read function will return true

  Scenario: when a `npm run build` occurs, a JSON schema will be created for the RemoteConfig
    Given `npm run build` is ran 
    When `generate-schema` in `package.json` script is ran
    Then it will generate a 'local-config.json' schema file
@jeromy-cannon jeromy-cannon added the Needs Refinement The issue needs more refinement and/or design before it can be worked label Nov 1, 2024
@jeromy-cannon jeromy-cannon self-assigned this Nov 1, 2024
@jeromy-cannon jeromy-cannon added P0 An issue impacting production environments or impacting multiple releases or multiple individuals. and removed Needs Refinement The issue needs more refinement and/or design before it can be worked labels Nov 1, 2024
@instamenta instamenta linked a pull request Nov 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal Requirement P0 An issue impacting production environments or impacting multiple releases or multiple individuals.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants