fix(workflows): parse job-level uses: (reusable workflow calls) - #45
Open
sroberts wants to merge 1 commit into
Open
fix(workflows): parse job-level uses: (reusable workflow calls)#45sroberts wants to merge 1 commit into
uses: (reusable workflow calls)#45sroberts wants to merge 1 commit into
Conversation
A job that delegates to a reusable workflow has no `steps:` at all — `jobs.lint.uses: acme/.github/.github/workflows/lint.yml@main` is the whole job. rawJob had no Uses field, so the AST saw an empty job and every workflow signal concluded the work wasn't happening. Splitting lint or build into a shared org workflow is a normal layout, and it read to plumbline as an absent gate. Adds Job.Uses and Job.With, an IsReusableCall helper, and AnyUsesMatches covering both step and job scope. UsesAction now checks job scope too, which fixes it for every signal that calls it, not just the L3 gates. Wires it into l3.build-lint-gate: a reusable workflow whose path names a recognized linter matches at medium confidence, and one whose path merely looks lint-shaped falls to the low-confidence name path, same as a step named "Lint" running an unrecognized script. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XtNwLDzRYmPrXcYeQypTf9
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.
Last of the AST gaps found while diagnosing #42. Raised in that PR's investigation, left out of scope because it wasn't the cause there.
The gap
A job that calls a reusable workflow has no
steps::rawJobhad noUsesfield, so this parsed as a job with zero steps. Every workflow signal walks steps, so the job read as empty and the lint gate scored as absent. Splitting lint or build into a shared org workflow is a normal layout — and it looked to plumbline like a repo that doesn't lint.Changes
Job.UsesandJob.Withparsed;IsReusableCall()helper.AnyUsesMatches(re)checksuses:at both step and job scope.UsesAction(prefix)now checks job scope too — that fixes it for every signal calling it, not only the L3 gates.l3.build-lint-gateuses both: a reusable workflow whose path names a recognized linter matches at medium confidence; one that merely looks lint-shaped falls to the low-confidence name path, same treatment as a step namedLintrunning an unrecognized script.Tests
Parser test asserting
Uses,With,IsReusableCall, and both lookup helpers against a job-level call. Detector test asserting a reusable lint workflow plus ago buildjob scores 1.0 at medium confidence.Full suite,
go vet,gofmtclean. No change to plumbline's own snapshot — it has no reusable-workflow calls.🤖 Generated with Claude Code
https://claude.ai/code/session_01XtNwLDzRYmPrXcYeQypTf9