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
Contributor

@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 Related to the Github or Jenkins builds label Sep 27, 2024
@mumrah mumrah marked this pull request as ready for review September 27, 2024 14:08
@mumrah
Copy link
Contributor 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
Contributor Author

mumrah commented Sep 27, 2024

Example with "WIP" in title: mumrah#25

Copy link
Contributor

@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
Contributor

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
Contributor 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
Contributor

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
Contributor 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
Contributor

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
Contributor 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
Contributor

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
Contributor

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to the Github or Jenkins builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants