Repository navigation
fix: Hypatia annotations read "null" on an unanchorable absolute path - #59
Merged
Merged
Conversation
…y vacuous The gate in this repo already fires correctly. Its ANNOTATIONS do not. 1. Every annotation read "[hypatia] null". Findings carry no `.message` key -- the real keys are action, file, line, reason, rule_module, severity, type -- so `\(.message)` interpolated JSON null on every single finding. 2. `.file` is an absolute runner path (/home/runner/work/<repo>/<repo>/...). GitHub cannot anchor an absolute path to the diff, so the annotation never appeared on the changed lines. It is made workspace-relative here. Fallback chain is `.reason // .message // .type // "finding"`, so this stays correct if the finding schema later grows a `.message`. Proven by positive control against a real hypatia-findings.json artifact: OLD: ::error file=0-AI-MANIFEST.a2ml,line=1::[hypatia] null NEW: ::error file=0-AI-MANIFEST.a2ml,line=1::[hypatia] Required file missing No threshold, no scanner logic and no gate condition is changed.
Contributor
|
Warning Review limit reachedNext included review available in 46 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
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 gate here works. Its annotations do not.
This repo's
Static Analysis Gatewas repaired in the earlier wave and now genuinely fires. What itreports, however, is unreadable: every annotation says
[hypatia] null, on a path GitHub cannotanchor to the diff.
1.
\(.message)— a key the findings do not haveA Hypatia finding carries
action, file, line, reason, rule_module, severity, type. There is no.message. jq interpolates a missing key as JSONnull, so every annotation, for every finding,in every run, read
null.Fixed with a fallback chain —
.reason // .message // .type // "finding"— so it stays correct ifthe finding schema later grows a
.message.2.
.fileis an absolute runner path.filearrives as/home/runner/work/<repo>/<repo>/path/to/thing. GitHub can only place anannotation on a diff line if the path is workspace-relative, so these annotations were emitted
into nowhere.
--arg ws "$GITHUB_WORKSPACE"plusltrimstr($ws + "/")makes them relative.Positive control, on a real artifact
Both jq programs, run against a genuine
hypatia-findings.jsondownloaded from a completed run:Scope
Annotations only. No threshold, no scanner invocation, no gate condition and no exit code is
touched — the pass/fail behaviour of this workflow is byte-for-byte unchanged. The check should stay
exactly the colour it is today; only what it says changes.
Post-conditions asserted by the transform before this branch was written: no
\(.message)survivesanywhere;
--arg wsandltrimstr($wsare both present; no un-fixed jq header remains; and — as aguard against applying this to the wrong repo — the earlier wave's
--exit-zerois still present andthe old
2>&1fold is still absent.