Skip to content

Commit 98dac70

Browse files
nlabrietjan-kiszka
authored andcommitted
Allow branch override
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. Reviewed-by: Felix Moessbauer <[email protected]> Signed-off-by: Nicolas Labriet <[email protected]> Signed-off-by: Jan Kiszka <[email protected]>
1 parent f06c211 commit 98dac70

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

docs/format-changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,11 @@ Various keys for signature verification of repositories were added:
193193
- top level ``signers`` object to specify keys for signature verification
194194
- in repo definitions, ``signed`` and ``allowed_signers`` are added to
195195
specify whether a repo is signed and which data to use for verification.
196+
197+
Version 20
198+
----------
199+
200+
Added
201+
~~~~~
202+
203+
- The repo key ``branch`` can now be overridden, including to a null-value.

kas/repos.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ def factory(name, repo_config, repo_defaults, repo_fallback_path,
273273
'for local repositories.')
274274
if refspec is None:
275275
commit = repo_overrides.get('commit', commit)
276+
branch = repo_overrides.get('branch', branch)
276277
if commit and get_context().update:
277278
logging.warning(f'Update of "{name}" requested, but repo is '
278279
'pinned to a fixed commit. Not updating.')

kas/schema-kas.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{
2727
"type": "integer",
2828
"minimum": 1,
29-
"maximum": 19
29+
"maximum": 20
3030
}
3131
]
3232
},
@@ -118,6 +118,10 @@
118118
"type": "object",
119119
"additionalProperties": false,
120120
"properties": {
121+
"branch": {
122+
"description": "Branch in which to find the overridden commit, can be Null",
123+
"type": ["string", "null"]
124+
},
121125
"commit": {
122126
"type": "string"
123127
}

0 commit comments

Comments
 (0)