-
Notifications
You must be signed in to change notification settings - Fork 34
Adding a job that enforce a single commit for each PR. #20
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
Conversation
Hi @ybettan. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cc @qbarrand |
@ybettan: GitHub didn't allow me to request PR reviews from the following users: enriquebelarte. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
cc3dab4
to
c50cec1
Compare
@ybettan why do we need the PR description and commit message to be identical? why is it a hard requirement? |
@yevgeny-shnaidman I think that the commit message should be very descriptive and should include all the info required for understanding the code change. By enforcing identical commit message and PR description, the reviewer of the PR can just look at the PR description without the need of also checking the commit message inside the PR in order to make sure the commit message wasn't neglected. In addition, you can add additional info such as reviewers or any other text that is not relevant for describing the change by adding |
/hold |
As agreed, this PR is going to be split into 2 PRs:
Both PR will start as optional jobs and the second one might be removed after some time if it causes more issues than benefits. |
@ybettan please rebase. |
/ok-to-test |
ci/prow/check-commits-number
Outdated
number_of_commits=$(curl -H 'Accept: application/vnd.github+json' \ | ||
https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/pulls/${PULL_NUMBER} | jq '.commits') | ||
if [[ ${number_of_commits} != 1 ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could use git
to do that: git rev-list --count HEAD ^main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
Fixed.
ci/prow/check-commits-number
Outdated
@@ -0,0 +1,12 @@ | |||
#!/usr/bin/env bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rename this to ci/prow/check-commits-count
. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.5 to 0.5.7. - [Release notes](https://github.com/google/go-cmp/releases) - [Commits](google/go-cmp@v0.5.5...v0.5.7) --- updated-dependencies: - dependency-name: github.com/google/go-cmp dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This job will make sure that all commits in a PR were squashed to a single commit. Signed-off-by: Yoni Bettan <[email protected]>
/unhold |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qbarrand, ybettan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Adding a job that enforce a single commit for each PR.
This job will make sure that all commits in a PR were squashed to a single
commit.
Signed-off-by: Yoni Bettan [email protected]