Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AAP-35592: Move git hooks to own folder, add pre-push hook (#674)
# [AAP-35592] Add git hook checking existence of Jira number in branch and commit messages ## Description <!-- Mandatory: Provide a clear, concise description of the changes and their purpose --> This PR provides following changes: * creates new folder for git hooks to make the git hooks more visible and easier to maintain. The folder itself contains documentation. * adds a new git hook invoked at `git push` to check whether the branch and commit message at the time of push contain Jira number (AAP-NNNNN) or a special marker `NO_JIRA` to indicate the changes don't have/need a Jira item. These changes are needed in order to keep work items in Jira in sync with their corresponding pull requests and commits. The Jira numbers included in the commit messages can be different from Jira number in branch name to allow for cherry-picking of commits when PRs are being back ported. ## Type of Change <!-- Mandatory: Check one or more boxes that apply --> - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update - [ ] Test update - [x] Refactoring (no functional changes) - [x] Development environment change - [ ] Configuration change ## Self-Review Checklist <!-- These items help ensure quality - they complement our automated CI checks --> - [x] I have performed a self-review of my code - [x] I have added relevant comments to complex code sections - [x] I have updated documentation where needed - [x] I have considered the security impact of these changes - [x] I have considered performance implications - [x] I have thought about error handling and edge cases - [x] I have tested the changes in my local environment ## Testing Instructions <!-- Optional for test-only changes. Mandatory for all other changes --> <!-- Must be detailed enough for reviewers to reproduce --> ### Prerequisites <!-- List any specific setup required --> ### Steps to Test 1. Pull down the PR 2. Run `make git_hooks_config` in the root of the repo 3. Create a new branch, make some change, commit it and try to push it to your fork. Based on branch name and commit message you will see different results (see below). ### Expected Results <!-- Describe what should happen after following the steps --> * If the branch did not include either a Jira number in format AAP-NNNN or magic string NO_JIRA you shouldn't be able to push. * If the branch did include Jira number, but commit message did not, you shouldn't be able to push. * If the branch did include Jira number, and the commit message included the same Jira number, your push will succeed. * If the branch did include Jira number and the commit message included **different** Jira number, you will see a warning but the push will succeed.
- Loading branch information