Skip to content

[Social Work] - Add full list of jurisdictions to configuration#1704

Open
landonshumway-ia wants to merge 7 commits into
csg-org:mainfrom
InspiringApps:feat/sw-state-list
Open

[Social Work] - Add full list of jurisdictions to configuration#1704
landonshumway-ia wants to merge 7 commits into
csg-org:mainfrom
InspiringApps:feat/sw-state-list

Conversation

@landonshumway-ia

@landonshumway-ia landonshumway-ia commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Now that the Cognito service team has approved our request to increase the number of resource servers allowed per user pool, we are able to include the full list of jurisdictions associated with the Social Work compact so that staff users can be added for any of those jurisdictions with needed permission scopes.

This also enhances our mock license generation script to support creating test practitioners with matching single and multi-state licenses, and performs some light cleanup of an unused S3 bucket from the Cosm and Socw CDK apps.

Testing List

  • yarn test:unit:all should run without errors or warnings
  • yarn serve should run without errors or warnings
  • yarn build should run without errors or warnings
  • For API configuration changes: CDK tests added/updated in backend/compact-connect/tests/unit/test_api.py
  • For API endpoint changes: OpenAPI spec updated to show latest endpoint configuration run compact-connect/bin/download_oas30.py
  • Code review

Closes #1703

Summary by CodeRabbit

  • New Features
    • Added a --linked-licenses mode to the mock-data generator that emits paired license records for the same practitioner (single-state + multi-state) and adjusts the meaning of the --count value accordingly.
    • Expanded supported jurisdiction coverage across configuration and API request/response schemas.
  • Bug Fixes / Behavior Changes
    • Removed export-results bucket wiring from the search API and updated related test setup and cleanup to match.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6c570ded-43a6-4405-88c5-ac78b85aad01

📥 Commits

Reviewing files that changed from the base of the PR and between 696de1f and a57d4be.

📒 Files selected for processing (11)
  • backend/cosmetology-app/stacks/search_persistent_stack/search_handler.py
  • backend/social-work-app/stacks/search_persistent_stack/search_handler.py
  • backend/social-work-app/tests/resources/snapshots/GET_COMPACT_CONFIGURATION_RESPONSE_SCHEMA.json
  • backend/social-work-app/tests/resources/snapshots/GET_PROVIDER_RESPONSE_SCHEMA.json
  • backend/social-work-app/tests/resources/snapshots/PROVIDER_USER_RESPONSE_SCHEMA.json
  • backend/social-work-app/tests/resources/snapshots/PUBLIC_GET_PROVIDER_RESPONSE_SCHEMA.json
  • backend/social-work-app/tests/resources/snapshots/PUBLIC_QUERY_PROVIDERS_REQUEST_SCHEMA.json
  • backend/social-work-app/tests/resources/snapshots/PUBLIC_QUERY_PROVIDERS_RESPONSE_SCHEMA.json
  • backend/social-work-app/tests/resources/snapshots/PUT_COMPACT_CONFIGURATION_REQUEST_SCHEMA.json
  • backend/social-work-app/tests/resources/snapshots/QUERY_PROVIDERS_REQUEST_SCHEMA.json
  • backend/social-work-app/tests/resources/snapshots/QUERY_PROVIDERS_RESPONSE_SCHEMA.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • backend/social-work-app/stacks/search_persistent_stack/search_handler.py
  • backend/cosmetology-app/stacks/search_persistent_stack/search_handler.py

📝 Walkthrough

Walkthrough

Adds linked-license mock generation, expands jurisdiction lists and schema snapshots, and removes export-results bucket wiring from search stacks, configs, and tests across both apps.

Changes

Mock License Linked-Records Generation

Layer / File(s) Summary
Linked record generation
backend/social-work-app/bin/generate_mock_license_csv_upload_file.py
generate_license_records and get_mock_license emit paired single-state and multi-state rows when linked mode is enabled.
CLI and file-generator wiring
backend/social-work-app/bin/generate_mock_license_csv_upload_file.py
generate_mock_data_file, CSV/JSON writers, the CLI flag, usage comments, and __main__ all pass through linked_licenses.

Jurisdiction Scope Expansion

Layer / File(s) Summary
CDK jurisdiction lists
backend/social-work-app/cdk.json
context.jurisdictions and context.active_compact_member_jurisdictions.socw are expanded to the broader jurisdiction list.
Compact and query schema enums
backend/social-work-app/tests/resources/snapshots/GET_COMPACT_CONFIGURATION_RESPONSE_SCHEMA.json, .../PUT_COMPACT_CONFIGURATION_REQUEST_SCHEMA.json, .../QUERY_PROVIDERS_*
Compact configuration and query request/response snapshots expand jurisdiction and postal-abbreviation enums.
Provider response schema enums
backend/social-work-app/tests/resources/snapshots/GET_PROVIDER_RESPONSE_SCHEMA.json, .../PROVIDER_USER_RESPONSE_SCHEMA.json, .../PUBLIC_GET_PROVIDER_RESPONSE_SCHEMA.json
Provider response snapshots expand jurisdiction enums across licenses, adverse actions, investigations, privileges, and related history fields.
Resource server snapshot
backend/social-work-app/tests/resources/snapshots/JURISDICTION_RESOURCE_SERVER_CONFIGURATION.json
The jurisdiction array is rewritten to include the expanded jurisdiction objects with consistent scope definitions.

Export Results Bucket Removal

Layer / File(s) Summary
Cosmetology-app removal
backend/cosmetology-app/lambdas/python/common/cc_common/config.py, .../search/tests/__init__.py, .../search/tests/function/__init__.py, backend/cosmetology-app/stacks/search_persistent_stack/__init__.py, .../search_handler.py
The export-results config property, test setup/cleanup, bucket construct, handler wiring, IAM grants, and related comments are removed.
Social-work-app removal
backend/social-work-app/lambdas/python/common/cc_common/config.py, .../search/tests/__init__.py, .../search/tests/function/__init__.py, backend/social-work-app/stacks/search_persistent_stack/__init__.py, .../search_handler.py
The same export-results config property, test setup/cleanup, handler wiring, IAM grants, and CDK Nag references are removed.

Estimated code review effort: 4 (Complex) | ~60 minutes

Suggested reviewers: ChiefStief, jlkravitz

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing the template's required Requirements List and Description List sections. Add the missing Requirements List and Description List headings, and briefly summarize the change and any key acceptance details under each.
Out of Scope Changes check ⚠️ Warning Several unrelated changes were bundled in, including mock license generation and S3/search stack cleanup beyond the jurisdiction scope. Move the mock-license and S3/search cleanup changes to separate PRs or link explicit issues covering that work.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: expanding Social Work jurisdictions in configuration.
Linked Issues check ✅ Passed The jurisdiction scope expansion in cdk.json matches the linked issue's request to include the full compact member state list.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@backend/social-work-app/cdk.json`:
- Around line 22-29: The jurisdiction lists in cdk.json are missing AS and PR,
which affects scope generation and enum validation. Update both
context.jurisdictions and active_compact_member_jurisdictions.socw to include
American Samoa and Puerto Rico alongside the existing state/territory codes,
keeping the values consistent wherever jurisdiction scope is defined.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f5562587-dc5a-4ae2-8b11-3b8b49994d57

📥 Commits

Reviewing files that changed from the base of the PR and between a7d8d07 and 38acc28.

📒 Files selected for processing (2)
  • backend/social-work-app/bin/generate_mock_license_csv_upload_file.py
  • backend/social-work-app/cdk.json

Comment thread backend/social-work-app/cdk.json
This bucket construct config was replicated from the existing search
stacks, but is not needed by cosm or socw
@landonshumway-ia

Copy link
Copy Markdown
Collaborator Author

@jlkravitz This is ready for your review. Thanks

jlkravitz
jlkravitz previously approved these changes Jul 2, 2026

@jlkravitz jlkravitz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good. One small question!

Comment thread backend/cosmetology-app/stacks/search_persistent_stack/search_handler.py Outdated
Comment thread backend/social-work-app/stacks/search_persistent_stack/search_handler.py Outdated

@jlkravitz jlkravitz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@isabeleliassen Good to merge!

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.

Social Work - update list of Cognito scopes to include full list of compact member states

3 participants