Skip to content

export public lambda arns to avoid CDK deadly embrace lock in beta deployment#1618

Merged
isabeleliassen merged 2 commits into
csg-org:mainfrom
InspiringApps:chore/export-cross-stack-refs
Jun 2, 2026
Merged

export public lambda arns to avoid CDK deadly embrace lock in beta deployment#1618
isabeleliassen merged 2 commits into
csg-org:mainfrom
InspiringApps:chore/export-cross-stack-refs

Conversation

@landonshumway-ia
Copy link
Copy Markdown
Collaborator

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

We have removed the public API search endpoints from beta (see #1591). The deployment for that change failed due to the 'deadly embrace' issue in CDK where a stack attempts to remove an unneeded export, but CloudFormation can't allow that deletion until the consuming stack of that export has been updated. This adds dummy exports for those lambdas to fix the deployment and allow all the stacks to be updated.

Summary by CodeRabbit

  • Chores
    • Updated backend stack configurations to improve deployment stability and reliability across services.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

Warning

Review limit reached

@landonshumway-ia, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 52 minutes and 32 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5da4af8e-01d8-49d7-9e8b-5d4257cfad28

📥 Commits

Reviewing files that changed from the base of the PR and between 3d49277 and eb8077f.

📒 Files selected for processing (1)
  • backend/cosmetology-app/stacks/api_lambda_stack/public_lookup_api.py
📝 Walkthrough

Walkthrough

CloudFormation exports for public lookup Lambda ARNs are consolidated from the PublicLookupApiLambdas initializer to parent stacks (ApiLambdaStack and SearchPersistentStack) across compact-connect and cosmetology-app. Dummy exports are removed and replaced with explicit retention exports to prevent "deadly embrace" deployment failures when beta API routes are disabled.

Changes

Cross-Stack CloudFormation Export Consolidation

Layer / File(s) Summary
PublicLookupApiLambdas documentation and dummy export removal
backend/cosmetology-app/stacks/api_lambda_stack/public_lookup_api.py
Documentation clarifies that the query providers endpoint uses SearchPersistentStack.public_handler and is no longer wired to the API. The previous CDK "dummy export" for query_providers_handler.function_arn is removed after being superseded by explicit exports in parent stacks.
Cosmetology-app export consolidation
backend/cosmetology-app/stacks/api_lambda_stack/__init__.py, backend/cosmetology-app/stacks/search_persistent_stack/__init__.py
Explicit export_value(...) calls are added to ApiLambdaStack for public_lookup_lambdas handlers and to SearchPersistentStack for the public search handler to preserve CloudFormation cross-stack imports and prevent export deletion failures during beta deployments.
Compact-connect ApiLambdaStack export consolidation
backend/compact-connect/stacks/api_lambda_stack/__init__.py
Explicit exports are added for the two public lookup Lambda ARNs to preserve CloudFormation exports in the beta environment where those API routes are not deployed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • csg-org/CompactConnect#1591: The main PR's stack-level CloudFormation exports for public lookup Lambdas directly align with #1591's change to conditionally disable PublicLookupApi routes in the beta environment.

Suggested reviewers

  • ChiefStief
  • jlkravitz

Poem

🐰 A rabbit hops through stacks so tall,
Exports dance free to heed the call,
No deadly embrace shall block the way,
When beta routes must take a break today!
Cross-stack harmony, peaceful and bright,

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks required testing checklist items and does not follow the template structure with clearly defined sections. Add testing verification steps (yarn test:unit:all, yarn serve, yarn build), specify CDK tests added if applicable, and reference issue #1591 at the end with 'Closes' statement.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: exporting public lambda ARNs to resolve the CDK deadly embrace deployment issue.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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

🤖 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/cosmetology-app/stacks/api_lambda_stack/public_lookup_api.py`:
- Around line 46-47: Update the cleanup comment to reference the actual exported
handler symbol: change the TODO/note that currently mentions
SearchPersistentStack.public_handler to point at
SearchPersistentStack.search_handler.public_handler (i.e., the lambda is exposed
as search_handler.public_handler), so the future cleanup targets the correct
handler symbol.
🪄 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: 7ca05a1c-af33-42ce-b6bc-4aabd52ad59f

📥 Commits

Reviewing files that changed from the base of the PR and between eee9fc6 and 3d49277.

📒 Files selected for processing (4)
  • backend/compact-connect/stacks/api_lambda_stack/__init__.py
  • backend/cosmetology-app/stacks/api_lambda_stack/__init__.py
  • backend/cosmetology-app/stacks/api_lambda_stack/public_lookup_api.py
  • backend/cosmetology-app/stacks/search_persistent_stack/__init__.py

Comment thread backend/cosmetology-app/stacks/api_lambda_stack/public_lookup_api.py Outdated
Copy link
Copy Markdown
Collaborator

@ChiefStief ChiefStief 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!

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.

@isabeleliassen Good to merge!

@isabeleliassen isabeleliassen merged commit 044112d into csg-org:main Jun 2, 2026
8 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.

4 participants