Skip to content

v4.0.x: GitHub Action git commit checker#8663

Merged
gpaulsen merged 4 commits intoopen-mpi:v4.0.xfrom
jsquyres:pr/v4.0.x/gha-git-commit-checker
Mar 22, 2021
Merged

v4.0.x: GitHub Action git commit checker#8663
gpaulsen merged 4 commits intoopen-mpi:v4.0.xfrom
jsquyres:pr/v4.0.x/gha-git-commit-checker

Conversation

@jsquyres
Copy link
Member

Bring the new GitHub Action git commit checker to the v4.0.x branch (these are cherry-picked from the v4.1.x branch).

Cherry picks will be required when this PR is merged (just like the v4.1.x branch).

Jeff Squyres added 4 commits March 21, 2021 08:32
This will replace the old "Signed-off-by checker" and "Commit email
checker".  Both of those checks are now subsumed into this Github
Action, and we also introduce a new functionality: checking the
"cherry picked from commit xyz" messages (slightly obfuscated here in
the commit message so that it does not cause the test to fail!).

1. If a `cherry picked from commit abc123` message is found in a git
   commit message, verify that that commit actually exists in the main
   Open MPI repo.  If it doesn't, fail the CI test.
2. The config file in the git repo
   `.github/workflows/git-commit-checks.json` indicates whether
   cherry-pick messages are _required_ in commit messages.
    1. The contents of that file on the target branch determine
       whether cherry pick messages are required on that branch or
       not.  Meaning: we'll set the contents of that file to _not_
       require cherry pick messages on master.  When we branch for
       releases, we change that config file on the new branch to
       require cherry pick messages.
    2. When cherry pick messages are required and the PR contains
       commits that do not have cherry pick messages, fail the CI
       test.
    3. When cherry-pick messages are required, Reverts, Merge commits,
       and commits that are entirely comprised of submodule updates
       are explicitly excluded from this requirement.  Example:
        1. A PR is created to a target branch with the cherry pick
           message requirement is enabled.
        2. The PR branch contains commits with `(cherry picked from
           commit ....)` messages, and the commit hashes mentioned all
           exist on master.
        3. The PR branch contains a Revert commit.
        4. The PR branch contains a Merge commit.
        5. The CI test will pass.
    4. If a magic token is present in the PR description (e.g.,
       `bot:notacherrypick`), then the requirement for cherry pick
       messages is disabled for all commits on that PR.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
(cherry picked from commit f54b614)
(cherry picked from commit bf62e33)
Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
(cherry picked from commit d4d1bcf)
(cherry picked from commit a404cb9)
Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
(cherry picked from commit 2f042fb)
Github shows both the "outer" and "inner" names on the CI line in the
Github web UI, so make sure to give good names for both.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
(cherry picked from commit 73f2926)
(cherry picked from commit 3dd378c)
@hppritcha
Copy link
Member

@jsquyres please remind me how this is suppose to work with non-cherry-picked commits? Do I need to add a key-word or phrase in the commit message?

@jsquyres
Copy link
Member Author

@jsquyres please remind me how this is suppose to work with non-cherry-picked commits? Do I need to add a key-word or phrase in the commit message?

In the main description of the PR (not an arbitrary comment), put bot:notacherrypick.

@gpaulsen gpaulsen merged commit 240e167 into open-mpi:v4.0.x Mar 22, 2021
@jsquyres jsquyres deleted the pr/v4.0.x/gha-git-commit-checker branch July 17, 2022 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants