Skip to content

feat(tokowaka-client): subpath-aware metaconfig S3 key#1638

Open
dhavkuma wants to merge 1 commit into
mainfrom
feature/llmo-4580-subpath-metaconfig-key
Open

feat(tokowaka-client): subpath-aware metaconfig S3 key#1638
dhavkuma wants to merge 1 commit into
mainfrom
feature/llmo-4580-subpath-metaconfig-key

Conversation

@dhavkuma

Copy link
Copy Markdown

Summary

  • getTokowakaMetaconfigS3Path now includes the URL subpath in the S3 key, so two sites sharing a domain but with different base URL paths (e.g. nba.com and nba.com/timberwolves) get separate metaconfig objects: opportunities/nba.com/config.json and opportunities/nba.com/timberwolves/config.json
  • Fixed deploySuggestions passing a page URL to fetchMetaconfig instead of the site baseURL
  • Fixed previewSuggestions passing previewUrl (a page URL) to fetchMetaconfig instead of getEffectiveBaseURL(site)
  • Tests updated to use root base URLs for existing cases; 4 new subpath test cases added

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 uses getEffectiveBaseURL(site) for metaconfig, no change needed there

Test plan

  • npm test -w packages/spacecat-shared-tokowaka-client passes
  • Verify getTokowakaMetaconfigS3Path('https://nba.com')opportunities/nba.com/config
  • Verify getTokowakaMetaconfigS3Path('https://nba.com/timberwolves')opportunities/nba.com/timberwolves/config
  • Integration: onboard two sites with same domain, different paths; confirm separate config.json objects in S3

🤖 Generated with Claude Code

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

1 participant