clients icon indicating copy to clipboard operation
clients copied to clipboard

[ENG-72] Require PR title to include Jira identifier

Open trmartin4 opened this issue 3 years ago • 2 comments

Type of change

- [ ] Bug fix
- [ ] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [X] Other

Objective

In order to tie Jira issues to code deployments, each commit message must have the Jira identifier in it. To prevent developers from having to type the issue in each commit, this PR added Git hooks through Husky to try to pre-populate the commit message with the issue identifier if it can be found in the branch name.

Code changes

  • enforce-pr-title.yml Workflow step that will run when a PR is marked "Ready For Review" to make sure that the title contains a Jira identifier.

  • update-pr-title-with-jira.yml Workflow step that will run when a PR is created or edited that will attempt to retrieve a Jira identifier from the branch name and prepend it to the PR title.

  • release-desktop.yml Fixed bug where status was getting set to failure instead of in_progress on deployment.

Before you submit

- [ ] I have checked for **linting** errors (`npm run lint`) (required)
- [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required)
- [ ] This change requires a **documentation update** (notify the documentation team)
- [X] This change has particular **deployment requirements** (notify the DevOps team)

trmartin4 avatar Jul 27 '22 15:07 trmartin4

@trmartin4 do we still want the pre-commit hooks?

Hinton avatar Jul 28 '22 07:07 Hinton

@Hinton, I talked with Álison to make sure I understood long-term intent. The goal is to eventually be able to deploy to the QA environment from non-master branches. In order to track which Jira issues are in that deployment, at least one commit prior to the deployment must be tagged with the Jira issue. Rather than rely on us knowing when the deployment is going out and anticipating when to add the Jira issue tag, we thought it would be best to automate it from the branch name to make it as seamless as possible.

Does that reasoning make sense? I'm all for simplifying the process if you were thinking of a cleaner way to do it, given the data that we need to capture.

trmartin4 avatar Jul 28 '22 13:07 trmartin4