Add lefthook gem, some lefthook checks and docs
What does this MR do?
Adds the lefthook gem and prepush checks for rspec and Changelog git commit trailer in the first commit.
Also added documentation for lefthook and ran bundle update
.
The changelog related lefthook configuration is mostly copied over from gitlab-org/ruby/gems/gitlab_quality-test_tooling!154 (merged)
Related issue: gitlab-org/quality/quality-engineering/team-tasks#2500 (closed)
How to set up and validate locally
git checkout lefthook_check_changelog
git checkout -b my-test-branch
git reset HEAD~1 # Remove the commit from the MR
git add .
git commit -m 'A commit without a changelog'
bundle exec lefthook run pre-push # should fail
git commit --amend
"""
A commit with a changelog
Changelog: added
"""
bundle exec lefthook run pre-push # should succeed
Check-list
-
Ensure commits include Changelog:
trailer -
Verify the change in all affected pipelines.
Edited by Sanad Liaquat