Repository navigation
Conversation
`ExternalReferenceType` declared the CycloneDX 1.6+ `rfc-9116` external
reference type with transposed digits, so `ExternalReferenceType.RFC_9116`
did not exist and `ExternalReferenceType('rfc-9116').name` reported the
typo `'RFC_9166'`.
The member is now spelled `RFC_9116`, matching the schema value and the
`UPPER_SNAKE_CASE` naming of the other members. `RFC_9166` is kept as an
alias, so existing attribute access keeps working - only the reported
`.name` changes, which is the compatibility remark from the issue.
The schema-1.6 registration and the enum snapshots were updated as well;
their URLs are derived from `.name`.
Adds regression tests for the member name, the alias, and the naming of all
`rfc-*` members - `_test_knows_value()` only proved that a value is
known, never that its member name is spelled correctly.
Resolves CycloneDX#1074
Signed-off-by: 皇者华 <328654030+BLDT-36@users.noreply.github.com>
Documentation build overview
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Closing this: #1082 already does the same fix, was opened five days earlier, and has been through review and a revision round with @jkowalleck. Leaving a second PR for the same one-line change only splits attention over two branches. What I missed when I started: I read #1074's comments and the guideline page, and looked at the wrong thing for duplicate work -- the issue had no linked PR and no assignee, so I took it as free. Checking the issue timeline for cross-references would have shown #1082 straight away. My mistake, not a disagreement with the existing PR. For the record, in case anything here is useful to #1082 -- no action requested:
|
Description
ExternalReferenceTypedeclared the CycloneDX 1.6+rfc-9116external reference type with transposed digits asRFC_9166, soExternalReferenceType.RFC_9116did not exist:The member is now spelled
RFC_9116, matching the CycloneDX schema valuerfc-9116and theUPPER_SNAKE_CASEnaming of every other member. It is registered for the 1.6 and 1.7 views under the corrected name, and the 13enum_ExternalReferenceType-*snapshots were updated -- their URLs are derived from.name, so they necessarily follow the rename.RFC_9166is kept as an alias ofRFC_9116, the same wayVCSis an alias ofSCMin this enum, soExternalReferenceType.RFC_9166keeps resolving. Only the reported.namechanges, which is the compatibility remark from your comment.Three regression tests were added to
TestEnumExternalReferenceType:RFC_9166is still the same member asRFC_9116rfc-*member followsUPPER_SNAKE_CASE, so a transposition like this one cannot slip through againThe last one exists because
_EnumTestCase._test_knows_value()only asserts thatenum(value)resolves -- as its own# TODO test for an expected namenotes -- which is exactly why this typo went unnoticed.Verification
python -m pytest tests/test_enums.py -k ExternalReferenceTypeFull suite:
7244 passed, plus 3 environment-only failures intests/test_validation_xml.pyon a non-UTF-8 Windows locale (open()withoutencoding=reading XML fixtures); they pass withPYTHONUTF8=1on the same tree and are unrelated to this change.AI Tool Disclosure
DeepSeek Harness (agentic coding harness)deepseek-v4.1-flashPointed at issue #1074; asked to locate every occurrence of the misspelled member, rename it while keeping backward compatibility, update the affected snapshots, and add regression tests that would have caught the typo. The diff was reviewed before submitting.Affirmation