feat(report): render the fix job summary from a saved envelope via report --from#1854
Merged
Merged
Conversation
…ummary Add EnvelopeKind::Fix so `fallow report --from <fix-results.json> --format github-summary` renders the auto-fix job summary natively, mirroring the bundled action/jq/summary-fix.jq renderer. The fix envelope carries no top-level `kind` (crates/output/src/fix.rs stays kind-less: no wire change, no schema variant, no docs/output-schema.json regen), so report --from detects it by field presence (a `fixes` array plus a numeric `total_fixed`) and routes it through the existing render_fix_summary port. github-annotations for the fix kind renders nothing, matching the bundled action which no-ops annotations for the fix command (annotate.sh returns early on FALLOW_COMMAND=fix; there is no annotations-fix.jq). Tests: field-detection unit tests (positive + rejects other kind-less docs), render_summary(Fix) mirrors render_fix_summary and carries summary-fix.jq's sections, render_annotations(Fix) is empty, plus Fix added to the report-from round-trip parity and em-dash guard loops.
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.
Adds
EnvelopeKind::Fixsofallow report --from <fix-results.json> --format github-summaryrenders the auto-fix job summary natively, closing the fix-kind gap that keptsummary-fix.jqas the last jq renderer the action could not retire (advisor plan 027 follow-up).No wire change. The
fallow fix --format jsonenvelope carries no top-levelkind, and it stays that way:crates/output/src/fix.rs, the schema, and the TS contracts are untouched.report --fromdetects the fix envelope by field presence (both afixesarray and a numerictotal_fixed, the stable FixJsonOutput root keys); the fix envelope is the only kind-less document fallow emits, so the signal is unambiguous, and genuinely unrecognized documents keep the existing "missing top-level kind" error.The render path reuses the existing
render_fix_summary(already a 1:1 port ofsummary-fix.jq), soreport --fromoutput is byte-identical to the directfallow fix --format github-summaryrun, with zero shape-drift risk. github-annotations for the fix kind emits nothing, matching the bundled action (which no-ops annotations for fix).Verified: 31 github-format tests green (incl. new
render_summary_fix_mirrors_render_fix_summary,render_annotations_fix_is_empty, and the field-detection unit tests with a positive and a kind-stripped-negative case); neuter-checked; clippy-D warningsand fmt clean; real-world smoke confirms byte-identical parity on both the empty ("No fixable issues found") and non-empty (table + details) cases.Recorded follow-up:
render_fix_summaryhas a pre-existing "would apply 1 fixes" pluralization nit (unchanged here; renders identically both ways).