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

default sandbox confirmation prompt #904

Merged
merged 2 commits into from
Aug 3, 2023
Merged

Conversation

camden11
Copy link
Contributor

Description and Context

See https://git.hubteam.com/HubSpot/hubspot-cli-issues/issues/431

This adds a prompt for users to confirm using their default account for local dev when their default account is a sandbox. Previously, having a sandbox as your default account would skip the account prompt entirely.

Screenshots

Screenshot 2023-07-31 at 4 17 10 PM

Who to Notify

@brandenrodgers @kemmerle @markhazlewood

@brandenrodgers
Copy link
Contributor

This looks great. I think we can actually exit the process if they choose "no" here (maybe we could add some message to explain why we need to exit, similar to this one). The follow-up prompt is intended to be used when the default CLI account is a prod one.

@camden11
Copy link
Contributor Author

camden11 commented Aug 1, 2023

Ah gotcha ok. I can make that change, though IMO bringing up the prompt does seem helpful if they want to switch to a different sandbox or make a new one. Just seems like if someone ran the command they probably want to develop on one of their accounts. Is the preference always that they change the default account in these cases?

@brandenrodgers
Copy link
Contributor

bringing up the prompt does seem helpful if they want to switch to a different sandbox or make a new one. Just seems like if someone ran the command they probably want to develop on one of their accounts. Is the preference always that they change the default account in these cases?

The main issue here is just that it's not possible to generate a sandbox account from another sandbox account. Creating a new sandbox requires you to have a prod account selected as the current default account. You make a request to the prod account to generate a sandbox account from that prod account. So it's not possible for us to create a new sandbox account if a sandbox account is currently selected as the default account.

So that's why it might be easier for us to exit the process here and maybe tell the user to switch accounts

@camden11
Copy link
Contributor Author

camden11 commented Aug 2, 2023

@brandenrodgers Updated! Will now exit if you decline to use the sandbox

Screenshot 2023-08-02 at 5 11 59 PM

Copy link
Contributor

@brandenrodgers brandenrodgers left a comment

Choose a reason for hiding this comment

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

Looks like the tests are failing, but I'm not sure why. Maybe try just re-running them? Code looks good though 👌

@camden11 camden11 merged commit 46b33a1 into master Aug 3, 2023
1 check passed
@camden11 camden11 deleted the confirm-default-sandbox branch August 3, 2023 14:33
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.

2 participants