Provide proper CI variables for topic branches (may solve plenty of environment:url issues)
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Proposal
This proposal presents the inclusion of
topic branchesrelated predefined variables.
Considering that:
-
feature/cool-stuff,hotfix/its-broken,docs/improve-readmeare examples of widely usedtopic branchesnaming conventions. -
environment:urlcan only be set based on predefined variables. -
review/foois widely used within Auto DevOps. - Grouping of environments is encouraged throughout GitLab documentation.
This proposal presents the inclusion of topic branches related predefined variables, using the slash denominator as grouping:
| CI_COMMIT_REF_NAME | CI_COMMIT_REF_SLUG | CI_COMMIT_TOPIC_GROUP | CI_COMMIT_TOPIC_NAME |
|---|---|---|---|
| feature/cool-stuff | feature-cool-stuff | feature | cool-stuff |
| hotifix/its-broken | hotfix-its-broken | hotfix | its-broken |
| release/v12 | release-v12 | release | v12 |
That would make it possible for some cool naming on environments:
if using environment:url as https://${CI_COMMIT_TOPIC_NAME}.${CI_COMMIT_TOPIC_GROUP}.example.com
| CI_COMMIT_REF_NAME | CI_COMMIT_TOPIC_GROUP | CI_COMMIT_TOPIC_NAME | environment:url |
|---|---|---|---|
| feature/cool-stuff | feature | cool-stuff | https://cool-stuff.feature.example.com |
| hotifix/its-broken | hotfix | its-broken | https://its-broken.hotfix.example.com |
| release/v12 | release | v12 | https://v12.release.example.com |
Also, environment:name set as ${CI_COMMIT_TOPIC_GROUP}/${CI_COMMIT_TOPIC_NAME} would provide:
| CI_COMMIT_REF_NAME | CI_COMMIT_TOPIC_GROUP | CI_COMMIT_TOPIC_NAME | environment:name |
|---|---|---|---|
| feature/cool-stuff | feature | cool-stuff | feature/cool-stuff |
| hotfix/its-broken | hotfix | its-broken | hotfix/its-broken |
| release/v12 | release | v12 | release/v12 |
Or grouping as review/${CI_COMMIT_TOPIC_NAME}:
| CI_COMMIT_REF_NAME | review/${CI_COMMIT_TOPIC_NAME} | {CI_COMMIT_TOPIC_GROUP}/{CI_COMMIT_TOPIC_NAME} |
|---|---|---|
| feature/cool-stuff | review/cool-stuff |
feature/cool-stuff |
| hotfix/its-broken | review/its-broken |
hotfix/its-broken |
Edited by 🤖 GitLab Bot 🤖