Skip to content

feat(build): Add CI_BUILD_NETWORK_NAME as variable

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you can request access to GitLab Duo.

What does this MR do?

  • Add CI_BUILD_NETWORK_NAME as build variable for easily accessing network name with feature flag FF_NETWORK_PER_BUILD
  • Only use the shorten variant of project unique name for also container/cache/... (consistency)

Why was this MR needed?

  • Missing easy way to get network name with FF_NETWORK_PER_BUILD enabled
  • Inconsistent naming of container, volumes, ...

Breaking changes

In !4830 (merged) @ajwalker mentioned that we cannot simply change the unique project name globally, because its also used for container & volume/cache names. But in my opinion this does not lead to any breakings, because container names are just temporary (once running) & so the cache (no permanent storage). For me it's fine, "refreshing/rebuilding" the cache after a major runner update (cache is not a persistent storage). Also if someone leads on the old project unique name inside job, there's a variable now (CI_CONCURRENT_PROJECT_UNIQUE_NAME), so easy to fix. Needs just documentation in changelog/blog/somewhereElse.

What's the best way to test this MR?

Good question...

What are the relevant issue numbers?

  • #26718: FF_NETWORK_PER_BUILD: provide the build network name as an environment variable
  • !4830 (merged): Shorten network names created by FF_NETWORK_PER_BUILD
Edited by Ninos Ego

Merge request reports

Loading