unicode-org / jira-github-pr-check

Checks GitHub pull requests for valid and accepted Jira tickets. Used for ICU and CLDR
Other
11 stars 12 forks source link

Update JIRA ticket with status on merge #62

Open srl295 opened 1 year ago

srl295 commented 1 year ago

@sffc this is somewhat of a question.

Context: https://unicode-org.atlassian.net/browse/CLDR-15400

There's sometimes confusion when a PR or commit mentions a JIRA ticket but isn't targetted at that ticket. xrefs are super helpful, but can add noise. (I filed this ticket to try to avoid needing some kind of policy that restricts mentioning other tickets.)

Jira's "developer" field isn't really a field, you can't really search for "Tickets that have commits" and even if you could, you don't know if the ticket was really fixed by the PR or just mentioned by it.

If pr-check gets notified on merge, then it could actually update a Jira field, something like "mergedIn".

More advanced:

sffc commented 1 year ago

I'd make the hook be "commits on main" or "commits on a branch matching maint/.*" and if you want it to use the bot account to update Jira I think that's fine.

srl295 commented 1 year ago

I'd make the hook be "commits on main" or "commits on a branch matching maint/.*" and if you want it to use the bot account to update Jira I think that's fine.

Does/could this pr check accept such a hook?

I'm asking about the mechanism… are you suggesting this be implemented as a new github action on push to main?

sffc commented 1 year ago

The cloud function already routes webhook requests; this can be added as an additional webhook that gets processed.

https://github.com/unicode-org/jira-github-pr-check/blob/main/app.js#L394

srl295 commented 1 year ago

Actually, it would also be helpful to update a field whenever a PR that targets that ticket is opened. So whenever a PR titled CLDR-12345 do the stuff is opened, it adds the URL to that PR to the list of PR links in a new field. yes, it would have excess content if something was misticketted. but it would allow searching on which tickets ever had a PR opened against them. As mentioned above:

srl295 commented 1 year ago

per CLDR-TC: