Skip to content
Snippets Groups Projects

Add some hardcoded mapping to deduce the right target branch for a project

Merged Marco Clemencic requested to merge hardcode-special-cases into main
1 file
+ 13
1
Compare changes
  • Side-by-side
  • Inline
@@ -822,13 +822,25 @@ def update_references(
gitlab_br_name, gitlab_title = make_gitlab_mr_branch_name_and_title(mr_slot_meta)
gitlab_title = f"{gitlab_title} based on {slot_name}/{latest_mr_slot_id}"
# FIXME: temporary hack to address https://gitlab.cern.ch/lhcb-rta/reference-update-bot/-/issues/20
# while waiting for a proper fix
def target_branch_for_project_in_slot(project: str, slot: str) -> str:
# I could use args.target, but the actual logic should deduce the
# branch from the slot
branch = slot.replace("lhcb-", "").replace("-mr", "")
if branch == "2024-patches" and project in ("Boole", "Online"):
branch = "master"
elif branch == "sim10":
branch = "Sim10" if project == "Gauss" else "sim10-patches"
return branch
projects_to_push = [
create_ref_update_commit(
projects_base_commits[proj],
slot_name,
latest_mr_slot_id,
proj,
args.target,
target_branch_for_project_in_slot(proj, slot_name),
plats_to_pull_refs,
refs_to_update,
new_refs,
Loading