Skip to content

Conversation

@zaro0508
Copy link
Contributor

@zaro0508 zaro0508 commented Oct 17, 2025

Use the AWS CDK built in context loader[1] and allow storing and loading configurations from files.

[1] https://docs.aws.amazon.com/cdk/v2/guide/context.html

depends on #25

Use the AWS CDK built in context loader[1] and allow storing
and loading configurations from files.

[1] https://docs.aws.amazon.com/cdk/v2/guide/context.html
@zaro0508 zaro0508 requested review from a team as code owners October 17, 2025 19:10
@zaro0508 zaro0508 requested a review from tschaffter October 17, 2025 19:16
@zaro0508 zaro0508 requested a review from Copilot October 17, 2025 21:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors configuration loading to use AWS CDK's built-in context mechanism and file-based configuration. Configuration is moved from hardcoded environment variables in Python to YAML files, enabling better separation of concerns and leveraging CDK's standard context loading pattern.

Key Changes:

  • Replaces inline environment variable dictionary with file-based configuration system
  • Adds load_context_config() utility function supporting YAML/JSON files with base config merging
  • Updates CDK context from environment variable (ENV) to CDK context parameter (--context env=<env>)

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/utils.py Implements new configuration loader with validation and file format support
tests/unit/test_utils.py Comprehensive test suite for configuration loading functionality
config/*.yaml Environment-specific configuration files for dev, stage, prod, and base
app.py Refactored to use file-based config instead of inline dictionaries
tests/unit/test_network_stack.py Updated to load config from files
tests/unit/test_service_stack.py Updated to load config from files
README.md Updated documentation for new configuration approach
.github/workflows/*.yaml Updated workflows to use CDK context parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@zaro0508 zaro0508 requested a review from Copilot October 17, 2025 21:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@ConsoleCatzirl ConsoleCatzirl left a comment

Choose a reason for hiding this comment

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

This generally looks good, but there's one test that looks like a duplicate of another test (not a big deal).

@zaro0508 zaro0508 merged commit e9b5939 into Sage-Bionetworks-IT:main Oct 30, 2025
4 checks passed
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.

2 participants