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

feat: add commit-hooks to expand Jira ticket# to URL #32

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

Conversation

vharsh
Copy link

@vharsh vharsh commented Apr 18, 2023

other significant changes:

  • the commit-hook will enforce people to make changes against a Jira ticket
  • commit messages must have a well defined type as defined by conventionalcommits
  • NOTE: this doesn't validate if the ticket exists, but helps adding one in the commit message for easier tracking if the same is provided

assumptions:

  • the ticket belongs to the MOSIP sub-project in Jira(can be updated for different projects)
  • the tickets for issues created in this repo would exist in MOSIP's Jira going forward & not on GitHub

Requirements/TODOs:

  • This changeset would require a Jira ticket created, post which the commit-message would need an update
  • Documenting the developer facing changes & necessary information to avoid surprises & prevent blockers
  • Testing it out in IDE integration of git-commit at least from AndroidStudio, Vscode, Xcode

Tl; dr:

Sample commit messages for future

# earlier the commit-message would be reflected in git as-is, without any mutation
# post-this changeset the commit-message would have a Jira URL to improve code & ticket co-relation

$ git commit -m 'feat(#1234): improve visibility of button on low-res device'
$ # the above commit would look like this in real life
$ git log

commit <hash>
Author: John Doe <[email protected]>
Date:   Tue Apr 18 11:57:54 2023 +0530

    feat(#1234): improve visibility of button on low-res device

    Link: https://mosip.atlassian.net/browse/MOSIP-1234

Co-authored-by: KiruthikaJeyashankar [email protected]

other significant changes:

- the commit-hook will enforce people to make changes against a known Jira ticket
- commit messages must have a well defined type as defined by conventionalcommits

assumption: the ticket belongs to the MOSIP sub-project in Jira

Co-authored-by: Kiruthika Jeyashankar <[email protected]>
@vharsh
Copy link
Author

vharsh commented Apr 18, 2023

A similar changeset will be raised against the release branch if this is approved & accepted.

Display log if the provided commit message's prefix is supposed to have ticket number
COMMIT_MSG_FILE=$1
MESSAGE=$(cat "$1")

ISSUELINK="Link: https://mosip.atlassian.net/browse/MOSIP-"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the issue link has to be modified

"https://mosip.atlassian.net/browse/INJI-"

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