feat: config sync worker endpoint | LLMO-3918#2048
Merged
Conversation
|
This PR will trigger a patch release when merged. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…DB sync. Added 'dryRun' parameter handling and updated logging to reflect dry run status.
…clude a new site ID for development purposes.
…ogs for both triggering and skipping sync based on site ID allowance.
…-to-DB config sync message.
…g sync, marking it as temporary for future adjustment.
vivesing
reviewed
Mar 31, 2026
|
|
||
| // Temporary: hardcoded site IDs for which the S3-to-DB config sync is enabled. | ||
| // TODO: replace with actual site UUIDs per environment. | ||
| const ALLOWED_SITE_IDS = [ |
Contributor
There was a problem hiding this comment.
should we keep both allowed sites at a single place and can be imported here.
vivesing
reviewed
Mar 31, 2026
|
|
||
| const isDryRun = dryRun === 'true'; | ||
| await context.sqs.sendMessage(context.env.AUDIT_JOBS_QUEUE_URL, { | ||
| type: 'llmo-config-db-sync', |
Contributor
There was a problem hiding this comment.
should we create a const for the topic name to be used everywhere from a single place?
vivesing
reviewed
Mar 31, 2026
| 'PATCH /v2/orgs/:spaceCatId/brands/:brandId/prompts/:promptId': 'organization:write', | ||
| 'DELETE /v2/orgs/:spaceCatId/brands/:brandId/prompts/:promptId': 'organization:write', | ||
| 'POST /v2/orgs/:spaceCatId/brands/:brandId/prompts/delete': 'organization:write', | ||
| 'POST /v2/orgs/:spaceCatId/sync-config': 'organization:write', |
Contributor
There was a problem hiding this comment.
Since these configs are site scoped I think we need to include siteId in the api path something like:
/v2/orgs/:spaceCatId/sites/:siteId/sync-config
vivesing
approved these changes
Mar 31, 2026
- Changed the endpoint for triggering config sync to include siteId in the URL. - Removed hardcoded site IDs and moved the sync check logic to a new constants file. - Updated logging to use a constant for the sync type. - Adjusted tests to reflect the new parameter structure and ensure proper validation for siteId.
…adjust corresponding test case
solaris007
pushed a commit
that referenced
this pull request
Mar 31, 2026
# [1.391.0](v1.390.2...v1.391.0) (2026-03-31) ### Features * config sync worker endpoint | LLMO-3918 ([#2048](#2048)) ([32d5a5e](32d5a5e))
Member
|
🎉 This PR is included in version 1.391.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
ravverma
pushed a commit
that referenced
this pull request
Apr 6, 2026
## Description Adds SQS-based triggering of the S3-to-Postgres config sync after every config save, plus an on-demand HTTP endpoint to manually trigger it. ### SQS trigger on config save After a successful `updateLlmoConfig` S3 write, an `llmo-config-db-sync` SQS message is dispatched to the audit jobs queue — gated by a hardcoded `ALLOWED_SITE_IDS` constant (placeholder UUIDs — must be replaced before deploy). ### On-demand sync endpoint `POST /v2/orgs/:spaceCatId/sync-config?siteId=<uuid>` — validates the organization, site ownership, user access, and site gating before enqueuing the same SQS message. ### Changes - **Modified**: `src/controllers/llmo/llmo.js` — added `ALLOWED_SITE_IDS` constant, `isSyncEnabledForSite` helper, and SQS dispatch after S3 write in `updateLlmoConfig` - **Modified**: `src/controllers/brands.js` — added `ALLOWED_SITE_IDS` constant, `isSyncEnabledForSite` helper, and `triggerConfigSync` handler - **Modified**: `src/routes/index.js` — registered `POST /v2/orgs/:spaceCatId/sync-config` - **Modified**: `test/controllers/llmo/llmo.test.js` — tests for SQS dispatch gating - **Modified**: `test/controllers/brands.test.js` — tests for `triggerConfigSync` endpoint (13 scenarios) ## Related Issues [LLMO-3918](https://jira.corp.adobe.com/browse/LLMO-3918) - [ ] make sure to link the related issues in this description. Or if there's no issue created, make sure you describe here the problem you're solving. - [ ] when merging / squashing, make sure the fixed issue references are visible in the commits, for easy compilation of release notes If the PR is changing the API specification: - [ ] make sure you add a "Not implemented yet" note the endpoint description, if the implementation is not ready yet. Ideally, return a 501 status code with a message explaining the feature is not implemented yet. - [ ] make sure you add at least one example of the request and response. If the PR is changing the API implementation or an entity exposed through the API: - [ ] make sure you update the API specification and the examples to reflect the changes. If the PR is introducing a new audit type: - [ ] make sure you update the API specification with the type, schema of the audit result and an example
ravverma
pushed a commit
that referenced
this pull request
Apr 6, 2026
# [1.391.0](v1.390.2...v1.391.0) (2026-03-31) ### Features * config sync worker endpoint | LLMO-3918 ([#2048](#2048)) ([32d5a5e](32d5a5e))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds SQS-based triggering of the S3-to-Postgres config sync after every config save, plus an on-demand HTTP endpoint to manually trigger it.
SQS trigger on config save
After a successful
updateLlmoConfigS3 write, anllmo-config-db-syncSQS message is dispatched to the audit jobs queue — gated by a hardcodedALLOWED_SITE_IDSconstant (placeholder UUIDs — must be replaced before deploy).On-demand sync endpoint
POST /v2/orgs/:spaceCatId/sync-config?siteId=<uuid>— validates the organization, site ownership, user access, and site gating before enqueuing the same SQS message.Changes
src/controllers/llmo/llmo.js— addedALLOWED_SITE_IDSconstant,isSyncEnabledForSitehelper, and SQS dispatch after S3 write inupdateLlmoConfigsrc/controllers/brands.js— addedALLOWED_SITE_IDSconstant,isSyncEnabledForSitehelper, andtriggerConfigSynchandlersrc/routes/index.js— registeredPOST /v2/orgs/:spaceCatId/sync-configtest/controllers/llmo/llmo.test.js— tests for SQS dispatch gatingtest/controllers/brands.test.js— tests fortriggerConfigSyncendpoint (13 scenarios)Related Issues
LLMO-3918
describe here the problem you're solving.
If the PR is changing the API specification:
yet. Ideally, return a 501 status code with a message explaining the feature is not implemented yet.
If the PR is changing the API implementation or an entity exposed through the API:
If the PR is introducing a new audit type: