Ticket #873 (new)

Opened 8 years ago

Last modified 3 years ago

Make node names unique per project

Reported by: mitar Owned by: kostko
Priority: normal Milestone: 3.0b
Component: nodewatcher/core Version:
Keywords: Cc:
Related nodes: Realization state:
Blocking: Effort: normal
Blocked by: Security sensitive: no


Make node names unique per project and not globally. (So each project should have also unique DNS zone?)

Change History

comment:1 Changed 4 years ago by mitar

Kostko in commented:

Currently, in v3, we don't require node names to be unique. In #873 we discussed the idea that node names should be unique "per project". This can be achieved in the projects module by performing an additional validation step, ensuring name uniqueness only inside a project.

Node names are also used for nicer URLs (instead of UUIDs). If node names are not unique, then such resolution will not be possible for non-unique node names.

This is how it was before. We can generate slugs in any way we want. One option is to generate it from name, and if it is not unique, we add some counter at the end. So slug is then not the same as node name.

So the question is why should node name even exist (we can have it as a module, for people) and should be regex for it.

So I think generation of slugs is one. Then we have a name. And location. And projects. And question is how we want this to be related. And what should be coded and what should be configurable.

comment:2 Changed 4 years ago by kostko

So the question is why should node name even exist (we can have it as a module, for people) and should be regex for it.

Node name is currently part of the core schema and I think that this should stay as it is the most natural way of identifying nodes. It is also used to generate a node's hostname when the generator is enabled.

Uniqueness is currently not enforced at all, but there currently is a regexp that validates node names (it uses the same regexp as in v2):

comment:3 Changed 4 years ago by mitar

I think we are overloading things here. So one thing is how we create hostname and URL slugs, another is what is name. We can try and make this the same, but then we also have to provide uniqueness, because one never knows how it will be used. For example, if we do not provide uniqueness, then for hostnames and slugs we will have to append some counter or something to assure unique resolving, so name will not be the same as hostname and slug anymore. Which is OK. But if we are doing that, then we can also simply generate slugs from general strings.

On the other hand, if we make hostnames and slugs globally unique, then people will add prefixes of their projects to names, which is duplication of information. But maybe that is OK anyway? So maybe names should be seen as "human readable identifier", while UUID is "computer readable identifier". And is OK that it is globally unique, both of them.

comment:4 Changed 4 years ago by mitar

Maybe we could allow in names ., so we could have name.project or something for names. :-)

comment:5 Changed 3 years ago by mitar

So I think we are currently leaning towards having URL slugs generated from names. And maybe for hostname it could just be automatically generated slug unique per project, but users can also change the hostname if they want to something else.

Note: See TracTickets for help on using tickets.