-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Provide option to configure format of branch name #396
Comments
Thanks for the feedback @edkellena. It's a totally legit request, but I'm not keen on changing things on Dependabot's side for a couple of reasons:
Do you have control over the build process on your side? I'm hoping it would be straightforward for you to sanitize the branch name when generating a tag. |
From @edkellena on January 9, 2018 22:12 Fair enough 👍 I did wonder whether it would be a fruitless ask! Would be happy to attempt a PR for the generation, but without the UI setting available, that would be a bit pointless. I do have some very hacky workaround at the moment, which I'll try to unhack soon. Cheers though! |
Always worth asking! Thanks for understanding 🙂 . |
Is it still a problem to implement? We have exactly the same issue |
You could always monkey-patch it, now whether or not you should... module Dependabot
class PullRequestCreator
class BranchNamer
def new_branch_name
super.gsub(TO_REMOVE, TO_REPLACE)
end
end
end
end |
if you use dependabot v2 just add to your
|
I'd like to bump this request - our CI system also requires that branch names only be so long. What we don't require is that our branch names be semantically accurate - something like I do understand that the logic in Right now, a lot of our dependabot PRs are unusable without a dev having to manually create a new branch and PR. |
Is there an option to change the branch name? I think it is too long, and maybe it would be better and cleaner for the branch to include only dependabot/updated-dependencies. |
Why was this closed? The following dependabot branch breaks docker tags I don't see why the version-number needs to be in the branch name. What's the purpose of that? In any case, it makes sense to make it an option to provide a custom branch name. |
1 for this request. Our dependabot build fail because we use ACR. Sample error from the pipeline:
|
I'm going to re-open since there's so much interest here. I'm not sure that we'll choose to solve this by providing the option, but clearly there's a problem that needs solving in one way or the other. |
FWIW Another data point: Our CI end-to-end tests check PRs (including dependabot PRs) through Cloudflare preview deploys. At some point, for branch names longer than ~28 characters, Cloudflare adds an (undocumented 🙈) 4-random-letter suffix to the otherwise deterministic preview URL. This makes the CI fail dependabot PRs with long branch names as it can't easily compute the preview URL by itself. For us, a |
Hi! If I understand correctly, there’s two issues reported here:
The former is already fixed by the This will require a few internal changes but it seems like a big part of it is already in place. |
@deivid-rodriguez The other issue is the use of uppercase chars, which e.g. Azure Container Registry (ACR) does not support. |
Oh I see, thanks for noticing that. |
The branch-length problem also regularly hits us, when using GCP Workload Identity Federation with the following error:
This emerges from the Token-Format where the subject is the repository- and branch-name, which in combination with the length limitation on GCP for the subject. The only workaround we currently have is to rename the branch and create a new PR, because the old one is tied to the branch name, so that our checks can work as expected. Providing/Exposing the |
I am also facing the same issues with branch name length. We are using harness to deploy our applications and it is allowing only 63 characters for the branch name. It would be great if we get the option for max-length |
The option to configure maximum branch length has been released here in v0.213.0 (https://github.com/dependabot/dependabot-core/blob/main/CHANGELOG.md#v02130-31-october-2022) and in dependabot-gitlab in version v.0.30.0 (https://gitlab.com/dependabot-gitlab/dependabot/-/releases/v0.30.0). |
@TomNaessens Thank you for the update. How do I specific this specific version in depdendabot.yml. I am receiving below error
I don't see this option here https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file. Please let me know what I am missing |
I think the problem is that while the option was added to this library, we're not yet making use of it in the GitHub service, nor have yet exposed any configuration option for it, since that requires a number of internal changes. But this feature is definitely closer now than it was before! |
@ramachandran-murugaian-kr @deivid-rodriguez I agree. To my understanding what @TomNaessens referred to is that the internal branch namer now has the ability to generate branch names of limited length ( |
We are also looking forward to a feature which enables the customization of the dependabot branch name. The issue we have is that we create a lot of resources based on the branch name. Our dependabot builds fail, because resource names (e.g. included in domain names, in AWS resources, ...) are reaching the allowed byte limits. For example a branch name like |
In our case, we are running some k3s infrastructure and we are limited to branch names of 63 characters Exposing the max-length will be great! |
I just came across an issue being caused by long PR names, and was surprised to find that there is no way to control how PR names are formatted. My Dependabot target-branch is
I'd love the flexibility to be able to omit the This would allow my Dependabot PRs to be: |
👍🏼 Yeah, it would be nice if there would be an option that would allow you to enter custom branch names in the Alternatively, you could look at Renovate's insane array of configuration options 😄: Please, it's opened since 2018 😢 |
We use cloud tools that fail because of long branch names. This makes using dependabot really annoying. |
Had to resort to this in my Github Workflow file:
|
The length is already configurable: And we're talking about adding some reasonable per-platform defaults too: What is not captured in those is modifying the format of branch names, which is much more complex then just truncating to a max length. That's what this ticket is about. |
Although the max length is configurable it doesn't seem exposed in the GitHub actions config options, https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file How feasible is it to add this in? Is there a repo for the GitHub action, I'd be happy to try and contribute towards this but unsure if the action code is in a private repo or one that doesn't accept contributions from the community. |
Also waiting, and really looking forward for the exposure of the branch length configurability so that in can be set in the |
why cant we just provide a template option using ruby interpolation?
or if you care about branch name length:
then provide a bunch of options for all the meta as different variables . and document that using this will affect x/y/z aspects of dependabot |
In our primary repo if a branch name exceeds 85 chars in our environment we run into
Authenticating to GCP using workload identity federation via https://github.com/google-github-actions/auth |
Chiming in from another CI environment that only tolerates |
Also hit by max length issues with workload identity and the subject being longer than 127 bytes. We cannot rely on Dependabot when there are limitations like this and will revert back to Renovate which is FAR more configurable. Two specific options you can simply steal I would say are:
All branch names are a simple hash like Its already super apparent from the PR and the files changed what dependencies are being updated - not sure why we would want all that detail in a branch name too. This also solves all unsupported character issues at the same time 🤷🏻 |
@felixbouleau @victor-ferrer-form3 There appears to be an option to configure the separator: |
This breaks on Tekton pipelines. The separator is not enough.
|
Is there any progress on this, at least when it comes to a customisable branch name length? |
From @edkellena on January 9, 2018 15:40
Hey,
It would be super awesome if we could specify some format for the branch name created.
Use-case:
Our CI system sees a PR raised and will run through a build process that generates a Docker image and tags it with the branch name. Unfortunately Docker tags have more limited scope than Git branches...
A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and dashes. A tag name may not start with a period or a dash and may contain a maximum of 128 characters.
The
/
in the Dependabot branches is causing that tagging to fail. We can work around this with some awk/shell wizardry I guess, but would be nice not to have to do this.Copied from original issue: dependabot/feedback#72
The text was updated successfully, but these errors were encountered: