ejoffe / spr

Stacked Pull Requests on GitHub
MIT License
796 stars 68 forks source link

SPR & Github JIRA Integration does not "play nice" #318

Open jameskyle opened 1 year ago

jameskyle commented 1 year ago

Problem

I've used a couple of different JIRA / Github integrations and they seem to essentially work the same way.

  1. If a PR references an issue ID in the commit msg head or body that issue is associated to the PR
  2. If the PR is merged, the jira issue is transitioned through the JIRA workflow (e.g. moved to in progress once submitted)
  3. Issue is resolved once merged.

SPR builds a PR chain with one link for each commit. Each commit message may reference a different Jira Issue and each Jira issue is moved to "in progress" when the stack is first updated (PR's created).

If you run a git spr merge with multiple commits ready to merge, SPR "rolls up" the stack and closes the previous PR.

The process of "rolling up" does not trigger a new association by the JIRA Integrations I've used.

The end result when the final PR is merged is the original Jira Issue associated with that PR is closed. But the others in the stack remain open.

Work Around

The work around I've found is to do a git spr merge --count 1. Wait for it to merge, update, then merge the next. This works, but is tedious.

Possible solutions

One solution that may work is to actually commit the merge for the PR instead of closing and rolling up locally. This should trigger the Issue transition to Done/Resolved. Then just clean up the branch and let the final PR merge as it does now.