Support Custom Environment URL Declaration via $GITLAB_ENV File
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Overview
Currently, GitLab only supports declaring custom environment URLs through dotenv reports, which automatically propagate variables to downstream jobs by default. This creates unnecessary overhead when the sole purpose is to store the custom environment URL in the environment itself, since the URL remains accessible via CI_ENVIRONMENT_URL
without requiring dotenv report propagation.
Description
Problem/Objective: Enable declaration of custom environment URLs through the newer $GITLAB_ENV
file mechanism as an alternative to dotenv reports, reducing unnecessary variable propagation overhead.
Context/Background:
- Currently, custom environment URLs can only be declared via dotenv reports
- Variables from dotenv reports are automatically propagated to jobs in later pipeline stages (unless explicitly disabled)
- This propagation is wasteful when the only goal is storing the custom environment URL in the environment
- The environment URL remains accessible through
CI_ENVIRONMENT_URL
variable for jobs accessing the environment - The
$GITLAB_ENV
file represents a newer, more targeted approach for environment-specific configurations
Proposed Solution:
- Extend the
$GITLAB_ENV
file functionality to support custom environment URL declarations - Maintain backward compatibility with existing dotenv report method
- Provide users with a choice between dotenv reports (with propagation) and
$GITLAB_ENV
file (without propagation) - Ensure
CI_ENVIRONMENT_URL
variable continues to work consistently regardless of declaration method
Edited by 🤖 GitLab Bot 🤖