Skip to content

Commit

Permalink
add override to remove default tag or branch
Browse files Browse the repository at this point in the history
Currently there is no way to remove a default branch / tag value for a
single repository. This makes it impossible to add a repository by
referencing a commit that is not on a branch (hence the branch key
cannot be set).

We fix this by also allowing the nulltype value null as valid values for
both branch and tag. This change is fully backward compatible as the
value was not allowed before and also does not change semantics.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
fmoessbauer authored and jan-kiszka committed Nov 4, 2024
1 parent f4ceea7 commit c1fbbdc
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
10 changes: 10 additions & 0 deletions docs/format-changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,13 @@ Added
~~~~~

- The key ``artifacts`` is introduced to describe expected build artifacts.

Version 18
----------

Added
~~~~~

The repo keys ``tag`` and ``branch`` can now be set to ``null`` to remove
these properties from the repo. This is needed in case a default value is
set in the ``defaults`` section that should not apply to a repo.
8 changes: 5 additions & 3 deletions docs/userguide/project-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,17 @@ Configuration reference
``commit``, ``branch`` or ``tag``, the revision you get depends on the
defaults of the version control system used.

``branch``: string [optional]
``branch``: string or nothing (``null``) [optional]
The upstream branch that should be tracked. If ``commit`` was
specified, kas checks that the branch contains the commit. If no
``commit`` was specified, the head of the upstream branch is checked out.
The nothing (``null``) value is used to remove a possible default value.

``tag``: string [optional]
``tag``: string or nothing (``null``) [optional]
The tag that should be checked out. If a ``commit`` was specified, kas
checks that the tag points to this commit. This must not be combined
with ``branch``.
with ``branch``. The nothing (``null``) value is used to remove a
possible default value.

``path``: string [optional]
The path where the repository is stored.
Expand Down
2 changes: 1 addition & 1 deletion kas/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
__version__ = '4.5'

# Please update docs/format-changelog.rst when changing the file version.
__file_version__ = 17
__file_version__ = 18
__compatible_file_version__ = 1
18 changes: 16 additions & 2 deletions kas/schema-kas.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,24 @@
"type": "string"
},
"branch": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"tag": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"refspec": {
"type": "string"
Expand Down

0 comments on commit c1fbbdc

Please # to comment.