Configurable Naming for Gearset-Generated Branches (Promotion, Bundle & Release)
I'm asking that we let a pipeline set the format of the branches Gearset creates, starting with promotion branches. Today these are always in the following format:
gs-pipeline/<feature>_-_<env>
We'd like to use a different format:
gearset/<env>/<feature>
Generally speaking we would like to set the prefix, the order of the parts, and the separator from a template, the same way the feature branch format can already be set from tickets with [id] and [story_name].
The general problem can be summarized as follows:
- Branch lists are hard to scan. With the feature first and the environment last, branches sort by feature. Our repo has hundreds of promotion branches. Answering "what's waiting to go into X environment?" means reading the end of every branch name. Putting the environment first groups them, and with / between the parts, Bitbucket, Git clients and
git branch --list 'gearset/<env>/*'can filter or show them as folders. _-_is hard to work with. It isn't a Git path separator, so tools can't split on it, and shell globs and branch rules need awkward patterns. Teams also have to avoid using_-_in their own branch names.- Inconsistent capitalization breaks on case-insensitive filesystems. When feature branches differ only in case (
Feature/…vsfeature/…), the generatedgs-pipeline/Feature/…andgs-pipeline/feature/…refs collide on macOS and Windows.git fetchthen fails with "cannot lock ref" errors. An option to lowercase generated names would prevent this. - Teams can't fit Gearset's branches into their own branch standards. We name our own branches by a written standard and apply branch permissions and cleanup rules by prefix. Gearset's branches are the only ones in the repo we can't bring into that scheme.
Our proposed solution involves the following:
- A pipeline-level setting, "Generated branch format", with placeholders for promotion branches such as
[prefix],[env]and[feature]. Default:gs-pipeline/[feature]_-_[env], so existing pipelines don't change. - A configurable prefix for every branch type Gearset creates, not only promotion branches:
gs-bundle/,gs-bundle-base/,gs-bundle-feature/,gs-gitflow-*,gs-project/, andgs-sandbox/. One root (for examplegearset/), would put every Gearset branch under one prefix for branch permissions and cleanup. - An optional "lowercase generated branch names" toggle.
- A live preview in the settings, as the feature branch format already has.
I would suggest the following to address compatibility concerns:
- Recognizing branches. If Gearset currently finds promotion branches by name, a configured format would need to be stored per pipeline, or the branch-to-(feature, environment) mapping tracked in Gearset's own records, so detection doesn't depend on a hard-coded pattern.
- Changing the format on an existing pipeline. It should apply only to new promotions, or offer a one-time migration that renames open promotion branches and retargets their PRs, with a warning about webhooks, branch rules and CODEOWNERS that check branch names.
- Name collisions. Git can't hold both
gearset/sitandgearset/sit/<feature>, so Gearset should reject a format where a generated name could clash with an environment branch, or with another generated name, by being a path prefix of it. - Length. Say how long feature names are shortened, if they are, so the result is predictable whatever the format.
An Example Use Case From Our Pipeline
Environment branches are development, qa-testing, user-acceptance-testing, and main. A feature feature/PS-1234-add-field promoted to qa-testing would get:
- Today:
gs-pipeline/feature/PS-1234-add-field_-_qa-testing - Requested:
gearset/qa-testing/feature/PS-1234-add-field