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

Implement ferretdb --setup flags #4243

Open
1 of 3 tasks
AlekSi opened this issue Apr 17, 2024 · 0 comments · Fixed by #4247 · May be fixed by #4248 or #4250
Open
1 of 3 tasks

Implement ferretdb --setup flags #4243

AlekSi opened this issue Apr 17, 2024 · 0 comments · Fixed by #4247 · May be fixed by #4248 or #4250
Assignees
Labels
code/chore Code maintenance improvements
Milestone

Comments

@AlekSi
Copy link
Member

AlekSi commented Apr 17, 2024

What should be done?

ferretdb --test-enable-new-auth --setup-timeout=1m --setup-username=user --setup-password=pass ...

When --setup-username flag is passed, FerretDB should create the specified user with the given password (that may be empty). It should not be an error if a user with that name already exists. It should do so without starting the handler but by using backends directly. It should try to establish a working backend connection up --setup-timeout.

test-enable-new-auth's value must be true.

Let's split the implementation into multiple PRs to make reviews easier and faster:

  • Implement dummy flags that only check that --test-enable-new-auth is true when --setup-username is non-empty.
  • Extract user creation logic into a separate function in the internal/backends package. It should accept a backend, username, and password. Use that function in the createUser command handler.
  • Use that function in the CLI implementation. Implement retries by using Backend.Status method and ctxutil.SleepWithJitter function.

Testing should be done manually.

Where?

Definition of Done

  • handler updated;
  • spot refactorings done.
@AlekSi AlekSi added code/chore Code maintenance improvements not ready Issues that are not ready to be worked on; PRs that should skip CI labels Apr 17, 2024
@AlekSi AlekSi changed the title Implement ferretdb setup CLI Implement ferretdb --setup CLI Apr 17, 2024
@AlekSi AlekSi changed the title Implement ferretdb --setup CLI Implement ferretdb --setup flags Apr 17, 2024
@AlekSi AlekSi assigned b1ron and unassigned ferretdb-bot Apr 17, 2024
@AlekSi AlekSi removed the not ready Issues that are not ready to be worked on; PRs that should skip CI label Apr 17, 2024
@rumyantseva rumyantseva reopened this Apr 19, 2024
@b1ron b1ron linked a pull request Apr 19, 2024 that will close this issue
9 tasks
@AlekSi AlekSi added this to the v1.22.0 milestone Apr 22, 2024
@AlekSi AlekSi self-assigned this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
Status: In progress
4 participants