Artifacts Lint: attribute Spectral findings per template and document the expected baseline - #685
Merged
rartych merged 2 commits intoAug 3, 2026
Conversation
Spectral loses the source file of most findings when several input documents share $ref targets (stoplightio/spectral#2640), so one invocation over all four templates reported 9 problems while emitting 152 unattributed warnings. Linting per template and merging the results recovers all 15 real findings; the documented baseline is collapsed into one notice per file so it no longer fills the annotation budget a pull request needs.
hdamker
requested review from
PedroDiez,
bigludo7,
eric-murray,
jlurien and
rartych
as code owners
July 29, 2026 19:25
2 tasks
eric-murray
approved these changes
Aug 3, 2026
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.
What type of PR is this?
What this PR does / why we need it:
The Spectral step of the Artifacts Lint workflow (#673) linted all four templates in one invocation. Spectral loses the source file of most findings when several input documents share
$reftargets (stoplightio/spectral#2640), so the step reported 9 problems in its summary, emitted 152::warninglines, and produced 10 annotations of which 3 pointed at.line 1 — while the two real findings inapi-templates/sample-service.yamlhad no annotation at all. Details and the reproduction in #684.Spectral now runs once per template and the results are merged, which is what CAMARA Validation already does for the same reason. Six findings that the old view hid become visible, and the log, the annotations and the summary now describe one set of 15 findings instead of three different numbers:
.github/scripts/spectral_annotations.pymerges the per-template JSON, deduplicates on(file, line, rule), emits the annotations, and prints a reconciliation table to the log and to the run summary.noticeannotation per source file, pointing atartifacts/linting_rules/README.md. The remaining 5 keep an individual annotation at their native severity.validation/rules/spectral-rules.yamlincamaraproject/tooling(rule S-313suppress_schema_paths) — added to the existing sparse-checkout rather than copied, so it cannot drift from what API repositories apply. Matching replicates the tooling semantics, including the dot-boundary prefix rule, so a newly added unconstrained string in a common schema still surfaces on its own.Annotation budget, per step: 5 of 10 warning slots used, plus 2 notices — against 10 of 10 consumed by the baseline before this change, where a warning introduced by a pull request could go unannotated.
artifacts/linting_rules/README.mdgains the expected-findings section from #676: all 15 findings with their rationale, keyed on schema path rather than line number so it does not go stale, and marked collapsed or individual so it can be checked against what the workflow actually annotates.Which issue(s) this PR fixes:
Fixes #684
Fixes #676
Does this PR introduce a breaking change?
Special notes for reviewers:
mainwith the pinned toolchain (Spectral 6.16.2,.spectral-r4.yaml): 152 raw results with 9 sourced for one invocation over four templates, versus 26 raw results with none unsourced and 15 unique for one invocation per template.Linkheader finding stops being annotated individually the moment S-313: suppress the unactionable finding on the common pagination Link header tooling#401 lands, with no edit needed in this repository.oas3-unused-componentfindings are gone since tooling made unused-component detection discriminator-aware, and the gplint findings are being fixed (Feature file templates: fix the remaining gplint findings (placeholder syntax, scenario names) #682, via Fix remaining gplint findings in the feature templates #683) rather than documented as expected. The section therefore covers Spectral only.noticeaggregates, and no annotation points at.line 1.Changelog input
Additional documentation