Derive the confidentiality profile ID from the tag alone - #132
Open
MichaelLeeHobbs wants to merge 1 commit into
Open
Derive the confidentiality profile ID from the tag alone#132MichaelLeeHobbs wants to merge 1 commit into
MichaelLeeHobbs wants to merge 1 commit into
Conversation
Table E.1-1 gives the tag for its "Private Attributes" row as
"(gggg,eeee) where gggg is odd". The trailing prose was carried into both
the tag and the slug derived from it, so that row is published as
"tag": "(GGGG,EEEE) WHERE GGGG IS ODD",
"id": "ggggeeee-where-gggg-is-odd"
which is the only entry in confidentiality_profile_attributes.json whose ID
is not an eight-character tag slug, and the only one whose tag is a
sentence. Uppercasing intended to normalise hex digits shouts the prose.
Isolate the tag before deriving the ID, so this row is published as
"(GGGG,EEEE)" with the ID "ggggeeee" - the same shape as the existing
repeating-group rows such as "(50XX,XXXX)" / "50xxxxxx". The qualifier is
not lost in any meaningful sense: an odd group number is what makes an
attribute private, which the row's name already states.
Rows whose tag cell contains no tag at all are passed through unchanged.
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.
The problem
Table E.1-1 gives the tag for its "Private Attributes" row as
(gggg,eeee) where gggg is odd. The trailing prose is carried into both the tag and the slug derived from it, so the row is published as:{ "name": "Private Attributes", "tag": "(GGGG,EEEE) WHERE GGGG IS ODD", "stdCompIOD": "N", "basicProfile": "X", "rtnSafePrivOpt": "C", "id": "ggggeeee-where-gggg-is-odd" }Out of 621 rows in
confidentiality_profile_attributes.jsonthis is the only one whoseidis not an eight-character tag slug, and the only one whosetagis a sentence. The.upper()that normalises hex digits also shouts the prose.Repeating-group rows in the same table are already handled correctly —
(50xx,xxxx)→50xxxxxx,(60xx,3000)→60xx3000— so this row is the sole exception to a shape consumers can otherwise rely on.The change
Isolate the tag before deriving the ID. The row is then published as:
{ "tag": "(GGGG,EEEE)", "id": "ggggeeee" }which matches the existing repeating-group rows. Cells containing no tag at all are passed through unchanged, so this cannot silently blank a future row.
The qualifier is not lost in any meaningful sense: an odd group number is precisely what makes an attribute private (PS3.5 Section 7.8.1), which the row's own
namealready states.Note on compatibility
This changes one
idand onetagvalue. I judged that acceptable under the repository's stated guarantee that "bugs or incorrect data will be fixed", and because a consumer keying onggggeeee-where-gggg-is-oddis relying on the defect. Happy to drop this if you would rather keep the value frozen — the alternative would be to fix only the uppercasing and leave the ID as it is.Verification
pytest tests/extract_conf_profile_attributes_test.py— 5 new tests covering a normal tag, a repeating-group tag, the Private Attributes row, a cell with no tag, and the resulting IDs.pytest tests/ --ignore=tests/end_to_end_test.py— 44 passed, 2 skipped.flake8andmypyclean on both changed files.Six errors in
standard_workarounds_test.pyalso occur on an unmodified checkout:parse_html_fileopens the standard HTML without specifying an encoding, so it fails under a cp1252 default locale. Unrelated to this change, but it does mean the unit suite cannot be run on Windows as-is — happy to send a one-lineencoding='utf-8'fix separately if that is useful.Found while triaging the issue backlog (#131). Independent of #130.