Skip to content

Cosmetology - Remove downstream privilege notifications when license encumbered#1491

Open
landonshumway-ia wants to merge 1 commit intocsg-org:mainfrom
InspiringApps:fix/reduce-cosm-notifications
Open

Cosmetology - Remove downstream privilege notifications when license encumbered#1491
landonshumway-ia wants to merge 1 commit intocsg-org:mainfrom
InspiringApps:fix/reduce-cosm-notifications

Conversation

@landonshumway-ia
Copy link
Copy Markdown
Collaborator

@landonshumway-ia landonshumway-ia commented Apr 21, 2026

In the cosmetology system, we already notify all the live states in the compact when a license is encumbered. Sending additional privilege notifications is noisy and redundant. This was the only functionality present in the event listener stack, so the entire stack has been removed from the CDK app. If we ever need to add it back in, we can reference previous git commits or the pattern set by the other compacts to support it.

Closes #1476

Summary by CodeRabbit

  • Refactor

    • Removed the event-listening infrastructure that processed and forwarded license encumbrance and lifting events across jurisdictions.
    • Eliminated the associated stack and its initialization from the backend stage.
  • Tests

    • Removed tests and helpers that validated event-listener resources and event-publishing behavior.
    • Removed related stage test checks and a dedicated event-listener test module.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3f014eb8-0de3-4ba7-aaf0-3aa0d3806d49

📥 Commits

Reviewing files that changed from the base of the PR and between 6b64c55 and a3a2030.

📒 Files selected for processing (6)
  • backend/cosmetology-app/lambdas/python/data-events/handlers/encumbrance_events.py
  • backend/cosmetology-app/lambdas/python/data-events/tests/function/test_encumbrance_events.py
  • backend/cosmetology-app/pipeline/backend_stage.py
  • backend/cosmetology-app/stacks/event_listener_stack/__init__.py
  • backend/cosmetology-app/tests/app/base.py
  • backend/cosmetology-app/tests/app/test_event_listener.py
💤 Files with no reviewable changes (5)
  • backend/cosmetology-app/tests/app/base.py
  • backend/cosmetology-app/stacks/event_listener_stack/init.py
  • backend/cosmetology-app/lambdas/python/data-events/tests/function/test_encumbrance_events.py
  • backend/cosmetology-app/tests/app/test_event_listener.py
  • backend/cosmetology-app/pipeline/backend_stage.py

📝 Walkthrough

Walkthrough

Removed event-bus publishing handlers and the EventListenerStack plus related tests; notification-only SQS handlers remain to send emails with notification tracking.

Changes

Cohort / File(s) Summary
Event Handler Removal
backend/cosmetology-app/lambdas/python/data-events/handlers/encumbrance_events.py
Deleted two SQS consumers (license_encumbrance_listener, license_encumbrance_lifted_listener) and their EventBus/EventBatchWriter/sqs_handler imports; retained notification-tracking handlers that send emails.
Handler Tests
backend/cosmetology-app/lambdas/python/data-events/tests/function/test_encumbrance_events.py
Removed helpers and tests that asserted EventBridge/EventBus publications for privilege encumbrance and lifting; left notification-related tests.
Infrastructure Stack Removal
backend/cosmetology-app/stacks/event_listener_stack/__init__.py, backend/cosmetology-app/pipeline/backend_stage.py
Deleted EventListenerStack definition and removed its instantiation from BackendStage, eliminating the CDK resources that created the encumbrance listeners, queues, rules, and permissions.
Infrastructure Tests
backend/cosmetology-app/tests/app/test_event_listener.py, backend/cosmetology-app/tests/app/base.py
Removed the event-listener stack test file and removed event_listener_stack from base test resource-count/annotation checks.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through code with whiskers bright,

Pushed two listeners gently out of sight,
Kept the mailers warm, the notices neat,
Fewer bridges to mind, lighter my feet.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description clearly explains the rationale and scope of changes but lacks required template sections like explicit Requirements List, comprehensive Testing List, and does not follow the standard PR template structure. Add explicit Requirements List, expand Testing List with all verification steps, and follow the repository's standard PR description template format for clarity.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main objective: removing downstream privilege notifications when a license is encumbered, which aligns with the primary change across all affected files.
Linked Issues check ✅ Passed The PR successfully implements the core objective from issue #1476 by removing event listeners that generated downstream privilege notifications when licenses are encumbered, eliminating redundant notifications.
Out of Scope Changes check ✅ Passed All changes are directly scoped to removing the event listener stack and its associated handlers, tests, and references—all within scope of eliminating redundant privilege notifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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.

@landonshumway-ia landonshumway-ia changed the title Remove downstream privilege notifications when license encumbered Cosmetology - Remove downstream privilege notifications when license encumbered Apr 21, 2026
In the cosmetology system, we already notify all the live states in the compact
when a license is encumbered. Sending additional privilege notifications is noisy and redundant.
This was the only functionality present in the event listener stack, so the entire
stack has been removed from the CDK app. If we ever need to add it back in, we can
reference previous git commits or the pattern set by the other compacts to support it.
@landonshumway-ia landonshumway-ia force-pushed the fix/reduce-cosm-notifications branch from 6b64c55 to a3a2030 Compare April 21, 2026 20:45
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!

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.

BE cosmetology notifications change--when a license is encumbered, only notify of the license encumbered and not the subsequent privilege deactivations

2 participants