Skip to content

Conversation

@MikeCollingwood
Copy link
Contributor

@MikeCollingwood MikeCollingwood commented Apr 10, 2025

Proposed changes

What changed

  • Add AppConfigService

Why did it change

  • New config method

Note

Issue tracking

@MikeCollingwood MikeCollingwood changed the title PYIC-7872: [WIP] Add AppConfigService PYIC-7872: Add AppConfigService Apr 10, 2025
@MikeCollingwood
Copy link
Contributor Author

MikeCollingwood commented Apr 10, 2025

Waiting on a devplatform PR to be implemented (and identity-platform PR to update to using the new SecurePipeline version) before this PR can be merged.

@MikeCollingwood MikeCollingwood marked this pull request as ready for review April 30, 2025 11:07
@MikeCollingwood MikeCollingwood requested review from a team as code owners April 30, 2025 11:07
Environment:
Variables:
ENVIRONMENT: !Sub "${Environment}"
CONFIG_SOURCE: "app-config"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change this to ssm before merging

needs: check-if-api-tests-changed
if: ${{ needs.check-if-api-tests-changed.outputs.api-tests-changed == 'true' }}
uses: govuk-one-login/ipv-core-back/.github/workflows/secure-pipeline-api-tests-image.yml@main
uses: govuk-one-login/ipv-core-back/.github/workflows/secure-pipeline-api-tests-image.yml@pyic-7872
Copy link
Contributor Author

@MikeCollingwood MikeCollingwood May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change this main before merging. The changes to the workflow allow us to deploy API tests for the dev case

import static com.fasterxml.jackson.core.JsonParser.Feature.STRICT_DUPLICATE_DETECTION;

public class YamlConfigService extends ConfigService {
public class YamlConfigService extends YamlParametersConfigService {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of functionality was moved into this base class, shared with the AppConfigService class

# Ensure the test report dir exists
[ -e "$TEST_REPORT_ABSOLUTE_DIR" ] && mkdir -p "$TEST_REPORT_ABSOLUTE_DIR"

ENVIRONMENT_SECRET=$(aws secretsmanager get-secret-value --secret-id ApiTestEnvironment | jq -r .SecretString)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this section need to be above line 13?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generate_traffic method is only called after this logic, so would be fine referencing TEST_ENV

}
}

private void addJsonConfig(Map<String, String> map, JsonNode tree, String prefix) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Json in this method name seems odd if we're dealing with YAML

Copy link
Contributor Author

@MikeCollingwood MikeCollingwood May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yep I see the confusion, though the Yaml is parsed into JsonNode before. At this point we are dealing with Json-format config

return super.getParametersByPrefix(path);
}

private void reloadParameters() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe call this updateParameters too for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method differs from updateParameters because of the fetch. I don't really mind but I think I got a PR comment last time the other way

@Joe-Edwards-GDS
Copy link
Contributor

Glanced over but not planning to review in detail unless you'd like me to - it looks very similar to the original PR 😄

DanCorderIPV
DanCorderIPV previously approved these changes May 6, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 6, 2025

@MikeCollingwood MikeCollingwood merged commit 9eee374 into main May 8, 2025
9 checks passed
@MikeCollingwood MikeCollingwood deleted the pyic-7872 branch May 8, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants