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

Feature to limit branch name length #3329

Open
henricook opened this issue Apr 8, 2024 · 3 comments
Open

Feature to limit branch name length #3329

henricook opened this issue Apr 8, 2024 · 3 comments

Comments

@henricook
Copy link
Contributor

A couple of times recently, for the first time i've noticed it, Steward has been raising branch names longer than 40 characters.

We have an internal limit on our repositories of 40 characters for infra reasons (K8S pod names get too long). We could tackle that, or I could build feature in Steward to limit branch names (some kind of substring of the full package name perhaps).

Comment request: Does this feature exist, or does it sound like a valid feature we could build for Steward?

@mzuehlke
Copy link
Member

When you look at for what branch names are used you will see that they are used to identify already created pull request.
This means the there has to be a stable mapping between a set of updates the related branch name

@henricook
Copy link
Contributor Author

For sure, I'm thinking something like:

Example long branch name (from the reason i'm looking at this): update/owasp-java-html-sanitizer-20240325.1 (43 chars)
Branch name limit: 40

  • Take name before the version: owasp-java-html-sanitizer
  • Trim num of characters + 6 (for hash and hyphen)
  • owasp-java-html-sanitizer -> owasp-java-html
  • Append the first 5 chars of a hash of the full original value
  • owasp-java-html-76661
  • Final branch name: update/owasp-java-html-76661-20240325.1 (39 chars because of hyphen deduplication)

All this said, just being able to change update/ to u/ would save plenty of characters and probably solve my issue, so maybe I'll start with an MR for that

@mzuehlke
Copy link
Member

That sounds reasonable.

@henricook henricook changed the title Request for comment: Feature to limit branch name length Feature to limit branch name length Apr 18, 2024
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

2 participants