andygrunwald / go-jira

Go client library for Atlassian Jira
https://pkg.go.dev/github.com/andygrunwald/go-jira?tab=doc
MIT License
1.47k stars 468 forks source link

Auto-label merge conflicts #502

Open marcelosousa opened 2 years ago

marcelosousa commented 2 years ago

Describe the bug

This is more of an annoyance than a bug.

I forked the repository and after a while started receiving a lot of failing notifications about the 'Auto-label merge conflicts'.

To Reproduce

Check https://github.com/marcelosousa/go-jira/actions/workflows/label-merge-conflicts.yml.

You will see all the failures which are caused by not having the 'conflicts' label in the fork (I didn't know that GitHub doesn't copy the labels for the forks).

Expected behavior

I would expect that all the cron workflows would be disabled in the forks - this is a waste of resources.

Possible Solution

Add information to README to warn devs that fork the repository of this issue.

andygrunwald commented 2 years ago

This is unfortunate, indeed. For me, as a maintainer, the conflict label is pretty useful. The fork situation is something we should fix to make contributions less painful.

What I can think of: Adding something that either the job only runs if the label exists in the repository or auto-create the label. https://github.com/mschilde/auto-label-merge-conflicts/issues/52 seem to match the idea.

There is also https://github.com/marketplace/actions/label-syncer, but this is a bit over-engineered for this.

Happy to accept PRs on this.

marcelosousa commented 2 years ago

If you just want to synchronise labels, you can use Reviewpad for that. In the yaml configuration, if you add a label in the labels section (https://docs.reviewpad.com/guides/syntax#label):

labels:
  has-git-conflicts:
    description: pull request has git conflicts
    color: d2697a # optional

Then this label will be automatically created for you in a Reviewpad run.

Putting that aside, I believe the best way to implement this check is not with a cron job but with by listening to pushes to branches. This way you only react when it is absolutely needed. We are working on this for next week's release: https://github.com/reviewpad/reviewpad/issues/319