Skip to content

Conversation

@blva
Copy link
Collaborator

@blva blva commented May 30, 2022

Proposed changes

Jira ticket: CLOUDP-123993

➜  mongocli git:(CLOUDP-123993) ✗ atlas setup

This command will help you
1. Create and verify your MongoDB Atlas account in your browser.
2. Return to the terminal to create your first free MongoDB database in Atlas.

To verify your account, copy your one-time verification code:
B3FD-QDFM

Paste the code in the browser when prompted to activate your Atlas CLI. Your code will expire after 10 minutes.

To continue, go to https://account.mongodb.com/account/register/cli?n=/account/connect&nRegister=/account/connect
Successfully logged in as happiestdeveloper@gmail.com.

[Default Settings]
Cluster Name:                           Cluster06797
Cloud Provider and Region:              AWS - US_EAST_1
Database User Username:                 Cluster06797
Load sample data:                       Yes
Allow connections from (IP Address):    37.228.237.17
? Do you want to set up your first free database in Atlas with default settings (it's free forever)? (Y/n) 
➜  mongocli git:(CLOUDP-123993) atlas setup

This command will help you
1. Create and verify your MongoDB Atlas account in your browser.
2. Return to the terminal to create your first free MongoDB database in Atlas.

To verify your account, copy your one-time verification code:
YBRG-773D

Paste the code in the browser when prompted to activate your Atlas CLI. Your code will expire after 10 minutes.

To continue, go to https://account.mongodb.com/account/register/cli?n=/account/connect&nRegister=/account/connect
Successfully logged in as bibialisle@gmail.com.

You have multiple organizations or projects, select one to proceed.
? Choose a default organization: mongodb (62320755cf41c80af9433725)

Your profile is now configured.
You can use [atlas config set] to change these settings at a later time.

Closes #[issue number]

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation in document requirements section listed in CONTRIBUTING.md (if appropriate)
  • I have addressed the @mongodb/docs-cloud-team comments (if appropriate)
  • I have updated e2e/E2E-TESTS.md (if an e2e test has been added)
  • I have run make fmt and formatted my code

Further comments

@blva blva force-pushed the CLOUDP-123993 branch from 596e96a to c966bb3 Compare May 30, 2022 10:48
@blva blva force-pushed the CLOUDP-123993 branch from c966bb3 to 4aa7672 Compare May 30, 2022 11:06
@blva blva marked this pull request as ready for review May 30, 2022 12:14
@blva blva requested a review from a team May 30, 2022 12:14
Store ProjectOrgsLister
OutWriter io.Writer
AskedOrgsOrProjects bool
AskOrgsAndProjectsText string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[optional]
AskOrgsAndProjectsText to control the flow (not only as a label) which is a bit confusing.
What do you think about this alternative:

  • instead of AskOrgsAndProjectsText have a field OnMultipleOrgsOrProjects func () void
  • set this field in in login.go (instead of setting opts.AskOrgsAndProjectsText) with the content from displayInitialSelectText()
  • in AskOrg / AskProject instead of calling opts.displayInitialSelectText(), call opts.OnMultipleOrgsOrProjects() (if it's not nil)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that seems like a better extensible approach! Thank you

@blva blva requested a review from ciprian-tibulca May 30, 2022 17:07
@blva blva requested a review from ciprian-tibulca May 31, 2022 08:39
@blva blva merged commit e62755d into master May 31, 2022
@blva blva deleted the CLOUDP-123993 branch May 31, 2022 09:04
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.

3 participants