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

improvement(core): fix missing action type err msg #6176

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

thsig
Copy link
Collaborator

@thsig thsig commented Jun 11, 2024

What this PR does / why we need it:

Before this fix, we'd erroneously list the available action kinds instead of the available action types (for the invalid action's kind).

Which issue(s) this PR fixes:

Fixes #5401.

Before this fix, we'd erroneously list the available action kinds
instead of the available action types (for the invalid action's kind).

Fixes #5401.
@thsig thsig requested a review from vvagaytsev June 11, 2024 12:18
Copy link
Member

@stefreak stefreak left a comment

Choose a reason for hiding this comment

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

Nice! ❤️
I do have two comments, but not a strictly required to fix before merging this.


const configPath = relative(garden.projectRoot, config.internal.configFilePath || config.internal.basePath)

if (!actionTypes[config.kind][config.type]) {
if (!actionTypes[kind][type]) {
const availableKinds: ActionKind[] = []
actionKinds.forEach((actionKind) => {
Copy link
Member

Choose a reason for hiding this comment

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

I'd find k as variable name slightly less confusion here, as it would be easier to distinguish from the new kind variable name in the top level

contains: [
"Unrecognized action type 'invalidtype'",
"Currently available 'Build' action types: 'container', 'exec', 'test'",
"Are you missing a provider configuration?",
Copy link
Member

Choose a reason for hiding this comment

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

There is not a good page in the docs that introduces the concept of providers. The closest would probably be https://docs.garden.io/reference/project-config … should we still help the user a little bit here and ask them to have a look at the docs?

Can we find the provider names that provide the referenced action type and list them as well?

@stefreak stefreak added this pull request to the merge queue Jun 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 17, 2024
@stefreak stefreak added this pull request to the merge queue Jun 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 17, 2024
@stefreak stefreak added this pull request to the merge queue Jun 18, 2024
Merged via the queue into main with commit f5c5514 Jun 18, 2024
40 checks passed
@stefreak stefreak deleted the fix-missing-action-type-error-msg branch June 18, 2024 09:28
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.

Unhelpful error message when provider configuration is missing
2 participants