litmuschaos / litmus

Litmus helps SREs and developers practice chaos engineering in a Cloud-native way. Chaos experiments are published at the ChaosHub (https://hub.litmuschaos.io). Community notes is at https://hackmd.io/a4Zu_sH4TZGeih-xCimi3Q
https://litmuschaos.io
Apache License 2.0
4.45k stars 698 forks source link

[Litmus 3.0]: The environment name and ID are the same. Is this intentional? #4143

Open namkyu1999 opened 1 year ago

namkyu1999 commented 1 year ago

Question

Screenshot 2023-08-28 at 12 55 37 PM

In Litmus 3.0, The environment name and ID are the same.

Updating the environment name does not change the environment ID. This can cause problems when users try to create a new environment with the old name. Is there a reason to use environment names instead of UUIDs in env id?

Saranya-jena commented 1 year ago

Hi @namkyu1999 what is the input you tried to give for environment name? currently we are moving towards human readable IDs

namkyu1999 commented 1 year ago

Hi @Saranya-jena , If user enters an environment id that already exists, it would be nice to have a popup that says "This id already exists". Currently, we can only see the error log in the console window without any further action.

Also, since we already have a human-readable name for each environment, is there any reason why the id should also be human readable? This is just a question.

Screenshot 2023-08-31 at 1 58 28 AM

Screenshot 2023-08-31 at 2 00 09 AM

smitthakkar96 commented 9 months ago

@namkyu1999 @Saranya-jena, Can we adjust the unique constraint for environmentID. Instead of enforcing global uniqueness, could we consider making it unique per project? MongoDB offers support for unique indexes spanning multiple columns, as detailed here: https://www.mongodb.com/docs/manual/core/index-unique/. Beyond database constraints, I'm wondering if any logic adjustments are necessary to accommodate this change?

Purely from a UX perspective, the current setup might lead to confusion when users attempt to create environments and encounter errors due to conflicting IDs, especially if they're unaware of other projects (they might not have access to all projects).

Let me know your thoughts

smitthakkar96 commented 9 months ago

I believe the same thing can apply to probes https://github.com/litmuschaos/litmus/blob/master/chaoscenter/graphql/server/pkg/database/mongodb/init.go#L277-L283.

SarthakJain26 commented 9 months ago

Sounds to be a good suggestion @smitthakkar96 , will make the resources unique across projects. Please let us know if you would like to contribute to this.