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.
feat(dev-lead): add reusable workflow (Phase 1.5) + shadow period (Phase 7) #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
feat(dev-lead): add reusable workflow (Phase 1.5) + shadow period (Phase 7) #179
Changes from all commits
d4ac9550cc95e0cc1f7a8c39fd0bFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For any caller that triggers this reusable workflow on
check_runevents,github.event_nameischeck_run, so this condition skips the only job in the file. Unlike the non-reusable workflow, this new reusable does not define aci-relayjob to emit thedev-lead-ci-failurerepository_dispatch event, so failing checks never reach thefix-cihandler. Include the relay in the reusable, or do not skipcheck_rununless a real caller-side relay has already converted it.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking the scripts repo out under the caller worktree leaves
.dev-leadas an unignored nested git repository. On reusable runs that actually apply fixes, the existing handlers later stage withgit add -A(for example the fix-ci and issue paths), so the generated commit can include.dev-leadas an embedded gitlink/submodule instead of only the intended code changes. Put this checkout outside the caller repository or exclude.dev-leadbefore any handler can stage changes.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this reusable workflow is called from any other private repository without
GH_PAT_WORKFLOWS, this checkout falls back to the caller repo'sgithub.token;actions/checkoutscopes that token to the current/caller repository, so it cannot readpetry-projects/.github-privateand the workflow fails before intent classification. Since the workflow is explicitly meant for other repos and the secret is marked optional, callers can configure the reusable exactly as advertised but still fail at this step; make the secret required or otherwise provide a token with access to.github-privatefor this checkout.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When any non-skip handler later stages with
git add -A, this line has already modified or created the caller repository's tracked working tree. If the engine makes no edits, handlers such asfix-cican still see a dirty tree and commit only this.gitignorechange; otherwise every automated fix carries an unrelated ignore entry. Put the helper checkout in.git/info/excludeor outside the caller worktree instead of editing the repository file.Useful? React with 👍 / 👎.
Check warning on line 123 in .github/workflows/dev-lead-reusable.yml
Using dependencies without locking resolved versions is security-sensitive.
Check warning on line 123 in .github/workflows/dev-lead-reusable.yml
Omitting "--ignore-scripts" can lead to the execution of shell scripts. Make sure it is safe here.
Check warning on line 128 in .github/workflows/dev-lead-reusable.yml
Using dependencies without locking resolved versions is security-sensitive.
Check warning on line 128 in .github/workflows/dev-lead-reusable.yml
Omitting "--ignore-scripts" can lead to the execution of shell scripts. Make sure it is safe here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For review/comment intents that route to this script, the reusable workflow has only performed the generic caller checkout, and
dev-lead-fix-reviews.shdoes not check out the PR head or push after the writer commits. Onpull_request_review,pull_request_review_comment, orissue_commentruns, successful fixes are therefore left as local runner commits and never update the PR, unlike thefix-cipath which explicitlygh pr checkouts and pushes. Check out the PR branch and push after a successful handler run.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a trusted bot leaves a PR issue comment, this step invokes the
fix-bot-commentpath but only provides the PR number/SHA. The script rendersprompts/dev-lead/fix-bot-comment.mdfromACTORandCOMMENT_BODY, both of which default to empty here, so the writer is asked to address a blank bot comment and cannot know which finding to fix. Include the triggering comment author/body in the intent context or fetch the comment before running this handler.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For
@dev-leadPR comments or review comments, the intent context only carries the PR number/head SHA, and this env block forwards only those fields.scripts/dev-lead-fix-reviews.shthen defaultsACTOR,USER_INSTRUCTION, andPR_DESCRIPTIONto empty before renderingprompts/dev-lead/human.md, so the reusable run starts the writer with a blank Instruction block and cannot implement the request that triggered it. Include the comment body/actor in the context or fetch them before invoking the handler.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reusable runs invoked by a caller's
check_runevent without a PAT inGH_PAT_WORKFLOWS, this job falls back togithub.tokenand then posts torepos/$RELAY_REPO/dispatches; GitHub's Create repository dispatch endpoint requires the token's Contents permission to be write, but this job restricts it to read, so the relay fails with a 403 before thefix-cipath can run. The non-reusable workflow inheritscontents: write, so mirror that here or require a PAT for the relay.Useful? React with 👍 / 👎.
Uh oh!
There was an error while loading. Please reload this page.