Skip to content
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

Add label if pre-commit passes #12527

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hmellor
Copy link
Collaborator

@hmellor hmellor commented Jan 28, 2025

Allows Buildkite to not run CI until pre-commit is passing, saving CI cost.

Originally discussed in https://vllm-dev.slack.com/archives/C07R5PAL2L9/p1736691851928849

Copy link

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

@hmellor hmellor requested a review from khluu January 28, 2025 20:56
@mergify mergify bot added the ci/build label Jan 28, 2025
Signed-off-by: Harry Mellor <[email protected]>
Copy link
Member

@ywang96 ywang96 left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

Does this mean if a PR with ready label does not have pre-commit passed, we will still not run the full CI?

@hmellor
Copy link
Collaborator Author

hmellor commented Jan 28, 2025

The idea I have for this is that:

  • Fastcheck runs when pre-commit passed is present
  • Full CI runs when pre-commit passed and ready are present

It still needs:

  • @khluu to pipe it up to Buildkite
  • the pre-commit passed label to be created in the repo
  • the pre-commit passed label to be removed when a new pre-commit run starts
  • maybe something added to the bot comment explaining

This should have significant cost savings on PRs where ready has been added but pre-commit failing code has been pushed.

@hmellor hmellor marked this pull request as draft January 28, 2025 21:17
.github/workflows/add_label_precommit.yml Outdated Show resolved Hide resolved
.github/workflows/add_label_precommit.yml Outdated Show resolved Hide resolved
.github/workflows/add_label_precommit.yml Show resolved Hide resolved
Signed-off-by: Harry Mellor <[email protected]>
@russellb
Copy link
Member

russellb commented Jan 29, 2025

This seems fine, though I think we could accomplish the same thing in .github/mergify.yml. I only bring it up because that tool is used for other label automation. It would be something roughly like this:

diff --git a/.github/mergify.yml b/.github/mergify.yml
index 43bc5ce62..225d311fc 100644
--- a/.github/mergify.yml
+++ b/.github/mergify.yml
@@ -95,3 +95,23 @@ pull_request_rules:
     label:
       remove:
         - needs-rebase
+
+- name: add 'pre-commit passed' label on successful pre-commit job
+  description: Automatically apply pre-commit passed label
+  conditions:
+    - check-success=pre-commit
+  actions:
+    label:
+      add:
+        - pre-commit passed
+
+- name: remove 'pre-commit passed' label when success status is not present
+  description: Remove pre-commit passed label when not marked as successful
+  conditions:
+    - or:
+      - check-pending=pre-commit
+      - check-failure=pre-commit
+  actions:
+    label:
+      remove:
+      - pre-commit passed

@hmellor
Copy link
Collaborator Author

hmellor commented Jan 30, 2025

I originally based this action on add_label_automerge.yml. I don't mind which solution we go with though.

Signed-off-by: Harry Mellor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants