Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
8d7ba10
Set up skeleton for feature flag directory
landonshumway-ia Sep 24, 2025
cba792e
Add implementation of feature flag handler
landonshumway-ia Sep 25, 2025
aa7ef8a
linter/formatting
landonshumway-ia Sep 25, 2025
c18b933
fix statsig sdk module name to match latest
landonshumway-ia Sep 30, 2025
1ce1963
Add feature flag API endpoint infrastructure
landonshumway-ia Sep 30, 2025
84c080a
Update API spec/postman collection to latest
landonshumway-ia Sep 30, 2025
1071695
Move from legacy statsig SDK to current SDK
landonshumway-ia Sep 30, 2025
29b55a3
formatting/linter
landonshumway-ia Sep 30, 2025
5b32da9
Add requirements files for feature flag directory
landonshumway-ia Sep 30, 2025
84b14b9
add missing registration metric report
landonshumway-ia Oct 1, 2025
66fa6a4
Update requirements to latest
landonshumway-ia Oct 1, 2025
fc9e28a
Add python client for checking if feature flag is enabled
landonshumway-ia Oct 1, 2025
a03d4d9
update requirements to latests
landonshumway-ia Oct 1, 2025
536dffd
Add implementations to upsert feature gates in statsig
landonshumway-ia Oct 2, 2025
f93e34a
implement custom resource feature flag handler
landonshumway-ia Oct 2, 2025
bcb5225
Add CDK feature flag stack
landonshumway-ia Oct 2, 2025
8f45130
formatting
landonshumway-ia Oct 2, 2025
2ab44ff
support list of custom attribute values
landonshumway-ia Oct 2, 2025
4ce4afa
Creating one rule per environment to separate rules
landonshumway-ia Oct 2, 2025
dac99f5
rename fail parameter for clarity
landonshumway-ia Oct 2, 2025
54b4a07
clean up custom resource
landonshumway-ia Oct 2, 2025
d21b8a4
set auto enabled by env name
landonshumway-ia Oct 2, 2025
4de1cd6
do not update flags after creation
landonshumway-ia Oct 2, 2025
198e49f
Add documentation for feature flag usage
landonshumway-ia Oct 2, 2025
ebf1ad8
Never update existing feature gate rule
landonshumway-ia Oct 2, 2025
8ba194a
add sandbox example
landonshumway-ia Oct 2, 2025
6e06999
linter
landonshumway-ia Oct 2, 2025
b9bb752
formatter/linter
landonshumway-ia Oct 3, 2025
40ddb03
fix tests
landonshumway-ia Oct 3, 2025
34149c4
PR feedback
landonshumway-ia Oct 3, 2025
e15d0c1
more PR feedback
landonshumway-ia Oct 3, 2025
a044dc4
update requirements to latest
landonshumway-ia Oct 3, 2025
f5dd16e
setting API_BASE_URL env var only if domain name is present
landonshumway-ia Oct 3, 2025
4b84f56
remove unused import
landonshumway-ia Oct 3, 2025
5084039
Implement PR feedback
landonshumway-ia Oct 3, 2025
9976e94
PR feedback
landonshumway-ia Oct 6, 2025
ba3c7b7
formatter/linter/pr feedback
landonshumway-ia Oct 6, 2025
fd47e6a
Add feature flag bootstrapping documentation
landonshumway-ia Oct 6, 2025
430dd33
PR feedback
landonshumway-ia Oct 6, 2025
66d654e
more pr feedback
landonshumway-ia Oct 6, 2025
ff36014
comment cleanup
landonshumway-ia Oct 6, 2025
e0b6f85
fix sandbox name
landonshumway-ia Oct 6, 2025
e24d68e
PR feedback - add path param for flack check url
landonshumway-ia Oct 6, 2025
1574222
linter/formatter
landonshumway-ia Oct 6, 2025
8d57bbd
PR feedback
landonshumway-ia Oct 7, 2025
12dec5a
Handle invalid JSON request bodies
landonshumway-ia Oct 7, 2025
861f980
Update API spec to latest
landonshumway-ia Oct 7, 2025
ab8929c
PR feedback - fix test comment
landonshumway-ia Oct 7, 2025
935c1fb
Remove unneeded email dependencies from UI lambda folder
landonshumway-ia Oct 7, 2025
cc2ff78
Update Email dependencies/client version to address audit check
landonshumway-ia Oct 7, 2025
101f26c
PR feedback
landonshumway-ia Oct 7, 2025
06ada5e
PR feedback
landonshumway-ia Oct 8, 2025
6c85a08
formatting
landonshumway-ia Oct 8, 2025
e8f95a3
Add comment about StatSig Users
landonshumway-ia Oct 8, 2025
b6ef5ec
remove query group export to avoid clashing with deprecated pattern
landonshumway-ia Oct 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions backend/compact-connect-ui-app/lambdas/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@
"@aws-lambda-powertools/logger": "^2.10.0",
"@aws-sdk/client-dynamodb": "^3.682.0",
"@aws-sdk/client-s3": "^3.682.0",
"@aws-sdk/client-ses": "^3.682.0",
"@aws-sdk/util-dynamodb": "^3.682.0",
"@usewaypoint/email-builder": "^0.0.6",
"aws-lambda": "1.0.7",
"nodemailer": "^6.9.12",
"zod": "^3.23.8"
}
}
1,683 changes: 19 additions & 1,664 deletions backend/compact-connect-ui-app/lambdas/nodejs/yarn.lock

Large diffs are not rendered by default.

24 changes: 9 additions & 15 deletions backend/compact-connect-ui-app/pipeline/frontend_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,8 @@ def _add_codebuild_pipeline_role_override(self):
account=stack.account,
resource='log-group',
resource_name=Fn.join(
'',
[
'/aws/codebuild/',
Fn.ref(stack.get_logical_id(file_asset_node)),
':*'
]
) ,
'', ['/aws/codebuild/', Fn.ref(stack.get_logical_id(file_asset_node)), ':*']
),
arn_format=ArnFormat.COLON_RESOURCE_NAME,
),
],
Expand All @@ -262,17 +257,16 @@ def _add_codebuild_pipeline_role_override(self):
),
],
)

)
pipeline_role.add_to_principal_policy(
PolicyStatement(
effect=Effect.ALLOW,
actions=[
"codebuild:BatchPutCodeCoverages",
"codebuild:BatchPutTestCases",
"codebuild:CreateReport",
"codebuild:CreateReportGroup",
"codebuild:UpdateReport"
'codebuild:BatchPutCodeCoverages',
'codebuild:BatchPutTestCases',
'codebuild:CreateReport',
'codebuild:CreateReportGroup',
'codebuild:UpdateReport',
],
resources=[
Fn.join(
Expand All @@ -288,9 +282,9 @@ def _add_codebuild_pipeline_role_override(self):
),
Fn.ref(stack.get_logical_id(file_asset_node)),
'-*',
]
],
),
]
],
)
)

Expand Down
10 changes: 6 additions & 4 deletions backend/compact-connect-ui-app/tests/app/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ def test_pipeline_role_trust_policies(self):
[
{
'Effect': 'Allow',
'Principal': {'Service': [
'codebuild.amazonaws.com',
'codepipeline.amazonaws.com',
]},
'Principal': {
'Service': [
'codebuild.amazonaws.com',
'codepipeline.amazonaws.com',
]
},
'Action': 'sts:AssumeRole',
}
]
Expand Down
45 changes: 41 additions & 4 deletions backend/compact-connect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,12 @@ its environment:
The key under `environments` must match the value you put under `environment_name`.
6) Configure your aws cli to authenticate against your own account. There are several ways to do this based on the
type of authentication you use to login to your account. See the [AWS CLI Configuration Guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html).
7) Complete the [Google reCAPTCHA Setup](#google-recaptcha-setup) steps for your sandbox environment.
8) Run `cdk bootstrap` to add some base CDK support infrastructure to your AWS account. See
7) Complete the [StatSig Feature Flag Setup](#statsig-feature-flag-setup) steps for your sandbox environment.
8) Complete the [Google reCAPTCHA Setup](#google-recaptcha-setup) steps for your sandbox environment.
9) Run `cdk bootstrap` to add some base CDK support infrastructure to your AWS account. See
[Custom bootstrap stack](#custom-bootstrap-stack) below for optional custom stack deployment.
9) Run `cdk deploy 'Sandbox/*'` to get the initial backend stack resources deployed.
10) *Optional:* If you have a domain name configured for your sandbox environment, once the backend stacks have
10) Run `cdk deploy 'Sandbox/*'` to get the initial backend stack resources deployed.
11)*Optional:* If you have a domain name configured for your sandbox environment, once the backend stacks have
successfully deployed, you can deploy the frontend UI app as well. See the
[UI app for details](../compact-connect-ui-app/README.md).

Expand Down Expand Up @@ -230,6 +231,7 @@ authentication is working as expected.
The production environment requires a few steps to fully set up before deploys can be automated. Refer to the
[README.md](../multi-account/README.md) for details on setting up a full multi-account architecture environment. Once
that is done, perform the following steps to deploy the CI/CD pipelines into the appropriate AWS account:
- Complete the [StatSig Feature Flag Setup](#statsig-feature-flag-setup) steps for each environment you will be deploying to (test, beta, prod).
- Complete the [Google reCAPTCHA Setup](#google-recaptcha-setup) steps for each environment you will be deploying to (test, beta, prod).
Use the appropriate domain name for the environment (ie `app.test.compactconnect.org` for test environment,
`app.beta.compactconnect.org` for beta environment, `app.compactconnect.org` for production). For the production
Expand Down Expand Up @@ -286,6 +288,41 @@ Once the pipelines are established with the above steps, deployments will be aut
- Pushes to the `main` branch will trigger both the beta and production backend pipelines, which will then trigger
their respective frontend pipelines.

## StatSig Feature Flag Setup
[Back to top](#compact-connect---backend-developer-documentation)

The feature flag system uses StatSig to manage feature flags across different environments. Follow these steps to set up StatSig for your environment:

1. **Create a StatSig Account**
- Visit [StatSig](https://www.statsig.com/) and create an account
- Set up your project and organization

2. **Generate API Keys**
- Navigate to the [API Keys section](https://docs.statsig.com/guides/first-feature/#step-4---create-a-new-client-api-key) of the StatSig console
- You'll need to create three types of API keys:
- **Server Secret Key**: Used for server-side feature flag evaluation
- **Client API Key**: Used for client-side feature flag evaluation (optional for this backend setup)
- **Console API Key**: Used for programmatic management of feature flags via the Console API

3. **Store Credentials in AWS Secrets Manager**
- For each environment (test, beta, prod), create a secret in AWS Secrets Manager with the following naming pattern:
```
compact-connect/env/{environment_name}/statsig/credentials
```
- The secret value should be a JSON object with the following structure:
```json
{
"serverKey": "<your_server_secret_key>",
"consoleKey": "<your_console_api_key>"
}
```
- You can create the secret for each environment account by logging into the respective environment account and using the AWS CLI:
```bash
aws secretsmanager create-secret \
--name "compact-connect/env/{test | beta | prod}/statsig/credentials" \
--secret-string '{"serverKey": "<your_server_secret_key>", "consoleKey": "<your_console_api_key>"}'
```

## Google reCAPTCHA Setup
[Back to top](#compact-connect---backend-developer-documentation)

Expand Down
Loading