CEXT-6073: add required id field to ConfigOrigin#389
CEXT-6073: add required id field to ConfigOrigin#389obarcelonap wants to merge 3 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: efdfe58 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
834f6a3 to
9e5eca0
Compare
| name: field.name, | ||
| value: field.default as string, | ||
| origin: { code: "default", level: "system" }, | ||
| origin: { id: "default", code: "default", level: "system" }, |
There was a problem hiding this comment.
I think that we need to change this to global for both code and level. What do you think?
Also this id being default it bugs me. IDs should always be a UUID, maybe we should search the scope with that code and level and grab the id from it. I am not sure if there's any with code: default and level: system, by default, but we should have the code: global and level: global, which is the reason I suggested changing it.
| name, | ||
| value: def, | ||
| origin: { code: "default", level: "system" }, | ||
| origin: { id: "default", code: "default", level: "system" }, |
|
After analysis, we're not adding id to ConfigOrigin.
The id: "default" sentinel for schema defaults (@iivvaannxx concern in https://github.com/adobe/aio-commerce-sdk/pull/389/changes#r3109982635) will be addressed separately by changing the origin to |
Description
ConfigOriginnow carries a requiredidfield alongside the existingcodeandlevelfields. This allows consumers to unambiguously identify which scope a configuration value is inherited from, using the scope's unique identifier rather than relying on code+level alone. Schema-default origins use the sentinel value"default"for this field.Propagated through
mergeScopes,mergeWithSchemaDefaults, and all internal merge helpers. The changeset is markedminor—ConfigOriginonly appears in read-only response types; no write API accepts it as input.Related Issue
https://jira.corp.adobe.com/browse/CEXT-6073
Motivation and Context
The UI needs to confidently determine whether a config value is inherited or locally set.
code+levelalone are not sufficient since multiple scopes can share the same level. The scopeidis the canonical unique identifier.How Has This Been Tested?
npx vitest run)npx tsc --noEmit)test/unit/config-utils.test.tscoversmergeScopesid propagation: new entries, overridden entries, preserved inherited origins, and fallback for origin-less entriesTypes of changes
Checklist: