Skip to content

Conversation

@ChiefStief
Copy link
Contributor

@ChiefStief ChiefStief commented Oct 3, 2025

Requirements List

Description List

  • Added public/compacts/jurisdictions/live endpoint
  • Added tests

Testing List

  • 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 #1055

Summary by CodeRabbit

  • New Features

    • Public GET /v1/public/jurisdictions/live returning a mapping of compact abbreviations to arrays of live jurisdiction postal abbreviations.
    • Optional compact query parameter to filter by compact; invalid values yield a 400 error.
    • Returns empty arrays for compacts with no live jurisdictions.
  • Documentation

    • API docs updated with the new path, parameter, response schema, example payload, and 400 error spec.
  • Tests

    • Added tests for all-compacts, per-compact, and invalid-compact scenarios plus API synthesis.

@ChiefStief ChiefStief changed the title api first pass backend only live states on registration Oct 3, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 3, 2025

Walkthrough

Adds GET /v1/public/jurisdictions/live (optional compact query) returning per-compact lists of live jurisdiction postal abbreviations; implements CompactConfigurationClient.get_live_compact_jurisdictions, a Lambda handler that aggregates results, wires the endpoint into the API stack/OpenAPI, and adds tests and API model/schema.

Changes

Cohort / File(s) Summary
OpenAPI Specs
backend/compact-connect/docs/internal/api-specification/latest-oas30.json, backend/compact-connect/docs/api-specification/latest-oas30.json
Adds GET /v1/public/jurisdictions/live with optional compact query; 200 response maps compact abbreviations to arrays of live jurisdiction postal abbreviations (example provided); 400 for invalid compact.
Data Model Client
backend/compact-connect/lambdas/python/common/cc_common/data_model/compact_configuration_client.py
Adds get_live_compact_jurisdictions(compact) -> list[str]: fetches compact config, filters configuredStates where isLive is true, returns postal abbreviations; returns [] if compact not found and logs inputs/results.
Lambda Handler
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py
Adds _get_live_public_compact_jurisdictions(event, context) handler: reads optional compact query param, validates it, calls get_live_compact_jurisdictions per compact (one or all), aggregates mapping, raises on invalid compact, and registers the route.
Lambda Tests
backend/compact-connect/lambdas/python/compact-configuration/tests/function/test_compact_configuration.py
Adds LIVE_JURISDICTIONS_ENDPOINT_RESOURCE = '/v1/public/jurisdictions/live' and tests for listing live jurisdictions across all compacts, for a specific compact, and invalid-compact behavior.
API Stack Wiring
backend/compact-connect/stacks/api_stack/v1_api/api.py, backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py
Introduces public_jurisdictions_resource and live_jurisdictions_resource, wires GET /v1/public/jurisdictions/live into CompactConfigurationApi (Lambda integration, no authorizer), adds query param config and AWS Solutions suppressions, and exposes new constructor parameter/attributes.
API Models
backend/compact-connect/stacks/api_stack/v1_api/api_model.py
Adds get_live_jurisdictions_model to create/cache V1GetLiveJurisdictionsResponseModel schema mapping compacts to arrays of jurisdiction abbreviations.
Infrastructure Tests
backend/compact-connect/tests/app/test_api/test_compact_configuration_api.py
Adds test_synth_generates_get_live_jurisdictions_resource to assert the public /jurisdictions/live resource exists, is a child of public /jurisdictions, uses Lambda integration with no authorizer, and defines a 200 response.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant APIGW as API Gateway\n(/v1/public/jurisdictions/live)
  participant Lambda as compact_configuration_api_handler
  participant CCClient as CompactConfigurationClient

  Client->>APIGW: GET /v1/public/jurisdictions/live?compact={optional}
  APIGW->>Lambda: Invoke (event with query params)

  alt compact provided and valid
    Lambda->>CCClient: get_live_compact_jurisdictions(compact)
    CCClient-->>Lambda: [postalAbbrev...]
    Lambda-->>APIGW: { compact: [..] }
  else compact missing
    loop per configured compact
      Lambda->>CCClient: get_live_compact_jurisdictions(compact)
      CCClient-->>Lambda: [postalAbbrev...]
    end
    Lambda-->>APIGW: { compactA: [...], compactB: [...] }
  else invalid compact
    Lambda-->>APIGW: 400 Invalid compact
  end

  APIGW-->>Client: 200 application/json (or 400)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • jusdino
  • jlkravitz

Poem

I hop through specs and wires bright,
Fetching live codes in the soft moonlight,
One compact or all in a gentle sweep,
I gather the states that wake from sleep,
Tests, logs, and carrots — mission complete. 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Live jurisidictions endpoint #1055" clearly communicates the main change in the PR—the addition of a new live jurisdictions endpoint. The title directly corresponds to the implemented changes, which add the GET /v1/public/jurisdictions/live endpoint with associated handlers and tests. While there is a minor typo in the word "jurisdictions," the title remains clear and specific about the primary change being introduced to the codebase.
Linked Issues Check ✅ Passed The linked issue #1055 "only show live states in registration BE" seeks to display only live jurisdictions in the backend. The implementation adds a new endpoint GET /v1/public/jurisdictions/live that retrieves and returns only jurisdictions where isLive is true, along with a new get_live_compact_jurisdictions method that filters for live jurisdictions. Tests verify that the endpoint correctly returns only live jurisdictions across all compacts or for a specific compact. The code changes directly satisfy the requirement to expose live jurisdictions through the backend API.
Out of Scope Changes Check ✅ Passed All changes in this PR are directly related to implementing the live jurisdictions endpoint feature. The modifications include the OpenAPI specification updates, new handler functions, a filtering method in the configuration client, API stack configuration to wire the endpoint, response models, and comprehensive tests. No unrelated refactoring, dependency updates, or extraneous features are present. All alterations are scoped to the specific objective of adding the live jurisdictions endpoint.
Description Check ✅ Passed The PR description includes the required Description List, Testing List, and issue closure reference as specified in the template. The Description List clearly documents the addition of the new endpoint and tests, and the Testing List outlines the validation steps performed. However, the Requirements List is empty and not filled out, leaving the specific requirements for this feature undocumented within the PR description itself. Despite this omission, the description is mostly complete with the essential sections containing meaningful information, which meets the threshold for a passing description.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c396915 and fe7f010.

📒 Files selected for processing (2)
  • backend/compact-connect/stacks/api_stack/v1_api/api_model.py (1 hunks)
  • backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (2)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (1)
  • compact_configuration_api_handler (24-42)
backend/compact-connect/stacks/api_stack/v1_api/api_model.py (1)
  • get_live_jurisdictions_model (2364-2385)
backend/compact-connect/stacks/api_stack/v1_api/api_model.py (1)
backend/compact-connect/tests/app/base.py (1)
  • get_context (59-60)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: TestApp
🔇 Additional comments (4)
backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (4)

38-40: LGTM: Live jurisdictions resource wiring is clear.

The attribute and comment align with the new public path /v1/public/jurisdictions/live.


63-66: LGTM: Endpoint registration is correctly invoked during initialization.

Naming matches the defined method; ordering consistent with other endpoints.


133-164: The review comment is incorrect; the code is already correct.

The get_live_jurisdictions_model is a @property decorator, not a regular method. When accessing a property like self.api_model.get_live_jurisdictions_model, Python automatically invokes the property getter and returns the Model instance. Adding () would be wrong since it would attempt to call the Model object itself.

The diff suggested in the review is not needed—the current code is already correct.

Likely an incorrect or invalid review comment.


24-24: No action required—call site already updated.

The constructor signature change is properly reflected in the call site at backend/compact-connect/stacks/api_stack/v1_api/api.py:181, where live_jurisdictions_resource=self.live_jurisdictions_resource is correctly passed.


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 and usage tips.

@ChiefStief ChiefStief marked this pull request as ready for review October 8, 2025 20:51
Copy link
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 (3)
backend/compact-connect/tests/app/test_api/test_compact_configuration_api.py (1)

186-203: Consider adding response model validation for consistency.

Other tests in this file validate response models (e.g., lines 74-93), but this test doesn't capture or verify the response model. While the endpoint may not require a formal response model, adding validation would maintain consistency with the established testing pattern.

Consider adding model validation similar to other tests:

         # Ensure the GET method is configured with the lambda integration (no authorizer since it's public)
+        method_model_logical_id_capture = Capture()
         api_stack_template.has_resource_properties(
             type=CfnMethod.CFN_RESOURCE_TYPE_NAME,
             props={
                 'HttpMethod': 'GET',
                 'ResourceId': {'Ref': live_compacts_jurisdictions_resource_id},
                 # ensure the lambda integration is configured with the expected handler
                 'Integration': TestApi.generate_expected_integration_object(
                     api_stack.get_logical_id(
                         api_stack.api.v1_api.compact_configuration_api.compact_configuration_api_function.node.default_child,
                     ),
                 ),
                 'MethodResponses': [
                     {
+                        'ResponseModels': {'application/json': {'Ref': method_model_logical_id_capture}},
                         'StatusCode': '200',
                     },
                 ],
             },
         )
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (1)

123-156: Consider documenting the invalid query parameter fallback behavior.

The handler silently falls back to returning all compacts when an invalid compact query parameter is provided (lines 136-146). While this behavior is intentional and tested, it's not documented in the function docstring. Adding a note about this fallback would improve API clarity for future maintainers.

Consider updating the docstring:

 def _get_live_public_compact_jurisdictions(event: dict, context: LambdaContext):  # noqa: ARG001 unused-argument
     """
     Endpoint to get all live jurisdictions, optionally filtered by compact.
 
     :param event: API Gateway event with optional query parameter 'compact'
     :param context: Lambda context
     :return: Dictionary with compact abbreviations as keys and lists of live jurisdiction abbreviations as values
+    
+    Note: If an invalid compact is provided in the query parameter, the endpoint returns 
+    data for all compacts rather than raising an error. This provides a graceful fallback 
+    for the optional filter parameter.
     """
backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (1)

164-193: Consider adding a response model for API consistency.

The endpoint doesn't define a response model (lines 169-173), while other public endpoints in this file do (e.g., lines 140-145). While this may be acceptable for a simple dictionary response, adding a response model would:

  1. Maintain consistency with other endpoints
  2. Enable API Gateway response validation
  3. Improve OpenAPI spec completeness

Consider adding a response model:

         get_live_compact_jurisdictions_method = self.live_compacts_jurisdictions_resource.add_method(
             'GET',
             LambdaIntegration(compact_configuration_api_handler),
             method_responses=[
                 MethodResponse(
                     status_code='200',
+                    response_models={'application/json': self.api_model.get_live_jurisdictions_response_model},
                 ),
             ],
             request_parameters={
                 'method.request.querystring.compact': False,
             },
         )

Note: This would require defining get_live_jurisdictions_response_model in the api_model.py file.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 059428e and 986f8ef.

📒 Files selected for processing (7)
  • backend/compact-connect/docs/internal/api-specification/latest-oas30.json (1 hunks)
  • backend/compact-connect/lambdas/python/common/cc_common/data_model/compact_configuration_client.py (1 hunks)
  • backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (2 hunks)
  • backend/compact-connect/lambdas/python/compact-configuration/tests/function/test_compact_configuration.py (2 hunks)
  • backend/compact-connect/stacks/api_stack/v1_api/api.py (2 hunks)
  • backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (4 hunks)
  • backend/compact-connect/tests/app/test_api/test_compact_configuration_api.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: landonshumway-ia
PR: csg-org/CompactConnect#882
File: backend/compact-connect/lambdas/python/migration/compact_configured_states_871/main.py:127-130
Timestamp: 2025-06-26T16:42:00.781Z
Learning: In the compact_configured_states_871 migration, existing jurisdiction configurations that have licenseeRegistrationEnabled: true are migrated with isLive: true for backwards compatibility. This prevents breaking existing live functionality since those states are already operational. The migration preserves the current live state of jurisdictions to maintain service continuity, while new states added after migration can start with isLive: false and be controlled by compact admins.
🧬 Code graph analysis (5)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (3)
backend/compact-connect/lambdas/python/common/cc_common/utils.py (1)
  • get (86-87)
backend/compact-connect/lambdas/python/common/cc_common/config.py (2)
  • compacts (104-105)
  • compact_configuration_client (48-51)
backend/compact-connect/lambdas/python/common/cc_common/data_model/compact_configuration_client.py (1)
  • get_live_compact_jurisdictions (454-480)
backend/compact-connect/tests/app/test_api/test_compact_configuration_api.py (1)
backend/compact-connect/tests/app/test_api/__init__.py (2)
  • TestApi (11-83)
  • generate_expected_integration_object (28-45)
backend/compact-connect/lambdas/python/compact-configuration/tests/function/test_compact_configuration.py (2)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (1)
  • compact_configuration_api_handler (24-42)
backend/compact-connect/lambdas/python/common/common_test/test_data_generator.py (1)
  • put_default_compact_configuration_in_configuration_table (556-572)
backend/compact-connect/lambdas/python/common/cc_common/data_model/compact_configuration_client.py (2)
backend/compact-connect/lambdas/python/common/cc_common/exceptions.py (1)
  • CCNotFoundException (32-33)
backend/compact-connect/lambdas/python/common/cc_common/data_model/schema/compact/__init__.py (1)
  • configuredStates (139-140)
backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (1)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (1)
  • compact_configuration_api_handler (24-42)
🪛 Checkov (3.2.334)
backend/compact-connect/docs/internal/api-specification/latest-oas30.json

[medium] 35-39: Ensure that arrays have a maximum number of items

(CKV_OPENAPI_21)

🔇 Additional comments (6)
backend/compact-connect/lambdas/python/common/cc_common/data_model/compact_configuration_client.py (1)

454-480: LGTM!

The method correctly filters configured states for live jurisdictions and appropriately returns an empty list when the compact configuration is not found. This graceful handling is suitable for the use case where the handler queries multiple compacts in a loop.

backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (1)

31-32: LGTM!

Route registration correctly wired for the new live jurisdictions endpoint.

backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (2)

23-43: LGTM!

Constructor properly updated to accept and store the new live jurisdictions resource.


94-96: LGTM!

Endpoint correctly added to API initialization flow.

backend/compact-connect/lambdas/python/compact-configuration/tests/function/test_compact_configuration.py (2)

15-15: LGTM!

Constant properly defined for the new endpoint resource path.


195-331: LGTM!

Comprehensive test coverage for the live jurisdictions endpoint, including:

  • All compacts scenario (no query parameter)
  • Specific compact filtering (valid query parameter)
  • Graceful fallback behavior (invalid query parameter)

The tests properly verify the response structure and use assertCountEqual for order-independent comparison.

@ChiefStief ChiefStief changed the title backend only live states on registration Live jusrisidictions endpoint #1055 Oct 8, 2025
Copy link
Collaborator

@landonshumway-ia landonshumway-ia 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. Just a couple of considerations I would like to get your thoughts on before I approve.

Copy link
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 (2)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (1)

137-143: Use logger.info or logger.warning for client errors.

Line 142 uses logger.error for an invalid query parameter, which is a client error (400 response). Reserve logger.error for server errors (5xx); use logger.info or logger.warning for client errors to maintain proper log severity levels.

Apply this diff:

         else:
-            logger.error('Invalid compact provided', compact=compact_filter)
+            logger.info('Invalid compact provided', compact=compact_filter)
             raise CCInvalidRequestException(f'Invalid request query param: {compact_filter}')
backend/compact-connect/stacks/api_stack/v1_api/api.py (1)

130-133: Update misleading comments.

The comments on lines 130 and 132 mention "compacts" in the path, but the actual resources created are:

  • Line 131: /v1/public/jurisdictions
  • Line 133: /v1/public/jurisdictions/live

These comments appear to be outdated from when the path structure included "compacts" (before addressing previous review feedback).

Apply this diff to correct the comments:

-        # /v1/public/compacts/jurisdictions
+        # /v1/public/jurisdictions
         self.public_jurisdictions_resource = self.public_resource.add_resource('jurisdictions')
-        # /v1/public/compacts/jurisdictions/live
+        # /v1/public/jurisdictions/live
         self.live_jurisdictions_resource = self.public_jurisdictions_resource.add_resource('live')
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 986f8ef and cfce839.

📒 Files selected for processing (3)
  • backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (2 hunks)
  • backend/compact-connect/lambdas/python/compact-configuration/tests/function/test_compact_configuration.py (2 hunks)
  • backend/compact-connect/stacks/api_stack/v1_api/api.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • backend/compact-connect/lambdas/python/compact-configuration/tests/function/test_compact_configuration.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-15T19:59:09.332Z
Learnt from: jusdino
PR: csg-org/CompactConnect#1004
File: backend/compact-connect/docs/internal/api-specification/latest-oas30.json:2305-2354
Timestamp: 2025-08-15T19:59:09.332Z
Learning: In the CompactConnect API, the history endpoint paths are intentionally different between internal and public APIs. Internal compacts history includes "/privileges/" in the path (/v1/compacts/{compact}/providers/{providerId}/privileges/jurisdiction/{jurisdiction}/licenseType/{licenseType}/history) while public compacts history omits it (/v1/public/compacts/{compact}/providers/{providerId}/jurisdiction/{jurisdiction}/licenseType/{licenseType}/history). This inconsistency is a deliberate product design choice, not an oversight.

Applied to files:

  • backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py
🧬 Code graph analysis (1)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (3)
backend/compact-connect/lambdas/python/common/cc_common/config.py (2)
  • compacts (104-105)
  • compact_configuration_client (48-51)
backend/compact-connect/lambdas/python/common/cc_common/exceptions.py (1)
  • CCInvalidRequestException (7-8)
backend/compact-connect/lambdas/python/common/cc_common/data_model/compact_configuration_client.py (1)
  • get_live_compact_jurisdictions (454-480)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: TestApp
🔇 Additional comments (2)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (2)

31-32: LGTM!

The route registration correctly maps the new public endpoint to the handler. The path /v1/public/jurisdictions/live aligns with the feedback from previous reviews to remove "compacts" from the path since the endpoint isn't specific to a single compact.


144-155: LGTM!

The logic correctly handles both filtered and unfiltered queries, assembles the result dictionary, and logs appropriately. The implementation cleanly delegates to get_live_compact_jurisdictions for each compact.

Copy link
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

♻️ Duplicate comments (1)
backend/compact-connect/stacks/api_stack/v1_api/api.py (1)

212-212: Verify the parameter name matches CompactConfigurationApi's constructor.

The parameter name live_compacts_jurisdictions_resource includes "compacts", but the attribute being passed is self.live_jurisdictions_resource (no "compacts"). A previous review comment flagged this inconsistency, suggesting the parameter name should match the attribute name for clarity.

#!/bin/bash
# Verify the expected parameter name in CompactConfigurationApi's __init__ method
ast-grep --pattern $'class CompactConfigurationApi:
  $$$
  def __init__($$$, live_$_jurisdictions_resource$$$):
    $$$'
🧹 Nitpick comments (3)
backend/compact-connect/docs/internal/api-specification/latest-oas30.json (3)

19-26: Constrain compact query to known enums

Add enum to the compact query parameter for validation and client clarity (values used elsewhere: aslp, octp, coun).

         "schema": {
-          "type": "string"
+          "type": "string",
+          "enum": ["aslp", "octp", "coun"]
         }

28-49: Add 400 response for invalid compact and tighten response schema

  • Include a 400 response for invalid/unknown compact query.
  • Constrain jurisdiction array items to the standard two-letter enums used throughout the spec.
  • Optionally add maxItems to satisfy CKV_OPENAPI_21.
       "responses": {
         "200": {
           "description": "200 response - Returns a dictionary with compact abbreviations as keys and arrays of live jurisdiction postal abbreviations as values",
           "content": {
             "application/json": {
               "schema": {
                 "type": "object",
                 "additionalProperties": {
                   "type": "array",
+                  "maxItems": 60,
                   "items": {
-                    "type": "string"
+                    "type": "string",
+                    "enum": [
+                      "al","ak","az","ar","ca","co","ct","de","dc","fl","ga","hi","id","il","in","ia","ks","ky","la","me","md","ma","mi","mn","ms","mo","mt","ne","nv","nh","nj","nm","ny","nc","nd","oh","ok","or","pa","pr","ri","sc","sd","tn","tx","ut","vt","va","vi","wa","wv","wi","wy"
+                    ]
                   }
                 },
                 "example": {
                   "aslp": ["co", "ne", "wy"],
                   "octp": ["ak", "ky"]
                 }
               }
             }
           }
-        }
+        },
+        "400": {
+          "description": "Bad request (e.g., invalid compact value)",
+          "content": {
+            "application/json": {
+              "schema": { "$ref": "#/components/schemas/SandboLicenmbpMIz6MrP1s" }
+            }
+          }
+        }
       }

Note: If the handler returns a different error shape, reference the appropriate schema.


33-46: Consider restricting object keys to known compact abbreviations

If feasible, define explicit properties for "aslp", "octp", "coun" (and disallow additional) to improve typing for clients. Otherwise, current additionalProperties is acceptable.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cfce839 and e3d9538.

📒 Files selected for processing (2)
  • backend/compact-connect/docs/internal/api-specification/latest-oas30.json (1 hunks)
  • backend/compact-connect/stacks/api_stack/v1_api/api.py (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-15T19:59:09.332Z
Learnt from: jusdino
PR: csg-org/CompactConnect#1004
File: backend/compact-connect/docs/internal/api-specification/latest-oas30.json:2305-2354
Timestamp: 2025-08-15T19:59:09.332Z
Learning: In the CompactConnect API, the history endpoint paths are intentionally different between internal and public APIs. Internal compacts history includes "/privileges/" in the path (/v1/compacts/{compact}/providers/{providerId}/privileges/jurisdiction/{jurisdiction}/licenseType/{licenseType}/history) while public compacts history omits it (/v1/public/compacts/{compact}/providers/{providerId}/jurisdiction/{jurisdiction}/licenseType/{licenseType}/history). This inconsistency is a deliberate product design choice, not an oversight.

Applied to files:

  • backend/compact-connect/docs/internal/api-specification/latest-oas30.json
🪛 Checkov (3.2.334)
backend/compact-connect/docs/internal/api-specification/latest-oas30.json

[medium] 35-39: Ensure that arrays have a maximum number of items

(CKV_OPENAPI_21)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: TestApp
🔇 Additional comments (1)
backend/compact-connect/docs/internal/api-specification/latest-oas30.json (1)

13-13: Path is correct and consistent across the codebase.

The endpoint path /v1/public/jurisdictions/live in the spec is correct. Verification of the API stack (api.py), handler (compact_configuration.py), and tests confirms:

  1. Stack construction (lines 131–133 of api.py): public_resource.add_resource('jurisdictions').add_resource('live') builds /v1/public/jurisdictions/live
  2. Handler routing (line 31 of compact_configuration.py): Routes on '/v1/public/jurisdictions/live'
  3. Test constants: LIVE_JURISDICTIONS_ENDPOINT_RESOURCE = '/v1/public/jurisdictions/live'

The misleading comments in the stack code suggesting /v1/public/compacts/jurisdictions/live do not reflect the actual resource hierarchy. The live jurisdictions endpoint is intentionally a direct child of /v1/public/, not nested under compacts. No changes to the spec are needed.

Copy link
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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3d9538 and f1ffd13.

📒 Files selected for processing (1)
  • backend/compact-connect/tests/app/test_api/test_compact_configuration_api.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
backend/compact-connect/tests/app/test_api/test_compact_configuration_api.py (1)
backend/compact-connect/tests/app/test_api/__init__.py (2)
  • TestApi (11-83)
  • generate_expected_integration_object (28-45)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: TestApp

Copy link
Collaborator

@landonshumway-ia landonshumway-ia left a comment

Choose a reason for hiding this comment

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

One more

Copy link
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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dc286b3 and ca4eda3.

📒 Files selected for processing (1)
  • backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-15T19:59:09.332Z
Learnt from: jusdino
PR: csg-org/CompactConnect#1004
File: backend/compact-connect/docs/internal/api-specification/latest-oas30.json:2305-2354
Timestamp: 2025-08-15T19:59:09.332Z
Learning: In the CompactConnect API, the history endpoint paths are intentionally different between internal and public APIs. Internal compacts history includes "/privileges/" in the path (/v1/compacts/{compact}/providers/{providerId}/privileges/jurisdiction/{jurisdiction}/licenseType/{licenseType}/history) while public compacts history omits it (/v1/public/compacts/{compact}/providers/{providerId}/jurisdiction/{jurisdiction}/licenseType/{licenseType}/history). This inconsistency is a deliberate product design choice, not an oversight.

Applied to files:

  • backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py
🧬 Code graph analysis (1)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (3)
backend/compact-connect/lambdas/python/common/cc_common/config.py (2)
  • compacts (104-105)
  • compact_configuration_client (48-51)
backend/compact-connect/lambdas/python/common/cc_common/exceptions.py (1)
  • CCInvalidRequestException (7-8)
backend/compact-connect/lambdas/python/common/cc_common/data_model/compact_configuration_client.py (1)
  • get_live_compact_jurisdictions (454-480)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: TestApp
🔇 Additional comments (1)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (1)

31-32: LGTM!

The routing for the new public live jurisdictions endpoint follows the established pattern and correctly maps to the handler function.

@ChiefStief ChiefStief requested a review from jlkravitz October 15, 2025 21:39
@ChiefStief
Copy link
Contributor Author

@jlkravitz This is ready for your review

Copy link
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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca4eda3 and 270ebb4.

📒 Files selected for processing (4)
  • backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (2 hunks)
  • backend/compact-connect/stacks/api_stack/v1_api/api.py (2 hunks)
  • backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (4 hunks)
  • backend/compact-connect/tests/app/test_api/test_compact_configuration_api.py (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-15T19:59:09.332Z
Learnt from: jusdino
PR: csg-org/CompactConnect#1004
File: backend/compact-connect/docs/internal/api-specification/latest-oas30.json:2305-2354
Timestamp: 2025-08-15T19:59:09.332Z
Learning: In the CompactConnect API, the history endpoint paths are intentionally different between internal and public APIs. Internal compacts history includes "/privileges/" in the path (/v1/compacts/{compact}/providers/{providerId}/privileges/jurisdiction/{jurisdiction}/licenseType/{licenseType}/history) while public compacts history omits it (/v1/public/compacts/{compact}/providers/{providerId}/jurisdiction/{jurisdiction}/licenseType/{licenseType}/history). This inconsistency is a deliberate product design choice, not an oversight.

Applied to files:

  • backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py
📚 Learning: 2025-08-18T21:59:25.029Z
Learnt from: landonshumway-ia
PR: csg-org/CompactConnect#1014
File: backend/compact-connect/stacks/api_stack/v1_api/api.py:31-36
Timestamp: 2025-08-18T21:59:25.029Z
Learning: The CompactConnect codebase has two separate V1Api implementations: one for the internal API stack (backend/compact-connect/stacks/api_stack/v1_api/api.py) and one for the state API stack (backend/compact-connect/stacks/state_api_stack/v1_api/api.py). These are distinct classes with different constructor signatures and purposes. Changes to one V1Api implementation do not necessarily affect the other.

Applied to files:

  • backend/compact-connect/stacks/api_stack/v1_api/api.py
🧬 Code graph analysis (3)
backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (1)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (1)
  • compact_configuration_api_handler (24-42)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (3)
backend/compact-connect/lambdas/python/common/cc_common/config.py (2)
  • compacts (104-105)
  • compact_configuration_client (48-51)
backend/compact-connect/lambdas/python/common/cc_common/exceptions.py (1)
  • CCInvalidRequestException (7-8)
backend/compact-connect/lambdas/python/common/cc_common/data_model/compact_configuration_client.py (1)
  • get_live_compact_jurisdictions (454-480)
backend/compact-connect/tests/app/test_api/test_compact_configuration_api.py (1)
backend/compact-connect/tests/app/test_api/__init__.py (2)
  • TestApi (11-83)
  • generate_expected_integration_object (28-45)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: TestApp
🔇 Additional comments (1)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (1)

123-156: LGTM!

The implementation correctly:

  • Handles the optional compact query parameter for filtering
  • Validates the compact abbreviation and raises CCInvalidRequestException with a 400 response for invalid input (addressing previous review feedback)
  • Uses info-level logging for user errors (as per coding guidelines)
  • Returns a dictionary mapping compact abbreviations to lists of live jurisdiction postal abbreviations
  • Follows the pattern of other public endpoints (no authorization required)

The logic properly handles both scenarios: returning live jurisdictions for a specific compact when filtered, or for all compacts when unfiltered.

Copy link
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 (4)
backend/compact-connect/tests/app/test_api/test_compact_configuration_api.py (1)

185-203: Also assert query param presence and no authorizer for public endpoint.

Add RequestParameters to the assertion and explicitly check that AuthorizerId is absent to avoid regressions.

         api_stack_template.has_resource_properties(
             type=CfnMethod.CFN_RESOURCE_TYPE_NAME,
             props={
                 'HttpMethod': 'GET',
                 'ResourceId': {'Ref': live_jurisdictions_resource_id},
                 # ensure the lambda integration is configured with the expected handler
                 'Integration': TestApi.generate_expected_integration_object(
                     api_stack.get_logical_id(
                         api_stack.api.v1_api.compact_configuration_api.compact_configuration_api_function.node.default_child,
                     ),
                 ),
+                'RequestParameters': {
+                    'method.request.querystring.compact': False,
+                },
                 'MethodResponses': [
                     {
                         'StatusCode': '200',
                     },
                 ],
             },
         )

Add this negative assertion below to ensure it stays public:

# Assert no authorizer configured on the live jurisdictions GET method
methods = api_stack_template.find_resources(CfnMethod.CFN_RESOURCE_TYPE_NAME)
matching = [
    v for v in methods.values()
    if v['Properties'].get('HttpMethod') == 'GET'
    and v['Properties'].get('ResourceId') == {'Ref': live_jurisdictions_resource_id}
]
self.assertTrue(matching, 'Expected to find GET method for live jurisdictions resource')
self.assertNotIn('AuthorizerId', matching[0]['Properties'])
backend/compact-connect/docs/api-specification/latest-oas30.json (1)

13-67: Add maxItems to satisfy Checkov and constrain array size.

The array of jurisdiction codes lacks maxItems. Add it to address CKV_OPENAPI_21 and improve validation. Optionally constrain item format.

           "responses": {
             "200": {
               "description": "200 response - Returns a dictionary with compact abbreviations as keys and arrays of live jurisdiction postal abbreviations as values",
               "content": {
                 "application/json": {
                   "schema": {
                     "type": "object",
                     "additionalProperties": {
-                      "type": "array",
-                      "items": {
-                        "type": "string"
-                      }
+                      "type": "array",
+                      "maxItems": 100,
+                      "items": {
+                        "type": "string"
+                        /* optionally add: "pattern": "^[a-z]{2}$" */
+                      }
                     },
                     "example": {
                       "aslp": ["co", "ne", "wy"],
                       "octp": ["ak", "ky"]
                     }
                   }
                 }
               }
             },

If you prefer stricter validation, consider adding enum on the compact query parameter: ["aslp","octp","coun"].

backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (1)

164-194: Optional: add a response model for stronger contract enforcement.

Endpoint is public and correctly sets optional query param. To keep parity with other endpoints and the OAS, consider adding a response model (e.g., get_live_jurisdictions_response_model) so API Gateway validates responses.

backend/compact-connect/docs/internal/api-specification/latest-oas30.json (1)

17-26: Constrain the compact query schema to the allowed abbreviations.

The handler rejects unknown compact codes with a 400, but the OpenAPI schema currently advertises an unconstrained string. Tightening the schema (e.g., enum ["aslp","octp","coun"]) keeps the contract truthful and lets client tooling surface validation errors earlier.

Apply this diff to the schema block:

-            "schema": {
-              "type": "string"
-            }
+            "schema": {
+              "type": "string",
+              "enum": ["aslp", "octp", "coun"]
+            }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 270ebb4 and a0aeb43.

📒 Files selected for processing (4)
  • backend/compact-connect/docs/api-specification/latest-oas30.json (1 hunks)
  • backend/compact-connect/docs/internal/api-specification/latest-oas30.json (1 hunks)
  • backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (4 hunks)
  • backend/compact-connect/tests/app/test_api/test_compact_configuration_api.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-15T19:59:09.332Z
Learnt from: jusdino
PR: csg-org/CompactConnect#1004
File: backend/compact-connect/docs/internal/api-specification/latest-oas30.json:2305-2354
Timestamp: 2025-08-15T19:59:09.332Z
Learning: In the CompactConnect API, the history endpoint paths are intentionally different between internal and public APIs. Internal compacts history includes "/privileges/" in the path (/v1/compacts/{compact}/providers/{providerId}/privileges/jurisdiction/{jurisdiction}/licenseType/{licenseType}/history) while public compacts history omits it (/v1/public/compacts/{compact}/providers/{providerId}/jurisdiction/{jurisdiction}/licenseType/{licenseType}/history). This inconsistency is a deliberate product design choice, not an oversight.

Applied to files:

  • backend/compact-connect/docs/internal/api-specification/latest-oas30.json
🧬 Code graph analysis (2)
backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (2)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (1)
  • compact_configuration_api_handler (24-42)
backend/compact-connect/common_constructs/python_function.py (1)
  • PythonFunction (21-155)
backend/compact-connect/tests/app/test_api/test_compact_configuration_api.py (1)
backend/compact-connect/tests/app/test_api/__init__.py (2)
  • TestApi (11-83)
  • generate_expected_integration_object (28-45)
🪛 Checkov (3.2.334)
backend/compact-connect/docs/api-specification/latest-oas30.json

[medium] 35-39: Ensure that arrays have a maximum number of items

(CKV_OPENAPI_21)

backend/compact-connect/docs/internal/api-specification/latest-oas30.json

[medium] 35-39: Ensure that arrays have a maximum number of items

(CKV_OPENAPI_21)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: TestApp
🔇 Additional comments (1)
backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (1)

94-97: LGTM: live jurisdictions endpoint wired.

Correctly registers GET /v1/public/jurisdictions/live with the shared handler.

Copy link
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.

One edit on a test name/docstring, but otherwise looks great!

@ChiefStief
Copy link
Contributor Author

@jlkravitz ready for another look

@ChiefStief ChiefStief requested a review from jlkravitz October 22, 2025 18:17
Copy link
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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0aeb43 and f9bb7e8.

📒 Files selected for processing (1)
  • backend/compact-connect/lambdas/python/compact-configuration/tests/function/test_compact_configuration.py (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
backend/compact-connect/lambdas/python/compact-configuration/tests/function/test_compact_configuration.py (2)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (1)
  • compact_configuration_api_handler (24-42)
backend/compact-connect/lambdas/python/common/common_test/test_data_generator.py (1)
  • put_default_compact_configuration_in_configuration_table (556-572)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: TestApp
🔇 Additional comments (3)
backend/compact-connect/lambdas/python/compact-configuration/tests/function/test_compact_configuration.py (3)

15-15: LGTM! Clear constant definition.

The endpoint resource constant is properly defined and follows the existing naming convention.


195-250: LGTM! Comprehensive test coverage.

This test effectively validates the endpoint behavior when no query parameter is provided, correctly verifying that all compacts are returned with their respective live jurisdictions. The use of assertCountEqual for list comparisons is appropriate.


251-291: LGTM! Properly tests single-compact filtering.

This test correctly validates that when a specific compact is requested via query parameter, only that compact's live jurisdictions are returned. The assertions appropriately verify both inclusion and exclusion of expected data.

@ChiefStief ChiefStief changed the title Live jusrisidictions endpoint #1055 Live jurisidictions endpoint #1055 Oct 22, 2025
Copy link
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 (2)
backend/compact-connect/docs/internal/api-specification/latest-oas30.json (1)

13-67: Tighten schema + reuse error component for GET /v1/public/jurisdictions/live

  • Validate compact with an enum to reflect allowed values.
  • Constrain returned jurisdiction arrays: enforce uniqueness, reasonable max size, and two‑letter lowercase codes.
  • Reuse existing message schema instead of an inline 400 object for consistency.

Apply minimally invasive edits:

@@
         "parameters": [
           {
             "name": "compact",
             "in": "query",
             "required": false,
             "description": "Optional compact abbreviation to filter results. If not provided, returns data for all compacts. If an invalid compact is provided, returns a 400 error.",
-            "schema": {
-              "type": "string"
-            }
+            "schema": {
+              "type": "string",
+              "enum": ["aslp", "octp", "coun"]
+            }
           }
         ],
@@
-                  "additionalProperties": {
-                    "type": "array",
-                    "items": {
-                      "type": "string"
-                    }
-                  },
+                  "additionalProperties": {
+                    "type": "array",
+                    "uniqueItems": true,
+                    "maxItems": 60,
+                    "items": {
+                      "type": "string",
+                      "pattern": "^[a-z]{2}$"
+                    }
+                  },
@@
           "400": {
             "description": "400 response - Invalid compact abbreviation provided",
             "content": {
               "application/json": {
                 "schema": {
-                  "type": "object",
-                  "properties": {
-                    "message": {
-                      "type": "string",
-                      "example": "Invalid request query param: invalid_compact"
-                    }
-                  }
+                  "$ref": "#/components/schemas/SandboLicenaLbwv28ZqyH6"
                 }
               }
             }
           }

Note: ensure these constraints are added in the CDK/source so the autogen step reflects them in this file. Based on learnings.

backend/compact-connect/docs/api-specification/latest-oas30.json (1)

13-67: Add enum for compact and constrain array items; align 400 with existing StateApi error schema

  • Add enum ["aslp","octp","coun"] to the query param.
  • Add uniqueItems, maxItems, and a two‑letter lowercase pattern for jurisdiction codes.
  • Prefer referencing #/components/schemas/SandboStatecjpoBVtvh5nr for 400 to match other endpoints.

Suggested patch:

@@
         "parameters": [
           {
             "name": "compact",
             "in": "query",
             "required": false,
             "description": "Optional compact abbreviation to filter results. If not provided, returns data for all compacts. If an invalid compact is provided, returns a 400 error.",
-            "schema": {
-              "type": "string"
-            }
+            "schema": {
+              "type": "string",
+              "enum": ["aslp", "octp", "coun"]
+            }
           }
         ],
@@
-                  "additionalProperties": {
-                    "type": "array",
-                    "items": {
-                      "type": "string"
-                    }
-                  },
+                  "additionalProperties": {
+                    "type": "array",
+                    "uniqueItems": true,
+                    "maxItems": 60,
+                    "items": {
+                      "type": "string",
+                      "pattern": "^[a-z]{2}$"
+                    }
+                  },
@@
           "400": {
             "description": "400 response - Invalid compact abbreviation provided",
             "content": {
               "application/json": {
-                "schema": {
-                  "type": "object",
-                  "properties": {
-                    "message": {
-                      "type": "string",
-                      "example": "Invalid request query param: invalid_compact"
-                    }
-                  }
-                }
+                "schema": { "$ref": "#/components/schemas/SandboStatecjpoBVtvh5nr" }
               }
             }
           }

As this file is auto‑generated, make the change in the source shapes so regeneration preserves it. Based on learnings.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f9bb7e8 and 03d6657.

📒 Files selected for processing (5)
  • backend/compact-connect/docs/api-specification/latest-oas30.json (1 hunks)
  • backend/compact-connect/docs/internal/api-specification/latest-oas30.json (1 hunks)
  • backend/compact-connect/stacks/api_stack/v1_api/api.py (2 hunks)
  • backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (4 hunks)
  • backend/compact-connect/tests/app/test_api/test_compact_configuration_api.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • backend/compact-connect/stacks/api_stack/v1_api/api.py
  • backend/compact-connect/tests/app/test_api/test_compact_configuration_api.py
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-15T19:59:09.332Z
Learnt from: jusdino
PR: csg-org/CompactConnect#1004
File: backend/compact-connect/docs/internal/api-specification/latest-oas30.json:2305-2354
Timestamp: 2025-08-15T19:59:09.332Z
Learning: In the CompactConnect API, the history endpoint paths are intentionally different between internal and public APIs. Internal compacts history includes "/privileges/" in the path (/v1/compacts/{compact}/providers/{providerId}/privileges/jurisdiction/{jurisdiction}/licenseType/{licenseType}/history) while public compacts history omits it (/v1/public/compacts/{compact}/providers/{providerId}/jurisdiction/{jurisdiction}/licenseType/{licenseType}/history). This inconsistency is a deliberate product design choice, not an oversight.

Applied to files:

  • backend/compact-connect/docs/api-specification/latest-oas30.json
📚 Learning: 2025-08-22T21:20:35.260Z
Learnt from: landonshumway-ia
PR: csg-org/CompactConnect#1029
File: backend/compact-connect/docs/api-specification/latest-oas30.json:468-471
Timestamp: 2025-08-22T21:20:35.260Z
Learning: The file backend/compact-connect/docs/api-specification/latest-oas30.json is auto-generated by API Gateway and should not be modified inline. Any schema changes would need to be addressed at the source in the CDK/CloudFormation definitions.

Applied to files:

  • backend/compact-connect/docs/api-specification/latest-oas30.json
🧬 Code graph analysis (1)
backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (1)
backend/compact-connect/lambdas/python/compact-configuration/handlers/compact_configuration.py (1)
  • compact_configuration_api_handler (24-42)
🪛 Checkov (3.2.334)
backend/compact-connect/docs/api-specification/latest-oas30.json

[medium] 35-39: Ensure that arrays have a maximum number of items

(CKV_OPENAPI_21)

backend/compact-connect/docs/internal/api-specification/latest-oas30.json

[medium] 35-39: Ensure that arrays have a maximum number of items

(CKV_OPENAPI_21)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: TestApp
🔇 Additional comments (3)
backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (3)

24-24: LGTM: Constructor parameter addition.

The live_jurisdictions_resource parameter follows the established pattern for resource injection and is properly typed.


38-39: LGTM: Instance variable assignment.

The comment and assignment properly document and store the live jurisdictions resource.


63-65: LGTM: Method invocation.

The call correctly invokes the endpoint setup method with the appropriate handler parameter.

jlkravitz
jlkravitz previously approved these changes Oct 22, 2025
Copy link
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.

@ChiefStief This looks good to me! Looks like there are a couple CodeRabbit comments that need to be resolved before @isabeleliassen can merge. Feel free to address or resolve those as needed.

Copy link
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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03d6657 and c396915.

📒 Files selected for processing (3)
  • backend/compact-connect/lambdas/python/compact-configuration/tests/function/test_compact_configuration.py (2 hunks)
  • backend/compact-connect/stacks/api_stack/v1_api/api_model.py (1 hunks)
  • backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • backend/compact-connect/lambdas/python/compact-configuration/tests/function/test_compact_configuration.py
  • backend/compact-connect/stacks/api_stack/v1_api/compact_configuration_api.py
🧰 Additional context used
🧬 Code graph analysis (1)
backend/compact-connect/stacks/api_stack/v1_api/api_model.py (6)
backend/compact-connect/tests/app/base.py (1)
  • get_context (59-60)
backend/compact-connect/tests/app/test_pipeline.py (1)
  • get_context (22-31)
backend/compact-connect-ui-app/tests/app/test_pipeline.py (1)
  • get_context (11-21)
backend/compact-connect/tests/app/test_api/__init__.py (1)
  • get_context (17-25)
backend/compact-connect/tests/app/test_event_listener.py (1)
  • get_context (19-27)
backend/compact-connect/tests/app/test_transaction_monitoring.py (1)
  • get_context (27-34)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: TestApp

@ChiefStief ChiefStief requested a review from jlkravitz October 23, 2025 16:05
@ChiefStief
Copy link
Contributor Author

ChiefStief commented Oct 23, 2025

@jlkravitz Code rabbit comments have been addressed. I think @isabeleliassen wanted you to give a final approval before merging

Copy link
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.

@isabeleliassen Good to merge!

@isabeleliassen isabeleliassen merged commit 9ce0d2a into csg-org:development Oct 24, 2025
5 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.

only show live states in registration BE

4 participants