Skip to content

Add full list of active member states for all compacts#852

Merged
isabeleliassen merged 4 commits intocsg-org:developmentfrom
InspiringApps:feat/set-all-active-member-states
Jun 10, 2025
Merged

Add full list of active member states for all compacts#852
isabeleliassen merged 4 commits intocsg-org:developmentfrom
InspiringApps:feat/set-all-active-member-states

Conversation

@landonshumway-ia
Copy link
Copy Markdown
Collaborator

@landonshumway-ia landonshumway-ia commented Jun 9, 2025

Now that the Cognito service team has increased our quota for the number of resource servers within a user pool, we can set the resource servers for all the active member states for each compact.

Closes #808

Summary by CodeRabbit

  • New Features
    • Expanded the list of active member jurisdictions for multiple compacts, increasing coverage across more states and territories.
    • Enhanced jurisdiction resource server configurations by adding new jurisdictions and extending access control scopes for existing ones.
    • Added sandbox environment support for jurisdiction membership configuration, enabling environment-specific jurisdiction mappings.
  • Chores
    • Updated configuration files to reflect the expanded membership and scope changes.
    • Upgraded multiple backend and lambda dependencies to newer versions for improved stability and security.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 9, 2025

Walkthrough

This change updates configuration files to expand and update the lists of active compact member jurisdictions and their associated resource server scopes. The modifications affect the jurisdiction membership arrays and access control scopes, reflecting a broad extension of compact coverage and permissions across multiple states and compacts. Additionally, sandbox environment handling for active jurisdictions was introduced in backend logic.

Changes

File(s) Change Summary
backend/compact-connect/cdk.context.sandbox-example.json Replaced "jurisdictionOperationsTeamEmails" with "sandbox_active_compact_member_jurisdictions" mapping compacts to states.
backend/compact-connect/cdk.json Expanded arrays under "active_compact_member_jurisdictions" for "aslp", "octp", and "coun" with additional jurisdictions.
backend/compact-connect/tests/resources/snapshots/JURISDICTION_RESOURCE_SERVER_CONFIGURATION.json Added/expanded jurisdiction entries and scopes for "coun" and "octp" compacts; updated several jurisdiction identifiers.
backend/compact-connect/stacks/persistent_stack/init.py Modified method to fetch active jurisdictions differently for sandbox environments using new context key.
Multiple requirements and requirements-dev.txt files across lambdas and backend Updated versions of various Python packages including boto3, botocore, cryptography, moto, requests, s3transfer, and others.

Sequence Diagram(s)

sequenceDiagram
    participant Env as Environment (Sandbox or Prod)
    participant PersistentStack as PersistentStack
    participant Context as CDK Context

    Env->>PersistentStack: Request active jurisdictions for compact
    PersistentStack->>Context: Check if sandbox environment
    alt Sandbox
        PersistentStack->>Context: Retrieve sandbox_active_compact_member_jurisdictions
    else Non-sandbox
        PersistentStack->>Context: Retrieve active_compact_member_jurisdictions
    end
    Context-->>PersistentStack: Return jurisdictions list
    PersistentStack-->>Env: Provide jurisdictions list
Loading
sequenceDiagram
    participant ConfigFile as Configuration File
    participant CDK as CDK Deployment
    participant Cognito as AWS Cognito
    participant ResourceServer as Resource Server

    ConfigFile->>CDK: Provide updated active_compact_member_jurisdictions
    CDK->>Cognito: Deploy resource servers for each jurisdiction in updated lists
    Cognito->>ResourceServer: Create/Update resource servers and scopes
    ResourceServer-->>Cognito: Confirm setup for each jurisdiction
Loading

Assessment against linked issues

Objective Addressed Explanation
Update 'active_compact_member_jurisdictions' in cdk.json to include all active member jurisdictions (#808)
Ensure resource server scopes are set up for all active compact member states (#808)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Poem

A rabbit hops through configs bright,
Adding states both left and right.
Compacts grow, the scopes expand,
Jurisdictions join the band.
With every state, our reach extends—
A fluffy tail of code that never ends!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
backend/compact-connect/stacks/persistent_stack/__init__.py (1)

534-542: Conditional logic is correct but consider consistency in context retrieval.

The sandbox detection and conditional configuration retrieval logic is implemented correctly. However, there's an inconsistency in context retrieval methods: try_get_context is used for sandbox-specific jurisdictions while get_context is used for regular jurisdictions.

Consider using consistent context retrieval methods for clarity:

        if is_sandbox:
            # Try to get sandbox-specific configuration
-            active_member_jurisdictions = self.node.try_get_context('sandbox_active_compact_member_jurisdictions')
+            active_member_jurisdictions = self.node.get_context('sandbox_active_compact_member_jurisdictions')
        else:
            # Use regular configuration for non-sandbox environments
            active_member_jurisdictions = self.node.get_context('active_compact_member_jurisdictions')

Or document why try_get_context is intentionally used for sandbox configurations if this is the desired behavior.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c163886 and aa9bd06.

📒 Files selected for processing (2)
  • backend/compact-connect/cdk.context.sandbox-example.json (1 hunks)
  • backend/compact-connect/stacks/persistent_stack/__init__.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • backend/compact-connect/cdk.context.sandbox-example.json
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: TestPython
🔇 Additional comments (1)
backend/compact-connect/stacks/persistent_stack/__init__.py (1)

527-533: Documentation clearly explains the sandbox rationale.

The added documentation effectively explains why sandbox environments need separate jurisdiction configuration due to Cognito's 25 resource server limit.

Comment thread backend/compact-connect/stacks/persistent_stack/__init__.py
@landonshumway-ia landonshumway-ia requested a review from jusdino June 9, 2025 22:03
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
backend/compact-connect/requirements-dev.txt (1)

68-71: Align comment indentation for pygments dependency.
The expanded # via lines for pytest and rich use inconsistent indentation. Normalizing these to match the surrounding style will improve readability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aa9bd06 and 4e2ded2.

📒 Files selected for processing (19)
  • backend/compact-connect/cdk.context.sandbox-example.json (1 hunks)
  • backend/compact-connect/lambdas/python/common/requirements-dev.txt (4 hunks)
  • backend/compact-connect/lambdas/python/common/requirements.txt (2 hunks)
  • backend/compact-connect/lambdas/python/compact-configuration/requirements-dev.txt (4 hunks)
  • backend/compact-connect/lambdas/python/custom-resources/requirements-dev.txt (4 hunks)
  • backend/compact-connect/lambdas/python/data-events/requirements-dev.txt (4 hunks)
  • backend/compact-connect/lambdas/python/provider-data-v1/requirements-dev.txt (4 hunks)
  • backend/compact-connect/lambdas/python/provider-data-v1/requirements.txt (1 hunks)
  • backend/compact-connect/lambdas/python/purchases/requirements-dev.txt (4 hunks)
  • backend/compact-connect/lambdas/python/purchases/requirements.txt (1 hunks)
  • backend/compact-connect/lambdas/python/staff-user-pre-token/requirements-dev.txt (4 hunks)
  • backend/compact-connect/lambdas/python/staff-users/requirements-dev.txt (4 hunks)
  • backend/compact-connect/requirements-dev.txt (3 hunks)
  • backend/compact-connect/requirements.txt (2 hunks)
  • backend/compact-connect/stacks/persistent_stack/__init__.py (1 hunks)
  • backend/multi-account/control-tower/requirements-dev.txt (1 hunks)
  • backend/multi-account/control-tower/requirements.txt (2 hunks)
  • backend/multi-account/log-aggregation/requirements-dev.txt (1 hunks)
  • backend/multi-account/log-aggregation/requirements.txt (2 hunks)
✅ Files skipped from review due to trivial changes (6)
  • backend/compact-connect/lambdas/python/provider-data-v1/requirements.txt
  • backend/compact-connect/lambdas/python/purchases/requirements.txt
  • backend/multi-account/control-tower/requirements.txt
  • backend/multi-account/log-aggregation/requirements.txt
  • backend/compact-connect/requirements.txt
  • backend/compact-connect/lambdas/python/common/requirements.txt
🚧 Files skipped from review as they are similar to previous changes (2)
  • backend/compact-connect/cdk.context.sandbox-example.json
  • backend/compact-connect/stacks/persistent_stack/init.py
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: landonshumway-ia
PR: csg-org/CompactConnect#852
File: backend/compact-connect/stacks/persistent_stack/__init__.py:545-549
Timestamp: 2025-06-09T22:03:03.204Z
Learning: In the CompactConnect codebase, production active_compact_member_jurisdictions configurations are very stable and unlikely to be removed. The vast majority of configuration errors in get_list_of_active_jurisdictions_for_compact_environment() will occur when developers are deploying sandbox environments, so error messages that primarily reference sandbox configuration are appropriate for the typical use case.
🪛 LanguageTool
backend/compact-connect/lambdas/python/common/requirements-dev.txt

[duplication] ~57-~57: Possible typo: you repeated a word.
Context: ...via # docker # moto # responses responses==0.25.7 # via moto s3transfer==0.13...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/lambdas/python/compact-configuration/requirements-dev.txt

[duplication] ~54-~54: Possible typo: you repeated a word.
Context: ...via # docker # moto # responses responses==0.25.7 # via moto s3transfer==0.13...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/lambdas/python/custom-resources/requirements-dev.txt

[duplication] ~54-~54: Possible typo: you repeated a word.
Context: ...via # docker # moto # responses responses==0.25.7 # via moto s3transfer==0.13...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/lambdas/python/data-events/requirements-dev.txt

[duplication] ~54-~54: Possible typo: you repeated a word.
Context: ...via # docker # moto # responses responses==0.25.7 # via moto s3transfer==0.13...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/lambdas/python/provider-data-v1/requirements-dev.txt

[duplication] ~57-~57: Possible typo: you repeated a word.
Context: ...via # docker # moto # responses responses==0.25.7 # via moto s3transfer==0.13...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/lambdas/python/purchases/requirements-dev.txt

[duplication] ~54-~54: Possible typo: you repeated a word.
Context: ...via # docker # moto # responses responses==0.25.7 # via moto s3transfer==0.13...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/lambdas/python/staff-user-pre-token/requirements-dev.txt

[duplication] ~54-~54: Possible typo: you repeated a word.
Context: ...via # docker # moto # responses responses==0.25.7 # via moto s3transfer==0.13...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/lambdas/python/staff-users/requirements-dev.txt

[duplication] ~61-~61: Possible typo: you repeated a word.
Context: ...via # docker # moto # responses responses==0.25.7 # via moto s3transfer==0.13...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/requirements-dev.txt

[duplication] ~80-~80: Possible typo: you repeated a word.
Context: ...act-connect/requirements-dev.in # pytest-cov pytest-cov==6.1.1 # via -r compact-connect/req...

(ENGLISH_WORD_REPEAT_RULE)

backend/multi-account/control-tower/requirements-dev.txt

[duplication] ~14-~14: Possible typo: you repeated a word.
Context: ...# via pytest pygments==2.19.1 # via pytest pytest==8.4.0 # via -r multi-account/contr...

(ENGLISH_WORD_REPEAT_RULE)

backend/multi-account/log-aggregation/requirements-dev.txt

[duplication] ~14-~14: Possible typo: you repeated a word.
Context: ...# via pytest pygments==2.19.1 # via pytest pytest==8.4.0 # via -r multi-account/log-a...

(ENGLISH_WORD_REPEAT_RULE)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: TestPython
🔇 Additional comments (30)
backend/multi-account/control-tower/requirements-dev.txt (1)

11-15: Approve dependency upgrades.

The updates to pluggy, pygments, and pytest are consistent with other multi-account modules and match the pip-compile output.

🧰 Tools
🪛 LanguageTool

[duplication] ~14-~14: Possible typo: you repeated a word.
Context: ...# via pytest pygments==2.19.1 # via pytest pytest==8.4.0 # via -r multi-account/contr...

(ENGLISH_WORD_REPEAT_RULE)

backend/multi-account/log-aggregation/requirements-dev.txt (1)

11-15: Approve dependency upgrades.

The updates to pluggy, pygments, and pytest align with other log-aggregation modules and follow pip-compile changes.

🧰 Tools
🪛 LanguageTool

[duplication] ~14-~14: Possible typo: you repeated a word.
Context: ...# via pytest pygments==2.19.1 # via pytest pytest==8.4.0 # via -r multi-account/log-a...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/lambdas/python/data-events/requirements-dev.txt (5)

7-9: Approve AWS SDK version bumps.

The bump for boto3 and botocore ensures consistent AWS SDK versions across lambda environments.


20-20: Approve cryptography version update.

The cryptography patch version bump matches other lambdas and addresses minor fixes.


36-36: Approve moto version bump.

Updating moto[dynamodb,s3] to 5.1.5 keeps test dependencies in sync across modules.


50-50: Approve requests version bump.

The requests upgrade to 2.32.4 is consistent across compact-connect lambdas.


57-57: Approve s3transfer version bump.

Aligns s3transfer with the updated boto3 requirements.

backend/compact-connect/lambdas/python/compact-configuration/requirements-dev.txt (5)

7-9: Approve AWS SDK version bumps.

The updates to boto3 and botocore match other lambda modules, maintaining consistency.


20-20: Approve cryptography version update.

Aligns cryptography with updated test stack versions across modules.


36-36: Approve moto version bump.

The moto bump ensures parity in mock AWS services across lambda tests.


50-50: Approve requests version bump.

Consistent upgrade of requests keeps HTTP utilities up-to-date.


57-57: Approve s3transfer version bump.

Matches the boto3 changes and maintains upload/download compatibility.

backend/compact-connect/lambdas/python/common/requirements-dev.txt (6)

7-9: Approve AWS SDK version bumps.

boto3 and botocore updates maintain version harmony across compact-connect lambdas.


20-20: Approve cryptography version bump.

The cryptography update addresses patch-level fixes and aligns with other modules.


24-24: Approve faker addition.

Adding faker supports test data generation and matches the pip-compile source.


38-38: Approve moto version bump.

The moto bump to 5.1.5 keeps mock libraries consistent across tests.


53-53: Approve requests version bump.

Upgrading requests to 2.32.4 ensures consistency in HTTP libraries.


60-60: Approve s3transfer version bump.

Aligns the S3 transfer utility with the updated AWS SDK versions.

backend/compact-connect/lambdas/python/custom-resources/requirements-dev.txt (1)

7-57: Consistent dependency version bump
All development dependencies (boto3, botocore, cryptography, moto[dynamodb,s3], requests, and s3transfer) have been uniformly upgraded to newer patch/minor releases in line with the coordinated, project-wide update. These are non-functional version bumps with no backward-compatibility or syntax impact.

🧰 Tools
🪛 LanguageTool

[duplication] ~54-~54: Possible typo: you repeated a word.
Context: ...via # docker # moto # responses responses==0.25.7 # via moto s3transfer==0.13...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/lambdas/python/staff-user-pre-token/requirements-dev.txt (1)

7-57: Consistent dependency version bump
All development dependencies (boto3, botocore, cryptography, moto[dynamodb,s3], requests, and s3transfer) have been upgraded to match the unified version scheme applied across lambdas. No functional changes or compatibility risks introduced.

🧰 Tools
🪛 LanguageTool

[duplication] ~54-~54: Possible typo: you repeated a word.
Context: ...via # docker # moto # responses responses==0.25.7 # via moto s3transfer==0.13...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/lambdas/python/purchases/requirements-dev.txt (1)

7-57: Consistent dependency version bump
Development dependencies (boto3, botocore, cryptography, moto[dynamodb,s3], requests, and s3transfer) have been bumped to the latest patch/minor versions in accordance with the cross-lambda standardization. No issues detected.

🧰 Tools
🪛 LanguageTool

[duplication] ~54-~54: Possible typo: you repeated a word.
Context: ...via # docker # moto # responses responses==0.25.7 # via moto s3transfer==0.13...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/lambdas/python/provider-data-v1/requirements-dev.txt (1)

7-60: Consistent dependency version bump
All core and test dependencies (boto3, botocore, cryptography, moto[dynamodb,s3], requests, and s3transfer) have been aligned to the same patched versions used across other lambdas. This purely updates patch/minor releases—no API or compatibility changes.

🧰 Tools
🪛 LanguageTool

[duplication] ~57-~57: Possible typo: you repeated a word.
Context: ...via # docker # moto # responses responses==0.25.7 # via moto s3transfer==0.13...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/lambdas/python/staff-users/requirements-dev.txt (1)

7-64: Consistent dependency version bump
Development dependencies—including boto3, botocore, cryptography, joserfc, moto[cognitoidp,dynamodb,s3], requests, and s3transfer—have been updated to new patch/minor versions to mirror the coordinated project-wide upgrade. No functional or compatibility concerns.

🧰 Tools
🪛 LanguageTool

[duplication] ~61-~61: Possible typo: you repeated a word.
Context: ...via # docker # moto # responses responses==0.25.7 # via moto s3transfer==0.13...

(ENGLISH_WORD_REPEAT_RULE)

backend/compact-connect/requirements-dev.txt (7)

19-19: Approve click version bump.
Patch upgrade to click==8.2.1 is minor and safe.


21-21: Approve coverage version bump.
Updating to coverage[toml]==7.8.2 is a backwards-compatible patch.


45-45: Approve packageurl-python version bump.
Moving to packageurl-python==0.17.1 aligns with upstream releases.


63-63: Approve pluggy version bump.
Updating to pluggy==1.6.0 is a minor release for plugin hooks; no concerns.


78-78: Approve pytest version bump.
Bumping to pytest==8.4.0 is a patch release; backward-compatible.


85-85: Verify the new requests version for compatibility and security.
Please confirm that requests==2.32.4 does not introduce breaking changes in cachecontrol or pip-audit, and has no known vulnerabilities. Consider running pip-audit against your test environment.


91-91: Approve ruff version bump.
Updating to ruff==0.11.13 is a minor linter update; safe to merge.

@landonshumway-ia
Copy link
Copy Markdown
Collaborator Author

@jlkravitz This is ready for your review. We want to get this in relatively soon so the Counseling compact can add staff users from these listed states. Thanks

Copy link
Copy Markdown
Collaborator

@jlkravitz jlkravitz left a comment

Choose a reason for hiding this comment

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

Looks good! @isabeleliassen good to merge

@isabeleliassen isabeleliassen merged commit c13f835 into csg-org:development Jun 10, 2025
3 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.

Setup all resource servers for active compact member states when Cognito quota increased

4 participants