Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add namespace/profile keyname to each OASIS TOSCA Simple Profile in YAML file #110

Merged
merged 2 commits into from May 26, 2022

Conversation

philippemerle
Copy link
Contributor

No description provided.

@lauwers
Copy link
Contributor

lauwers commented May 26, 2022

I'm not sure we need the 'namespace' keyname in every file. What I had in mind was to just add it to the top-level 'profile.yaml' file.

@lauwers lauwers merged commit e85b347 into oasis-open:master May 26, 2022
@philippemerle
Copy link
Contributor Author

I'm not sure we need the 'namespace' keyname in every file. What I had in mind was to just add it to the top-level 'profile.yaml' file.

I considered that a namespace is attached to its owning TOSCA file and it is not transitively propagated to the files imported by this owning file. So each file should define its own namespace and if several files should have the same namespace then the same namespace should be assigned to all these files.

I think for profiles you should interpret imports like an include, i.e. copy the contain of the included file into the including file, then the namepace is propagated to definitions of the included file. But this seems not the wanted semantics for imports.

@tliron
Copy link
Contributor

tliron commented May 27, 2022

@philippemerle In my view this can't easily work in TOSCA. The issue is that a single "import" can actually import a tree of files, but we can only assign a single namespace prefix to that entire import. That, to me, implies that the import tree must all have the same namespace.

Now, we could potentially allow a namespace keyname in every file as long as it is the same namespace. To me this would seem like unnecessary duplication with room for error.

There's another thing: if you have a namespace in every file, it makes it harder to reuse that same file for multiple profiles. I actually have such a use case -- I have a file with a bunch of networking data types that I've reused in several profiles.

@tliron
Copy link
Contributor

tliron commented May 28, 2022

With more thought, here's how I think of it:

You could put in a namespace keyname in every file, but the semantics should be that if namespace is not specified in that file then it would "inherit" the namespace from the importing (source) file. That would allow for an import "tree" to easily use the namespace of the "root" of the tree, but at the time would allow files to create their own namespaces if it makes sense.

Since we agreed that namespace prefixes are prepended, this does mean that a single import could included "nested" namespaces, too.

@lauwers
Copy link
Contributor

lauwers commented Jun 9, 2022

My understanding is that namespaces are relevant only in the context of the importing TOSCA file (i.e. the importing TOSCA file defines the namespace into which another TOSCA file is imported). I'm not sure what it means for an imported TOSCA file to define a name for its own namespace, i.e. how would that name be used? My interpretation is that the namespace name in v1.3 is intended to be used like the profile name in v2.0--it defines a well-known name for the profile that allows "import by profile name".
Based on this interpretation, I recommend that we treat profile names (in v2.0) and namespace names (in 1.x) in the same way: only a top-level TOSCA file is allowed to define a profile name (or namespace name). If an imported TOSCA file defines its own profile name, that is considered an error (even if that imported file defines the same profile name as the importing file).

@lauwers
Copy link
Contributor

lauwers commented Jul 16, 2022

Based on the discussion in #120 I removed the namespace names and profile names from all the imported TOSCA files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants