Skip to content
Snippets Groups Projects
Commit e943a55e authored by Tim Jaacks's avatar Tim Jaacks
Browse files

Use project path instead of name in integration branch name

Usually project name and path are identical after project creation. It
is possible, though, to change the name of a project without changing
its path.
When triggering a pipeline on the integration branch, we are using the
CI_PROJECT_NAME variable to reference the project. Unexpectedly, this
variable contains the *path*, not the *name* of the project (see
https://gitlab.com/gitlab-org/gitlab/-/issues/20030).
Hence we have to use the project path in all other places where the
integration branch name is constructed in our Python code.
parent bd7025b8
No related branches found
No related tags found
1 merge request!255Use project path instead of name in integration branch name
Pipeline #57290 passed with stage
in 25 minutes and 26 seconds
......@@ -55,6 +55,9 @@ build:
- if: $CI_MERGE_REQUEST_IID
trigger:
project: $TARGET_PROJECT
# Attention: CI_PROJECT_NAME contains the *path*, not the *name* of the project.
# Usually these are equal, but it is possible to change the name of a project
# without changing its path. See https://gitlab.com/gitlab-org/gitlab/-/issues/20030
branch: "integrate/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}/into/${TARGET_BRANCH}"
strategy: depend
......
......@@ -106,7 +106,7 @@ def main():
)
integration_branch_name = common.integration_branch_name(
source_project.name, merge_request.source_branch, args.target_branch
source_project.path, merge_request.source_branch, args.target_branch
)
if check_if_integration_branch_is_up_to_date(
......
......@@ -122,7 +122,7 @@ def integrate_into_manifest(
else:
# Create integration branch (delete former one if already exists)
integration_branch = common.integration_branch_name(
project.name, merge_request.source_branch, manifest_branch
project.path, merge_request.source_branch, manifest_branch
)
for ref in manifest_repo.references:
if integration_branch == ref.name:
......
......@@ -56,7 +56,7 @@ def merge_into_manifest(
target_branch = manifest_branch
integration_branch = common.integration_branch_name(
project.name, original_branch, target_branch
project.path, original_branch, target_branch
)
# Create merge request. If there already is a merge request, we assume that it has
......
......@@ -252,7 +252,7 @@ def update_submodule_and_include_ref(
# Construct integration branch name
integration_branch_name = common.integration_branch_name(
submodule_project.name, integration_branch_suffix, branch
submodule_project.path, integration_branch_suffix, branch
)
# Construct commit message
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment