[PATCH] Allow branch override

1 view
Skip to first unread message

Jan Kiszka

unread,
Sep 4, 2025, 5:09:42 AM (4 days ago) Sep 4
to kas-...@googlegroups.com, Nicolas Labriet, Felix Moessbauer
From: Nicolas Labriet <nlab...@centralp.fr>

Since eb4d112 when commit and branch are specified, kas checks if the
commit is actually contained in the branch.
This makes it impossible to have a branch set for a repo but use a
commit override to build a merge request on this repo (obviously not
yet on the specified branch).

This change allows the branch property of repos to be overridden to a
specific value, or even to Null.

Signed-off-by: Nicolas Labriet <nlab...@centralp.fr>
---

Forwarded from https://github.com/siemens/kas/pull/167

kas/repos.py | 1 +
kas/schema-kas.json | 4 ++++
2 files changed, 5 insertions(+)

diff --git a/kas/repos.py b/kas/repos.py
index f8151638..187f9430 100644
--- a/kas/repos.py
+++ b/kas/repos.py
@@ -273,6 +273,7 @@ def factory(name, repo_config, repo_defaults, repo_fallback_path,
'for local repositories.')
if refspec is None:
commit = repo_overrides.get('commit', commit)
+ branch = repo_overrides.get('branch', branch)
if commit and get_context().update:
logging.warning(f'Update of "{name}" requested, but repo is '
'pinned to a fixed commit. Not updating.')
diff --git a/kas/schema-kas.json b/kas/schema-kas.json
index e1bff6d0..17471102 100644
--- a/kas/schema-kas.json
+++ b/kas/schema-kas.json
@@ -118,6 +118,10 @@
"type": "object",
"additionalProperties": false,
"properties": {
+ "branch": {
+ "description": "Branch in which to find the overridden commit, can be Null",
+ "type": ["string", "null"]
+ },
"commit": {
"type": "string"
}
Reply all
Reply to author
Forward
0 new messages