diff mbox series

[2/2] layers.schema.json: support 'uri', make this and 'remotes' mutually exclusive

Message ID 20251202160402.819060-2-corentin.guillevic@smile.fr
State New
Headers show
Series [1/2] bitbake-setup: add inline URI | expand

Commit Message

Corentin GUILLEVIC Dec. 2, 2025, 4:04 p.m. UTC
The property 'uri', which is a shortcut for 'remotes/origin/uri', is now
supported under 'git-remote'. However, this is mutually exclusive with 'remotes'.

Signed-off-by: Corentin Guillevic <corentin.guillevic@smile.fr>
---
 setup-schema/layers.schema.json | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

Comments

Alexander Kanavin Dec. 2, 2025, 4:13 p.m. UTC | #1
On Tue, 2 Dec 2025 at 17:04, Corentin Guillevic via
lists.openembedded.org
<corentin.guillevic=smile.fr@lists.openembedded.org> wrote:
 -                                }
> +                                },
> +                                "oneOf": [
> +                                    {
> +                                        "required": [
> +                                            "uri"
> +                                        ]
> +                                    },
> +                                    {
> +                                        "required": [
> +                                            "remotes"
> +                                        ]
> +                                    }
> +                                ]

I don't think it needs to be mutually exclusive. If both uri and
remotes are present that's not an invalid combination.

Alex.
Yoann Congal Dec. 2, 2025, 5:53 p.m. UTC | #2
Le mar. 2 déc. 2025 à 17:13, Alexander Kanavin via lists.openembedded.org
<alex.kanavin=gmail.com@lists.openembedded.org> a écrit :

> On Tue, 2 Dec 2025 at 17:04, Corentin Guillevic via
> lists.openembedded.org
> <corentin.guillevic=smile.fr@lists.openembedded.org> wrote:
>  -                                }
> > +                                },
> > +                                "oneOf": [
> > +                                    {
> > +                                        "required": [
> > +                                            "uri"
> > +                                        ]
> > +                                    },
> > +                                    {
> > +                                        "required": [
> > +                                            "remotes"
> > +                                        ]
> > +                                    }
> > +                                ]
>
> I don't think it needs to be mutually exclusive. If both uri and
> remotes are present that's not an invalid combination.
>

That was to avoid weird behavior on "origin" being defined twice: once in
"uri" and once in remotes/origin.
How do you suggest to handle this case, throw an error?


>
> Alex.
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#18510):
> https://lists.openembedded.org/g/bitbake-devel/message/18510
> Mute This Topic: https://lists.openembedded.org/mt/116578607/4316185
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [
> yoann.congal@smile.fr]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Alexander Kanavin Dec. 2, 2025, 6:27 p.m. UTC | #3
On Tue, 2 Dec 2025 at 18:53, Yoann Congal <yoann.congal@smile.fr> wrote:

> That was to avoid weird behavior on "origin" being defined twice: once in "uri" and once in remotes/origin.
> How do you suggest to handle this case, throw an error?

If a config defines the same fetch uri twice, regardless of which
syntax is used, that's a mistake in the config. Not the reason to make
the two ways mutually exclusive.

Or did I misunderstand you? Can you show an example?

Alex
diff mbox series

Patch

diff --git a/setup-schema/layers.schema.json b/setup-schema/layers.schema.json
index 144ea6d9f..68befa08a 100644
--- a/setup-schema/layers.schema.json
+++ b/setup-schema/layers.schema.json
@@ -46,8 +46,12 @@ 
                                         "description": "The output of 'git describe' (human readable description of the revision using tags in revision history).",
                                         "type": "string"
                                     },
+                                    "uri": {
+                                        "description": "The URI for the remote 'origin'. Mutually exclusive with 'remotes'",
+                                        "type": "string"
+                                    },
                                     "remotes": {
-                                        "description": "The dict of git remotes to add to this repository",
+                                        "description": "The dict of git remotes to add to this repository. Mutually exclusive with 'uri'",
                                         "type": "object",
                                         "patternProperties": { ".*" : {
                                             "description": "A git remote",
@@ -64,7 +68,19 @@ 
                                             }
                                         }}
                                     }
-                                }
+                                },
+                                "oneOf": [
+                                    {
+                                        "required": [
+                                            "uri"
+                                        ]
+                                    },
+                                    {
+                                        "required": [
+                                            "remotes"
+                                        ]
+                                    }
+                                ]
                     }
                 }
             }