Skip to content

Enable automatic CLI PR reviews and /review reruns - #4738

Merged
shreyas-goenka merged 23 commits into
mainfrom
add-claude-code-workflow
Nov 17, 2026
Merged

shreyas-goenka merged 23 commits into
mainfrom
add-claude-code-workflow

Conversation

@shreyas-goenka

@shreyas-goenka shreyas-goenka commented Mar 13, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Add automatic workflow to run reviews on trusted CLI PRs.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Mar 13, 2026 •

Copy link
Copy Markdown
Collaborator

Commit: 3cf6d9b

Run: 23075285472

Env 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 8 7 268 787 6:21
💚​ aws windows 8 7 270 785 4:47
🔄​ aws-ucws linux 2 7 7 364 702 7:40
🔄​ aws-ucws windows 2 7 7 366 700 6:31
💚​ azure linux 2 9 271 785 7:07
💚​ azure windows 2 9 273 783 7:35
🔄​ azure-ucws linux 4 1 9 367 698 8:21
🔄​ azure-ucws windows 2 1 9 371 696 6:41
💚​ gcp linux 2 9 267 788 6:15
💚​ gcp windows 2 9 269 786 4:52
18 interesting tests: 7 SKIP, 6 RECOVERED, 5 flaky
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🔄​ TestAccept 💚​R 💚​R 🔄​f 💚​R 💚​R 💚​R 💚​R 🔄​f 💚​R 💚​R
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/ssh/connect-serverless-gpu 🙈​s 🙈​s 🔄​f 🔄​f 🙈​s 🙈​s 🔄​f 🔄​f 🙈​s 🙈​s
🔄​ TestAccept/ssh/connection 💚​R 💚​R 💚​R 🔄​f 💚​R 💚​R 🔄​f 💚​R 💚​R 💚​R
🔄​ TestFsLsWithAbsolutePaths ✅​p ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p
🔄​ TestFsLsWithAbsolutePaths/uc-volumes 🙈​s 🙈​s ✅​p ✅​p 🙈​s 🙈​s 🔄​f ✅​p 🙈​s 🙈​s
Top 20 slowest tests (at least 2 minutes):
duration env testname
5:35 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:45 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:16 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:08 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:47 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:43 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:13 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:11 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:07 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:58 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:57 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:50 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:44 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:43 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:40 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:39 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:18 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:11 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:09 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:03 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

@shreyas-goenka
shreyas-goenka force-pushed the add-claude-code-workflow branch from b418b20 to 0d2b698 Compare March 13, 2026 19:56
@shreyas-goenka
shreyas-goenka force-pushed the add-claude-code-workflow branch from 0d2b698 to 6dbf8a3 Compare March 13, 2026 20:03
@shreyas-goenka
shreyas-goenka force-pushed the add-claude-code-workflow branch from 6dbf8a3 to 275b67a Compare March 13, 2026 20:17
@shreyas-goenka
shreyas-goenka force-pushed the add-claude-code-workflow branch from 275b67a to fc25d50 Compare March 13, 2026 20:25
@shreyas-goenka
shreyas-goenka force-pushed the add-claude-code-workflow branch from fc25d50 to 47a7034 Compare March 13, 2026 20:33
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
Comment thread .github/workflows/cli-pr-review.yml Resolved
Comment thread .github/workflows/cli-pr-review.yml Outdated
Comment on lines +19 to +22
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.user.type == 'User' &&
github.event.comment.body == '/review')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this enables everyone to trigger /review no? can't we guard here (user.role == 'Maintainer' or similar, if available) instead of only below?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a author association guard in the if check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/cli-pr-review.yml Resolved
Comment thread .github/workflows/cli-pr-review.yml Resolved
Comment thread .github/cli-pr-review.md Resolved
Comment thread .github/workflows/cli-pr-review.yml Resolved
Comment thread .github/scripts/cli_pr_review.py Outdated
if (
event["action"] != "created"
or "pull_request" not in event["issue"]
or comment["body"] != "/review"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
or comment["body"] != "/review"
or comment["body"].strip() != "/review"

just a small qol

Comment thread .github/scripts/cli_pr_review.py Outdated

REPOSITORY = "databricks/cli"
PR_ACTIONS = {"opened", "reopened", "synchronize", "ready_for_review"}
COMMENT_ASSOCIATIONS = {"MEMBER", "OWNER", "COLLABORATOR"}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't MEMBER = databricks org member, and COLLABORATOR = someone who has merged PR before but isn't in the org?

@shreyas-goenka

Copy link
Copy Markdown
Contributor Author

/review

Comment thread .github/workflows/cli-pr-review.yml Outdated
id: request
env:
GH_TOKEN: ${{ github.token }}
run: GITHUB_EVENT_NAME=pull_request_target python3 .github/scripts/cli_pr_review.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread .github/workflows/cli-pr-review.yml Resolved
Comment thread .github/workflows/cli-pr-review.yml Resolved

review:
needs: validate
if: needs.validate.outputs.eligible == 'true' && github.ref == 'refs/heads/main'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just confirms that the workflow definition is being used from mean. It should not prohibit PRs that are not against mean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants