Skip to content

Conversation

@blva
Copy link
Collaborator

@blva blva commented Aug 8, 2025

Proposed changes

Jira ticket: CLOUDP-329800

  • calls logout when calling config delete
  • marks config deprecated
  • updates e2e tests with the new prompt
  • adds noAuth as authMechanism to identify unauthenticated users (manually setup profiles)

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 test/README.md (if an e2e test has been added)
  • I have run make fmt and formatted my code

Further comments

@blva blva marked this pull request as ready for review August 8, 2025 13:49
@blva blva requested review from a team as code owners August 8, 2025 13:49
@github-actions github-actions bot added the need-doc-review Improvements or additions to documentation, will be reviewed by the docs team label Aug 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2025

APIx Bot :bowtie:: a message has been sent to Docs Slack channel 🚀.

Copy link
Contributor

@jwilliams-mongo jwilliams-mongo left a comment

Choose a reason for hiding this comment

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

left a suggestion for keeping the page around for a while for the deprecated command, but LGTM otherwise

Aliases: []string{"rm"},
Short: "Delete a profile.",
Args: require.ExactArgs(1),
Deprecated: "Please use the 'atlas auth logout' command instead.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: if the page is deleted, will users actually see this deprecation message? perhaps it is displayed in help output? Usually when we deprecate features we keep the page around for a while but add a banner so users get advance guidance on how they need to adjust their workflows accordingly.

My recommendation would be to keep this page and we can add a banner on our end to give users a heads-up. What are your thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey @jwilliams-mongo , yes the deprecation warning would show up on call and on help.

Unfortunately, the removal is inherited from the cobra framework, I'll check if they have any way to override it but if they don't it might not be worth the effort to keep the page.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah if it's too much effort I'm fine with moving forward with the removal

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I checked it and it seems that the removal happens at cobra level. I'll chat w/ the team to see if we can find a workaround, but meanwhile I think we'll keep it this way

return err
}
// Execute: atlas auth logout --profile <profile-name> --force
cmd := exec.Command(executable, "auth", "logout", "--profile", opts.Entry, "--force")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why --force?
Both commands prompt for confirmation. I think --force should only be passed if the user has set the flag

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm keeping the config prompt, so to avoid two prompts I'm using force in the logout one, but I could remove the prompt from config and use logout, no strong opinion

Copy link
Collaborator

Choose a reason for hiding this comment

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

Aha makes sense. No preference either on which command prompts. Thanks for explanation!

Copy link
Collaborator

Choose a reason for hiding this comment

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

let's remove prompt and blindly use the logout one, in case we want to update prompts we just update one command

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll address this in a follow up PR

// Configuration needs to be deleted from toml, as viper doesn't support this yet.
// FIXME :: change when https://github.com/spf13/viper/pull/519 is merged.
settings := viper.AllSettings()
settings := s.viper.AllSettings()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

bugfix - without this, we were deleting the whole profile on logout

Copy link
Collaborator

@cveticm cveticm left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@blva blva merged commit a18f6f5 into SA_refactor_feature_branch Aug 11, 2025
23 checks passed
@blva blva deleted the CLOUDP-329800-alias branch August 11, 2025 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need-doc-review Improvements or additions to documentation, will be reviewed by the docs team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants