Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull Request descriptions being edited by Jira #1820

Open
nicholasspencer opened this issue Jan 5, 2023 · 15 comments
Open

Pull Request descriptions being edited by Jira #1820

nicholasspencer opened this issue Jan 5, 2023 · 15 comments

Comments

@nicholasspencer
Copy link

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 nicholasspencer changed the title Pull Request descriptions being edited by Jira's bot Pull Request descriptions being edited by Jira Jan 5, 2023
@krazziekay
Copy link
Collaborator

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 added a commit that referenced this issue Jan 5, 2023
* - Correct Regex applied

* - Correct Regex added
- Test cases added

* - minor update in test case

* - minor update in test case

Co-authored-by: Kayub Maharjan <kmaharjan4@atlassian.com>
@krazziekay
Copy link
Collaborator

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

@krazziekay krazziekay added the awaiting response Need more input from user label Jan 5, 2023
@nicholasspencer
Copy link
Author

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

@krazziekay krazziekay removed the awaiting response Need more input from user label Jan 5, 2023
@nicholasspencer
Copy link
Author

Seems like this is happening again.

@RafalSkolasinski
Copy link

Happening for us as well

@nicholasspencer
Copy link
Author

And again...

@malyavi-nochum
Copy link

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

@rs21brady
Copy link

#happeningagain

@nicholasspencer
Copy link
Author

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...

@cleverer
Copy link

cleverer commented Oct 6, 2023

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

@bikram-agarwal
Copy link

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.

@BenedekFarkas
Copy link

BenedekFarkas commented Dec 6, 2023

Can confirm it's happening with issue and PR descriptions, also related: #2046

@pascal-hofmann
Copy link

pascal-hofmann commented Dec 13, 2023

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.

@imishchuk-carbon
Copy link

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.

@magnetikonline
Copy link

magnetikonline commented Mar 20, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests