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

MINOR Don't run tests for Draft PRs #17299

Merged
merged 8 commits into from
Sep 28, 2024
Merged

Conversation

mumrah
Copy link
Member

@mumrah mumrah commented Sep 27, 2024

This patch updates our CI workflow to skip the JUnit tests if the PR is marked as a Draft. Also, change to using the more modern "checks" API instead of "statuses" for the feedback from CI Complete.

@github-actions github-actions bot added the build Gradle build or GitHub Actions label Sep 27, 2024
@mumrah mumrah requested a review from chia7712 September 27, 2024 14:08
@mumrah mumrah marked this pull request as ready for review September 27, 2024 14:08
@mumrah
Copy link
Member Author

mumrah commented Sep 27, 2024

Example of the tests and build scans being skipped (from my fork):

image

When I click "Ready For Review", the CI kicks off and the tests run

Screen.Recording.2024-09-27.at.10.11.03.AM.mov

@mumrah mumrah changed the title MINOR Don't run tests for draft PRs MINOR Don't run tests for Draft PRs Sep 27, 2024
@mumrah
Copy link
Member Author

mumrah commented Sep 27, 2024

Example with "WIP" in title: mumrah#25

Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@mumrah thanks for this nice PR.

if: |
github.event_name == 'pull_request' && (
github.event.pull_request.draft ||
contains(github.event.pull_request.title, 'WIP')
Copy link
Member

Choose a reason for hiding this comment

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

In my opinion, using the "title" to indicate that a PR doesn't need CI is less straightforward than simply marking it as a "draft." Perhaps a WIP could be interpreted as "this PR requires CI but doesn't need a review at the moment." That is a common use case in Kafka community.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, that's a good point. I went with the title since that's something non-committers can update (unlike labels). I'm fine leaving this out for now and just using the Draft status.


runs:
using: "composite"
steps:
- name: Update Check
- if: inputs.conclusion == ''
Copy link
Member

Choose a reason for hiding this comment

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

Pardon me, what is the purpose of this step?

Copy link
Member Author

Choose a reason for hiding this comment

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

The checks API has status and conclusion. The conclusion is only given if the status is "completed".

If we want to set a check to pending (as we've discussed in other PRs), we would send status=pending with no conclusion.

Because of the two forms of API call needed (one with conclusion, one without), we needed two steps with different arguments.

Copy link
Member

Choose a reason for hiding this comment

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

@mumrah, thanks for sharing. Although this step is not currently in use, it is intended to serve the needs of KAFKA-17607, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe you meant https://issues.apache.org/jira/browse/KAFKA-17572 (clearing a status when re-running a job)?

Copy link
Member

Choose a reason for hiding this comment

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

oh, you are right 😀

Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

LGTM

@mumrah mumrah merged commit c969c86 into apache:trunk Sep 28, 2024
9 checks passed
airlock-confluentinc bot pushed a commit to confluentinc/kafka that referenced this pull request Sep 30, 2024
mumrah added a commit that referenced this pull request Oct 1, 2024
This reverts parts of #17299 related to the checks API 

Reviewers: Chia-Ping Tsai <[email protected]>
tedyu pushed a commit to tedyu/kafka that referenced this pull request Jan 6, 2025
tedyu pushed a commit to tedyu/kafka that referenced this pull request Jan 6, 2025
This reverts parts of apache#17299 related to the checks API 

Reviewers: Chia-Ping Tsai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Gradle build or GitHub Actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants