github-for-jira icon indicating copy to clipboard operation
github-for-jira copied to clipboard

Pull Request descriptions being edited by Jira

Open nicholasspencer opened this issue 2 years ago • 16 comments

It seems like there was a recent change that was introduced which is constantly editing our pull request descriptions. It looks like something is pattern matching the ticket format and then appending a (poorly formatted imo) bit of text at the end.

A few issues with this. We squash our PRs and merge in the description of the PR as the commit message. We also use git trailers which are expected to be at the end of the commit. The bot appending it's own information at the end messes with this.

Another thing... it doesn't even work correctly. We have a PR template which contains docblocks explaining parts of the template. This is the explanation on using git trailers along with the ticket for the PR that I added, and the line that the bot injected.

## Context

<!--
Use commit trailers to add additional context such as the assigned Jira ticket, related Jira tickets, and related Github Pull Requests.

https://git-scm.com/docs/git-interpret-trailers

Example:
related-to: MW-1234
related-to: resideo/lantern_flutter#<pr number>
ticket: MW-5678
-->

ticket: MW-6010


[MW-1234]: https://resideo.atlassian.net/browse/MW-1234?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

As you can see the [MW-1234]: http://resideo... bit at the end was injected because it picked up the fake/example ticket number from ticket: MW-1234 which is in a docblock. The real ticket was MW-6010 which was in the proper place for the trailer until the Jira integration comes stomping through.

Is there anyway to turn this behavior off?

nicholasspencer avatar Jan 05 '23 05:01 nicholasspencer

Hi @nicholasspencer , we did recently push a fix for correcting the links to the Jira issue tickets in GitHub's PR. That is probably whats causing this behaviour. I will look into this and have it resolved quickly.

krazziekay avatar Jan 05 '23 05:01 krazziekay

@nicholasspencer The fix has been merged and will be deployed soon. Please test it again.

krazziekay avatar Jan 05 '23 06:01 krazziekay

Looks like that did the trick. Thank you very much!

nicholasspencer avatar Jan 05 '23 14:01 nicholasspencer

Seems like this is happening again.

nicholasspencer avatar Mar 21 '23 08:03 nicholasspencer

Happening for us as well

RafalSkolasinski avatar Apr 06 '23 13:04 RafalSkolasinski

And again...

nicholasspencer avatar Apr 19 '23 22:04 nicholasspencer

Is there any way to shut off this automation? It's causing a lot of issues with our CI

malyavi-nochum avatar May 05 '23 17:05 malyavi-nochum

#happeningagain

rs21brady avatar Jun 27 '23 15:06 rs21brady

And again. Please add an integration test to prevent this behavior or add a flag or something to the GitHub app to turn this on and off...

nicholasspencer avatar Aug 10 '23 22:08 nicholasspencer

Same issue here… very annoying to not even have options to disable this. As we already have set up Autolink References

cleverer avatar Oct 06 '23 21:10 cleverer

I'm having the same issue, in even weirder way. I'm using Jira Automation Rule to automatically create pull requests in GitHub. The Jira Automation Rule sends a web request to GitHub REST API endpoint (https://api.github.com/repos/$org/$repo/pulls) with this custom data -

{
    "title": "{{issue.key}}: PR to qa",
    "body": "PR auto-created from Jira Issue [{{issue.key}}]({{issue.url}})",
    "head": "feature/{{issue.key}}",
    "base": "qa"
}

The pull request is getting created fine. But immediately afterwards, the jira (bot) is editing the PR body, to add some hidden code to it. Body looks same before and after the editing done by jira (bot) -

PR auto-created from Jira Issue EXMPL-12345

But when I check the source code of body after jira (bot)'s editing, looks like it adds a second line to it - Body source code after Jira (bot) edits it -

PR auto-created from Jira Issue [EXMPL-12345](https://myorg.atlassian.net/browse/EXMPL-12345)

[EXMPL-12345]: https://myorg.atlassian.net/browse/EXMPL-12345?atlOrigin=loNgAlphaNumericStringHere

I dislike this behavior, because we have CI jobs configured in GitHub that get triggered when a PR is edited. So, this behavior of the jira (bot) is unnecessarily triggering those CI jobs.

I need to stop this. Please let me know how.

bikram-agarwal avatar Nov 29 '23 22:11 bikram-agarwal

Can confirm it's happening with issue and PR descriptions, also related: https://github.com/atlassian/github-for-jira/issues/2046

BenedekFarkas avatar Dec 06 '23 12:12 BenedekFarkas

We also experience this issue. We use renovate to update dependencies. It creates pull requests that get edited by github-for-jira. Renovate does not like the edits and reverts all the changes with another edit. Then github-fot-jira edits again and we end up with hundreds of edits.

pascal-hofmann avatar Dec 13 '23 19:12 pascal-hofmann

Hey, folks.

We're experiencing this too. In our case we run some jobs on PRs being opened, edited, synchronized. So when jira bot edits the PR it triggers redundant job execution, which in turn costs us money/resources.

imishchuk-carbon avatar Dec 21 '23 14:12 imishchuk-carbon

We're getting this as well.

Would really like there to be a Jira -> GitHub "read only" mode that could be set at an instance/project level.

Love that Jira can associate pull requests with Jira tickets/etc. - but in no way want Jira messing with our GitHub state. Hate this.

magnetikonline avatar Mar 20 '24 02:03 magnetikonline