Repository navigation
fix(lint_roadmap): check Blocked-by fragments into YAML and JSON decision files - #3569
Merged
Merged
Conversation
…sion files Closes #3567. `_check_blocked_by` resolved a link's fragment only for Markdown targets, so a typo in `decisions/billing.yaml#<id>` passed the lint, and so did a link to a renamed or withdrawn decision. Add an opt-in `decisions.entryKey` naming the key that holds an entry's id. When set, a fragment into a .yaml, .yml or .json target must match one of those values, or the lint reports an ERROR worded like the Markdown finding. YAML is scanned by line because `_miniyaml` refuses block scalars and flow mappings; JSON uses stdlib `json`. An unreadable file, or one with no entries under the key, is a finding. Without the key, behavior is unchanged. Tests: - tests/test_blocked_by_entry_anchor.py: YAML, JSON and Markdown targets, the no-key case, a link with no fragment, and validation of the new key Verification: - scripts/smoke-test.sh passes: 4995 tests OK, 4 skipped Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #3567.
Root cause
_check_blocked_bychecks a link's fragment only when the target ends in.md. For a project keeping decisions in YAML or JSON, a typo in the id, or a link to a renamed or withdrawn decision, passed the lint.Fix
decisions.entryKeyin.specfuse/layout.yml, naming the key that holds an entry's id. Without it, behavior is unchanged..yaml,.ymlor.jsontarget must match one of those values, or the lint reports an ERROR worded like the Markdown finding.style: adr, and must be a valid mapping key.Decision taken: ERROR under
status: blocked, same as Markdown, not a warning. A decision still under review links to the file with no fragment, or to its PR; both still pass.Known limits:
_miniyamlrefuses block scalars and flow mappings. A line inside a block scalar, or a nested key, that looks likeentryKey: xcounts as an id. That can let a typo pass, as it does today, but never fails a good link.- {name: x}) is not seen, so linking to it reports a missing anchor.Scope note: a new layout key is a small addition to the project's config surface. It stays within bug size (2 production files, 1 test file) and is opt-in, so no consumer has to act.
Tests
tests/test_blocked_by_entry_anchor.py, 15 tests. 8 failed on unchanged code; the rest cover behavior that must not change.Verification
scripts/smoke-test.shpasses: 4995 tests OK, 4 skipped.🤖 Generated with Claude Code