feat(tokowaka-client): subpath-aware metaconfig S3 key#1638
Open
dhavkuma wants to merge 1 commit into
Open
Conversation
Two subpath sites sharing the same domain (e.g. nba.com and nba.com/timberwolves) previously collided at the same S3 key opportunities/nba.com/config.json because getTokowakaMetaconfigS3Path stripped the URL path. - getTokowakaMetaconfigS3Path now includes the subpath in the S3 key so subpath sites get opportunities/nba.com/timberwolves/config.json - deploySuggestions: fix fetchMetaconfig(firstUrl) -> fetchMetaconfig(baseURL) (was passing a page URL instead of the site base URL) - previewSuggestions: fix fetchMetaconfig(previewUrl) -> fetchMetaconfig(getEffectiveBaseURL(site)) - Tests: update existing tests and add subpath cases JIRA: LLMO-4580 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
getTokowakaMetaconfigS3Pathnow includes the URL subpath in the S3 key, so two sites sharing a domain but with different base URL paths (e.g.nba.comandnba.com/timberwolves) get separate metaconfig objects:opportunities/nba.com/config.jsonandopportunities/nba.com/timberwolves/config.jsondeploySuggestionspassing a page URL tofetchMetaconfiginstead of the sitebaseURLpreviewSuggestionspassingpreviewUrl(a page URL) tofetchMetaconfiginstead ofgetEffectiveBaseURL(site)Context
Part of LLMO-4580 — supporting two sites with the same domain but different subpath base URLs as independent SpaceCat entities with separate
siteIds and IMS orgs.Dependencies
This PR should merge before:
tokowaka-worker— edge worker config lookup (reads from S3 at the key this PR writes)spacecat-api-service— already usesgetEffectiveBaseURL(site)for metaconfig, no change needed thereTest plan
npm test -w packages/spacecat-shared-tokowaka-clientpassesgetTokowakaMetaconfigS3Path('https://nba.com')→opportunities/nba.com/configgetTokowakaMetaconfigS3Path('https://nba.com/timberwolves')→opportunities/nba.com/timberwolves/configconfig.jsonobjects in S3🤖 Generated with Claude Code