Skip to content

feat(SITES-43695): use org.defaultSiteId in resolveSite to bypass insertion-order fallback#2434

Open
prithipalpatwal wants to merge 4 commits into
mainfrom
feat/SITES-43695-resolve-defaultSiteId
Open

feat(SITES-43695): use org.defaultSiteId in resolveSite to bypass insertion-order fallback#2434
prithipalpatwal wants to merge 4 commits into
mainfrom
feat/SITES-43695-resolve-defaultSiteId

Conversation

@prithipalpatwal
Copy link
Copy Markdown
Contributor

Please ensure your pull request adheres to the following guidelines:

  • 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

Related Issues

Thanks for contributing!

@prithipalpatwal prithipalpatwal force-pushed the feat/SITES-43695-resolve-defaultSiteId branch from 5f549f6 to a9887fd Compare May 18, 2026 22:16
@github-actions
Copy link
Copy Markdown

This PR will trigger a minor release when merged.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

prithipalpatwal and others added 2 commits May 19, 2026 04:00
Per-product default site is stored as config.defaults.{productCode}.siteId
on the organization config so customers can pin a preferred domain without
insertion-order dependence on getFirstEnrollment.

Changes:
- sites.js: resolveOrgDefaultSite reads org.getConfig()?.defaults?.[productCode]?.siteId
  before falling back to getFirstEnrollment; try/catch ensures TierClient errors
  fall through gracefully; warns on stale or cross-org config.defaults entries
- organizations.js: PATCH validates config.defaults entries (product code, siteId UUID,
  site ownership); comment documents setConfig/updates ordering dependency
- dto/organization.js: remove defaultSiteId from toJSON
- docs/openapi/schemas.yaml: document defaults.{productCode}.siteId structure on
  OrganizationConfig; remove obsolete defaultSiteId field
- tests: full edge-case coverage for both the org PATCH validation and the
  resolveSite config.defaults resolution paths

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t public API

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@prithipalpatwal prithipalpatwal force-pushed the feat/SITES-43695-resolve-defaultSiteId branch from 075816f to c70c9f7 Compare May 18, 2026 22:30
prithipalpatwal and others added 2 commits May 19, 2026 04:02
… code only

Remove siteId-specific validation from the PATCH org config.defaults block
so the structure is not locked to a single field. Only product code membership
is validated; entry shape is left to the caller.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
If a config.defaults entry contains a siteId field, validate it is a valid
UUID and belongs to the organization. Entries without siteId are accepted
as-is, keeping the structure open to other fields per product.

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