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

KAFKA-18792 Add workflow to check PR format #18985

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

mumrah
Copy link
Member

@mumrah mumrah commented Feb 20, 2025

Adds two new workflows to help us enforce some uniform PR structure. The first workflow runs in an unprivileged context and simply captures the PR number into a text file and archives it. This is then used by another workflow that runs in a privileged context using the code in trunk to actually do the validation.

The validation is done using a new Python script. This script fetches a PR using the GitHub CLI and validates its structure. For now this just includes the title and body, but could perform other non-code related checks in the future.

This validation is needed for the up-coming merge queue functionality.

@github-actions github-actions bot added the build Gradle build or GitHub Actions label Feb 20, 2025
@mumrah
Copy link
Member Author

mumrah commented Feb 21, 2025

To test this PR:

  • Install gh if you don't have it already (brew install gh)
  • Checkout this PR: gh pr checkout 18985
  • Run the script against any PR
GITHUB_ACTIONS=1 PR_NUMBER=18955 python .github/scripts/pr-format.py
  • Observe success or failure. Note that basically all PRs will fail the new required "Reviewers:" line in the PR body.

We cannot test the full automation until this PR is merged since part of the workflow runs off of trunk.

@jolshan
Copy link
Member

jolshan commented Feb 22, 2025

I ran the command on this PR and it seems to have passed. Is that expected?

GITHUB_ACTIONS=1 PR_NUMBER=18985 python .github/scripts/pr-format.py
Read env GITHUB_ACTIONS: 1
Read env PR_NUMBER: 18985
PR format looks good!

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