From 5ecef9f91934d117c476e9da3f8ad76fd51097ae Mon Sep 17 00:00:00 2001 From: Harald Seiler Date: Wed, 6 Apr 2022 12:16:38 +0200 Subject: [PATCH] Allow "deleting" url/path of repo in override Make "null" an allowed type for the `url` and `path` properties of a repository. This allows "deleting" them in an override kas-file to e.g. point a repository at a local directory instead of a git remote: "Original" file: repos: meta-foo: url: https://example.org/foo.git refspec: badc0ffee Override: repos: meta-foo: url: path: /path/to/local/foo Without the explicit "nulling" of the URL, kas would start messing with the repo in /path/to/local/foo (changing remote URL, switching to a different rev, etc.). With this change, we can instead force kas to use the recipes in that directory untouched. Signed-off-by: Harald Seiler Signed-off-by: Jan Kiszka --- docs/format-changelog.rst | 10 ++++++++++ kas/__version__.py | 2 +- kas/schema-kas.json | 18 ++++++++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/docs/format-changelog.rst b/docs/format-changelog.rst index d1f3b90..c8a7218 100644 --- a/docs/format-changelog.rst +++ b/docs/format-changelog.rst @@ -111,3 +111,13 @@ Added - ``menu_configuration`` key stores the selections done via ``kas menu`` in a configuration file. It is only evaluated by that plugin. + +Version 12 +---------- + +Added +~~~~~ + +- For repositories, ``url`` and ``path`` can now be overridden with a + null-value to switch between version-controlled repositories and unversioned + local folders. diff --git a/kas/__version__.py b/kas/__version__.py index 63c3221..60bab95 100644 --- a/kas/__version__.py +++ b/kas/__version__.py @@ -28,5 +28,5 @@ __copyright__ = 'Copyright (c) Siemens AG, 2017-2020' __version__ = '3.0.2' # Please update docs/format-changelog.rst when changing the file version. -__file_version__ = 11 +__file_version__ = 12 __compatible_file_version__ = 1 diff --git a/kas/schema-kas.json b/kas/schema-kas.json index 60fa7dd..ca4b513 100644 --- a/kas/schema-kas.json +++ b/kas/schema-kas.json @@ -125,7 +125,14 @@ "type": "string" }, "url": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "type": { "type": "string" @@ -134,7 +141,14 @@ "type": "string" }, "path": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "layers": { "type": "object",