Skip to content

KMS-660: Publish keyword events to SNS after a successful publish#99

Merged
cgokey merged 34 commits intomainfrom
KMS-660
Apr 13, 2026
Merged

KMS-660: Publish keyword events to SNS after a successful publish#99
cgokey merged 34 commits intomainfrom
KMS-660

Conversation

@cgokey
Copy link
Copy Markdown
Contributor

@cgokey cgokey commented Apr 9, 2026

Overview

What is the feature?

Adds the remaining KMS-660 work on top of what is already in main: publish keyword events to SNS after a successful publish, support the downstream local event flow in LocalStack, and harden the local draft/Redis behavior needed to test that flow reliably.

What is the Solution?

This branch changes only the delta beyond main:

  • publisher now publishes generated keyword events to SNS only after the SPARQL publish update succeeds
  • post-publish downstream failures are handled as partial-success behavior with explicit logging instead of failing the already-completed publish
  • local development now includes a LocalStack bridge that routes:
    EventBridge -> publisher
    EventBridge -> primeConceptsCache
    SNS/SQS -> cmrKeywordEventsListener
  • getConcepts draft requests no longer use Redis caching, which prevents stale draft comparisons during local publish testing
  • local Redis connection behavior was tightened to fail fast instead of repeatedly retrying in the background
  • local startup/docs were updated to support the new bridge workflow

What areas of the application does this impact?

  • Publisher Lambda post-publish behavior
  • SNS keyword event publication
  • Local LocalStack event routing and testing workflow
  • Draft caching behavior in getConcepts
  • Local Redis behavior
  • Local developer documentation and startup scripts

Testing

Reproduction steps

Start local dependencies and app:

npm run rdf4j:start
npm run localstack:start
npm run redis:start
npm run start-local

Create a unique draft keyword:
./scripts/local/create_unique_keyword.sh

Publish:
curl -X POST 'http://127.0.0.1:3013/publish?name=v1.0.0'

Verify in logs that:
publisher runs
keyword events are published after publish success
primeConceptsCache is invoked
cmrKeywordEventsListener is invoked
Re-run publish without new draft changes and verify the no-op path skips SNS publication.

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

htranho and others added 23 commits April 1, 2026 18:57
# Conflicts:
#	serverless/src/publisher/__tests__/handler.test.js
#	serverless/src/publisher/handler.js
#	serverless/src/shared/csvComparator.js
#	serverless/src/shared/downloadConcepts.js
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.67%. Comparing base (3ef55a2) to head (24aecf4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #99   +/-   ##
=======================================
  Coverage   99.67%   99.67%           
=======================================
  Files         154      153    -1     
  Lines        3052     3070   +18     
  Branches      748      737   -11     
=======================================
+ Hits         3042     3060   +18     
  Misses          9        9           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cgokey cgokey requested review from bmsultz-nasa and macrouch April 9, 2026 21:18
Comment thread serverless/src/shared/downloadConcepts.js Outdated
Comment thread serverless/src/publisher/handler.js
Comment thread serverless/src/shared/redisCacheStore.js Outdated
Comment thread README.md
Comment thread serverless/src/shared/downloadConcepts.js Outdated
Comment thread scripts/localstack/bridge.js Outdated
Comment thread serverless/src/publisher/handler.js Outdated
Comment thread serverless/src/publisher/handler.js Outdated
Comment thread serverless/src/publisher/handler.js
Comment thread serverless/src/publisher/handler.js Outdated
@cgokey cgokey merged commit df3adc1 into main Apr 13, 2026
6 checks passed
@cgokey cgokey deleted the KMS-660 branch April 13, 2026 17:47
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