Repository navigation
Enable automatic CLI PR reviews and /review reruns - #4738
Conversation
|
Commit: 3cf6d9b
18 interesting tests: 7 SKIP, 6 RECOVERED, 5 flaky
Top 20 slowest tests (at least 2 minutes):
|
b418b20 to
0d2b698
Compare
0d2b698 to
6dbf8a3
Compare
6dbf8a3 to
275b67a
Compare
275b67a to
fc25d50
Compare
fc25d50 to
47a7034
Compare
Reflects current implementation: composite action, standalone workflows, OIDC policies, SHA-pinned actions, concurrency groups, allowed tools, and comprehensive threat model. Co-authored-by: Isaac
Co-authored-by: Isaac
Drop the interactive @claude assist job and the issue_comment / pull_request_review_comment triggers; keep only the automatic review on PR open. Also stop passing event_type to cli-claude-code.yml, which is now review-only. Co-authored-by: Isaac
| (github.event_name == 'issue_comment' && | ||
| github.event.issue.pull_request && | ||
| github.event.comment.user.type == 'User' && | ||
| github.event.comment.body == '/review') |
There was a problem hiding this comment.
this enables everyone to trigger /review no? can't we guard here (user.role == 'Maintainer' or similar, if available) instead of only below?
There was a problem hiding this comment.
Added a author association guard in the if check.
There was a problem hiding this comment.
I tried it out and this does not work because the normal workflow token does not have enough permissions to check the author association so we need to perform a checkup later. We can't do better here.
| if ( | ||
| event["action"] != "created" | ||
| or "pull_request" not in event["issue"] | ||
| or comment["body"] != "/review" |
There was a problem hiding this comment.
| or comment["body"] != "/review" | |
| or comment["body"].strip() != "/review" |
just a small qol
|
|
||
| REPOSITORY = "databricks/cli" | ||
| PR_ACTIONS = {"opened", "reopened", "synchronize", "ready_for_review"} | ||
| COMMENT_ASSOCIATIONS = {"MEMBER", "OWNER", "COLLABORATOR"} |
There was a problem hiding this comment.
isn't MEMBER = databricks org member, and COLLABORATOR = someone who has merged PR before but isn't in the org?
|
/review |
| id: request | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: GITHUB_EVENT_NAME=pull_request_target python3 .github/scripts/cli_pr_review.py |
There was a problem hiding this comment.
The GITHUB_EVENT_NAME=pull_request_target prefix is part of the temporary test scaffolding (the real trigger is pull_request, not pull_request_target) but isn't marked TEMPORARY like the trigger on line 9. Once the pull_request: trigger is removed and real issue_comment events reach this step, the override makes the script see every /review comment as a pull_request_target event whose "action": "created" isn't in PR_ACTIONS, so comment-triggered reviews are silently rejected. Can you add a TEMPORARY marker here, or fold the removal into the trigger-cleanup note on line 9?
|
|
||
| review: | ||
| needs: validate | ||
| if: needs.validate.outputs.eligible == 'true' && github.ref == 'refs/heads/main' |
There was a problem hiding this comment.
On pull_request_target the ref is the PR's base branch, so release-branch PRs skip this job. Is the main check still needed, since validate already gates the request?
There was a problem hiding this comment.
It just confirms that the workflow definition is being used from mean. It should not prohibit PRs that are not against mean.
Changes
Add automatic workflow to run reviews on trusted CLI PRs.