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

Unable to modify default project settings through CLI and dashboard #1084

Open
chacha912 opened this issue Nov 27, 2024 · 6 comments
Open

Unable to modify default project settings through CLI and dashboard #1084

chacha912 opened this issue Nov 27, 2024 · 6 comments
Labels
bug 🐞 Something isn't working good first issue 🐤 Good for newcomers

Comments

@chacha912
Copy link
Contributor

What happened:

When trying to modify settings for the default project either through the CLI or dashboard, an error occurs.

image

What you expected to happen:

Users should be able to modify settings for the default project just like any other project.

How to reproduce it (as minimally and precisely as possible):

Try to update the default project settings using the CLI command:

bin/yorkie project update default --client-deactivate-threshold 12h 

The command fails with the following error:

Error: invalid_argument: Key: 'UpdatableProjectFields.Name' Error:Field validation for 'Name' failed on the 'reserved_project_name' tag

Anything else we need to know?:

Environment:

  • Operating system:
  • Browser and version:
  • Yorkie version (use yorkie version): 0.5.6
  • Yorkie JS SDK version:
@chacha912 chacha912 added the bug 🐞 Something isn't working label Nov 27, 2024
@hackerwins hackerwins added the good first issue 🐤 Good for newcomers label Dec 3, 2024
@window9u
Copy link
Contributor

@chacha912
Hello! I noticed that this operation causes an error because of the logic in this code, where reserved_project_name disallows project names set to default or new. This restriction even affects pre-set “default” projects during validation.

I’m curious why we explicitly prevent using default and new as project names. Could someone explain the context behind this rule and why it should remain?

To address this issue under the current policy, we might need to modify the error handling in admin_server.go#L213, and check one more if the --backend-use-default-project configuration flag is set to true.
image
image

From my personal perspective, maybe we should consider removing default and new from the reserved names. However, I’m unsure why this rule was originally created. Could you please provide more insight into its purpose and whether it’s essential to keep?

@devleejb
Copy link
Member

devleejb commented Dec 28, 2024

To my knowledge, the default project is created when the --backend-use-default-project flag is enabled. Additionally, if the project name is default, Yorkie can be accessed with an empty public key (""). (Code Pointer) This is why default is a reserved name.

Additionally, allowing default when --backend-use-default-project is disabled could cause confusion.

@window9u
Copy link
Contributor

@devleejb
Thank you for your explanation! I understood the context.

@devleejb
Copy link
Member

devleejb commented Dec 28, 2024

@window9u But, I'm not sure what the new name means...

FYI, the validation is added in #467.

@chacha912
Copy link
Contributor Author

Thank you @devleejb. As you mentioned, default is reserved because it's used for the system-generated default project when the --backend-use-default-project flag is enabled.
The new is reserved due to URL routing considerations in the dashboard. Since we use URLs in the format https://yorkie.dev/dashboard/projects/project-name, allowing a project named new would conflict with our URL pattern for creating new projects (https://yorkie.dev/dashboard/projects/new).
(We referred to project naming conventions from platforms like GitLab)

@window9u
Copy link
Contributor

Thank you for explaining the context in detail. I'll explore more refined ways to address this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working good first issue 🐤 Good for newcomers
Projects
Status: Backlog
Development

No branches or pull requests

4 participants