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

no local selection when docker is unavailable #662

Merged
merged 3 commits into from
Aug 15, 2022

Conversation

devinsag
Copy link
Contributor

@devinsag devinsag requested a review from TylerAldrich August 12, 2022 21:29
@@ -70,6 +84,7 @@ export default class AccountUtils {
}
} else {
inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt'));
const can_run_local: boolean = await this.shouldListLocalAccounts();
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to specify the type here because the function return specifies.

const can_run_local = await this.shouldListLocalAccounts();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed specified type from can_run_local

@@ -49,7 +63,7 @@ export default class AccountUtils {
const token_json = await app.auth.getPersistedTokenJSON();
if (!token_json || token_json.email === 'unknown') {
console.log(chalk.yellow('In order to access remote accounts you can login by running `architect login`'));
let account: Account;
await this.shouldListLocalAccounts(true);
Copy link
Member

Choose a reason for hiding this comment

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

What does the output look like in this case? Won't it be kind of weird to show a warning log and then hard error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed hard-error, and replaced with warning and then exit if neither local or remote accounts are available.

@@ -70,6 +84,7 @@ export default class AccountUtils {
}
} else {
inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt'));
const can_run_local = await this.shouldListLocalAccounts();
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not 100% sure if in this case we want to log a warning message to users. Example scenario here:
image

I think for the most part, if I don't have docker running, it's not that surprising to not have the local option and this warning message is just kind of superfluous. For a brand new user that maybe doesn't have docker running and would get confused, they probably don't have any remote accounts yet and would hit the hard-fail state above.

I'm leaning towards not logging anything if we're not hard-exiting, curious if anyone has thoughts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed log statements for when local is not available.

@tjhiggins tjhiggins merged commit e3bf33b into rc Aug 15, 2022
@tjhiggins tjhiggins deleted the 486-no-local-when-docker-is-not-running branch August 15, 2022 19:08
github-actions bot pushed a commit that referenced this pull request Aug 15, 2022
# [1.23.0-rc.1](v1.22.1-rc.6...v1.23.0-rc.1) (2022-08-15)

### Bug Fixes

* **exec:** no local selection when docker is unavailable ([#662](#662)) ([e3bf33b](e3bf33b))

### Features

* **link:** 473 list linked components ([#658](#658)) ([b40c347](b40c347))
github-actions bot pushed a commit that referenced this pull request Aug 15, 2022
# [1.23.0](v1.22.1...v1.23.0) (2022-08-15)

### Bug Fixes

* **cli:** Switch from postinstall to prepare ([ffac972](ffac972))
* **dev:** Don't show ping access logs unless they fail ([33dc9b4](33dc9b4))
* **dev:** Make `architect dev` more robust ([#661](#661)) ([eda1cff](eda1cff))
* **exec:** Fix issue with commands run in no-tty but with stdin available exiting prematurely due to stdin closing ([#656](#656)) ([06ef0df](06ef0df))
* **exec:** no local selection when docker is unavailable ([#662](#662)) ([e3bf33b](e3bf33b))
* **register:** Allow register without build ([#660](#660)) ([033f261](033f261))

### Features

* **link:** 473 list linked components ([#658](#658)) ([b40c347](b40c347))
@github-actions
Copy link

🎉 This PR is included in version 1.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants