Repository navigation
test(schema): keep the catalog's distribution identifier types in step with the schema enum - #9010
Merged
Merged
Conversation
Contributor
|
Ladon cannot review this PR until merge conflicts are resolved. |
…p with the schema enum and to the AAO catalog's own copy, DISTRIBUTION_IDENTIFIER_TYPE_VALUES. Nothing checked that the two lists match, and they had drifted before. The server unit test now reads the schema enum and asserts the catalog list has the same members, naming any value missing from either side, and that isValidDistributionIdentifierType accepts every enum value and rejects an unknown one. New tests/social-distribution-identifiers.test.cjs, in test:schemas, validates each of the eight types as a distribution identifier on core/collection-distribution.json, rejects an unknown type, checks every value has an enumDescriptions entry and the ID-over-handle wording, and pins the order of the values that existed before 3.3. Tests only; no changeset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bokelley
force-pushed
the
test/distribution-identifier-parity
branch
from
November 14, 2026 14:40
c14bc3e to
356df9f
Compare
Contributor
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — tests-only follow-up to #8995.
This PR changes 3 files (package.json, a server parity test, and a new tests/social-distribution-identifiers.test.cjs registered in test:schemas). It pins DISTRIBUTION_IDENTIFIER_TYPE_VALUES and the schema enum together, with order/accept/reject assertions verified to match distribution-identifier-type.json and collection-distribution.json exactly. No schema/source/docs change, so no changeset is required.
No Critical/High/Medium findings reported. Not gated_paths, not high_risk, no author-team gate, no prior decision. None of decision rows 1–8 fire → row 9 approve.
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.
Follow-up to #8995 (#8992). Tests only, for the 3.3 rc.0.
Summary
#8995 added eight social types to
enums/distribution-identifier-type.jsonand to the AAO catalog's own copy of the list,DISTRIBUTION_IDENTIFIER_TYPE_VALUESinserver/src/services/collection-identifier-normalization.ts. Nothing checked that the two lists match, and they had drifted before. Its server test lists the eight values by hand, so a later schema addition could still be missed.This PR adds two tests:
server/tests/unit/services/collection-identifier-normalization.test.ts, newdescribeblock). It reads the schema enum fromstatic/schemas/sourceand asserts thatDISTRIBUTION_IDENTIFIER_TYPE_VALUEShas the same members, naming any value missing from either side. It also checks thatisValidDistributionIdentifierTypeaccepts every enum value and rejects an unknown one. A future enum addition now fails the server unit tests until the catalog list is updated too.tests/social-distribution-identifiers.test.cjs, added totest:schemas). These cover:distribution[].identifiersentry oncore/collection-distribution.json, and an unknown type is rejected.enumDescriptionsentry. The ID descriptions say the ID is the preferred canonical identifier, and the handle descriptions say the ID is preferred for matching.No schema, server source or docs change, so there's no changeset, per the playbook's rule for non-protocol changes.
Testing
Rebased onto
maind6c0f99f5ato clear apackage.jsonconflict on thetest:schemasline. The only change is this PR's one entry, and both files pass again on the rebased tree. The runs below were onmaind62521aee5(after #8995) plus this commit:npx vitest run --config server/vitest.config.ts tests/unit/services/collection-identifier-normalization.test.ts: 48/48. The 14 from feat(schema): add Instagram, Facebook, Snapchat and X distribution identifier types #8995 plus 34 new: the set-equality check, one acceptance case per enum value, and the unknown-value rejection.node --test tests/social-distribution-identifiers.test.cjs: 13/13.node scripts/check-changeset-protocol-scope.cjs origin/main: pass, with no changeset.ADCP_SKIP_STORYBOARD_MATRIX=1, as the playbook allows. On the first attempt it was still in the/salesstage after an hour, at host load ~100. This PR touches no compliance or storyboard file. CI's storyboard job is the gate.🤖 Generated with Claude Code