Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Pilot Lvl 1
Message 1 of 5

Attach metadata to PR (other than status), or close / comment without notification?

Solved! Go to Solution.

When using an external tool to handle the PR integration process (see: Not Rocket Science Rule to Software Engineering) the external tool has to close the PR explicitly and should probably indicate where / how the PR was integrated (e.g. the hash of the merge / rebase / squash commit).

 

Via the API, this requires two calls:

PATCH /repos/:owner/:repo/pulls/:pull_number

 to change its state to closed then

POST /repos/:owner/:repo/issues/:issue_number/comment

to add a comment providing relevant information.

 

This, in turn, generates two notifications to every follower of the PR for what is essentially a single event. On busy repositories, this generates a lot of spam (even more so when using a tool like CPython's Miss Islington which semi-automatically creates backports for PRs, backports onto which the original contributors likely get automatically pinged. For instance python/cpython#16597 tags the original contributor & the original reviewer in comments, leading to them getting all messages by default, and thus a lot of churn. Even more so as PR notifications / pings tend to be relevant / high-SNR information (people or colleagues bringing up issues or asking for information / feedback) and would thus be amongst the last to be binned or web-only.

 

Alternatively, I'm also open to an other way (than a comment) of adding relevant information to the PR, edirting an existing comment (or the PR message) feels distasteful and adding such meta-information as status seems like a misuse of the feature, not to mention statuses apparently disappear / get suppressed when a PR is closed or merged which rather defeats the intent as we specifically want to tell users where the pull request was actually integrated into the history proper.

4 Replies
Solution
Community Manager
Message 2 of 5

Re: Attach metadata to PR (other than status), or close / comment without notification?

I'm not entirely certain what you mean by "integrated" since that is a fairly overloaded term. But you may want to look at the Deployments API if you haven't already? It sounds like what you want is some sort of "after the PR is merged" process, so this might be what you're looking for?

 

Let us know if you have more questions.

Pilot Lvl 1
Message 3 of 5

Re: Attach metadata to PR (other than status), or close / comment without notification?

That does look extremely interesting, are deployments visible but silent to followers of the PR (aka some sort of link is visible on the PR, but the information is not pushed to followers)?

 

If that's the case, not only would that suit my needs perfectly, it might provide QoL improvements to various ancillary tasks. I can't believe I missed this thing.

Pilot Lvl 1
Message 4 of 5

Re: Attach metadata to PR (other than status), or close / comment without notification?

@lee-dohmafter some testing deployments do seem to fit the bill, however some bits are a bit unclear e.g. the descriptions (on deployment & deployment statuses) don't seem to be used anywhere, and only the "environment", "state" and "target_url" look relevant from an UI perspective (rather than automated tooling), is that correct?

Community Manager
Message 5 of 5

Re: Attach metadata to PR (other than status), or close / comment without notification?

To be honest, I don't know if all the fields are used in the UI or not. I believe the description would show up in the deployments UI for the repository, if used. None of the tools that I've employed use the description field though, so I'm not certain.