dependabot-core
dependabot-core copied to clipboard
Why are some labels automatically created and some not?
Hi,
I was tasked with implementing the addition of some labels to the PRs that dependabot-core raises this week to notify whether something is a patch, minor or major bump. I noticed that dependabot will use such labels automatically if there are already defined on a given repo.
What I'm unclear about is why, for these labels, it checks and uses the labels if the are already there, but for the 'dependencies' and 'language' labels, it will go ahead and create them by default if they are not present? It was very easy to patch the class so that it did this, but I'm unclear as to why there is this difference in default behaviour.
Could you enlighten? I'd also be more than happy to contribute back the work to make the creation of patch, minor and major default labels too if you're interested.
@JimNero009 yeah the current behaviour is a bit surprising and deals with the case where you haven't configured any labels, in which case the defaults are created on the repo if they don't exist (dependencies, security and language). If you set custom labels no labels get created. So if you want to override the default behaviour you can pass your own custom labels to the pull request creator.
We might move away from automatically creating labels so I don't think we want to start creating the patch, minor and major labels.
Why are you considering moving away from the automatic creation of labels, out of interest? I don't see the downside of doing it, really. In fact, I thought it was a little surprising that custom_labels didn't create the labels by default and what led me into properly inspecting this part of the code.
Why are you considering moving away from the automatic creation of labels, out of interest? I don't see the downside of doing it, really. In fact, I thought it was a little surprising that custom_labels didn't create the labels by default and what led me into properly inspecting this part of the code.
We'll probably keep the current behaviour but creating custom labels is thicker to get right. You can set colour and description for example, if these are not configurable, what do we set, should it be random etc. You quickly get into building a policy bot that creates consistent labels on all your repos 🙈
Closing out as stale