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

0.13: utilize validation handler #3997

Merged
merged 4 commits into from
Mar 28, 2023
Merged

0.13: utilize validation handler #3997

merged 4 commits into from
Mar 28, 2023

Conversation

Orzelius
Copy link
Contributor

This will call call the validation handler in the action resolution process.

This doesn't fix the original issue that brought this to our attention as garden validate doesn't actually resolve actions.

Is that desirable? Should garden validate also resolve all static fields perhaps?

@Orzelius Orzelius requested review from edvald and Walther March 27, 2023 11:00
@Walther
Copy link
Contributor

Walther commented Mar 27, 2023

EDIT: unrelated, please ignore.

Original comment Ran a quick `cd examples; for example in $(ls -1); do pushd $example; echo $example; gdev13 validate; popd; done;` to see if all of our examples pass validation after these changes. Most of them pass fine! 🎉

There are a couple of validation failures:

  • argocd: Could not read cluster from kubeconfig for context gke_garden
  • demo-project-start: kubernetes: must specify deploymentRegistry in config
  • pulumi: Error validating project environments: value is required
  • terraform-gke: Error validating project environments: value is required

However, all of these failures also happen outside of this branch, so they are not new / caused by this extra validation ✅

Additionally, the argocd and demo-project-start examples most likely just require additional local configuration before running, so they might not be an issue at all.

This leaves just the pulumi and terraform-gke examples with validation failures. Here we need to note that those examples have not been converted to 0.13 syntax yet. This introduces the question: does our validation command require 0.13 syntax, and if it does, is that a feature or a bug? I know we plan to have runtime compatibility for 0.12 syntax configuration files in the 0.13 release, but does that extend to the validate command - should it too understand both formats, or should it encourage people towards the new one?

@Orzelius
Copy link
Contributor Author

@Walther Like the pr description says, as is, this pr does not change the behavior of the garden validate command.

@Walther
Copy link
Contributor

Walther commented Mar 27, 2023

sorry, my bad 🤦‍♂️ should have read the description more carefully. thanks for the clarification!

@thsig
Copy link
Collaborator

thsig commented Mar 28, 2023

Do you think this is safe to merge before the pre-release, @edvald?

I'm asking because we're adding a validation step here, which might result in new errors in certain places.

@edvald
Copy link
Collaborator

edvald commented Mar 28, 2023

Yes. Better to get those errors than something more cryptic/unexpected further down.

@@ -876,7 +876,7 @@ export class Garden {
const resolvedProviders = await this.resolveProviders(log)
const rawModuleConfigs = await this.getRawModuleConfigs()

const graphLog = log.makeNewLogContext({ section: "graph" }).info(`Resolving actions and modules...`)
const graphLog = log.makeNewLogContext({ section: "graph" }).info(`Reading actions and modules...`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like resolver.resolveAll() is called after this log message. Should we change the wording here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The old message can easily be restored while rebasing this on top of the 0.13 (there are some conflicts).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The modules are resolved, but not the actions as far as I understand.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, got it, thanks for the clarification :) Please rebase this and then we can merge 🚀

Copy link
Collaborator

Choose a reason for hiding this comment

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

The method's JSDoc says

Resolve the raw module and action configs and return a new instance of ConfigGraph.

So, should we just keep the unified terminology in all places? We use "resolving" for providers too.

Copy link
Collaborator

Choose a reason for hiding this comment

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

To me either word is fine, please rebase this PR on op of 0.13. Then we can merge it and start the pre-release process.

@Orzelius Orzelius merged commit 82e01cd into 0.13 Mar 28, 2023
@Orzelius Orzelius deleted the validation-handler branch March 28, 2023 13:43
Orzelius added a commit that referenced this pull request Mar 29, 2023
The failures were caused by #3997 as the container validation
handler actually modifies the deployment's ingress hostname
to the project default hostname if it's not specified on the deploy
itself.
Orzelius added a commit that referenced this pull request Mar 31, 2023
The failures were caused by #3997 as the container validation
handler actually modifies the deployment's ingress hostname
to the project default hostname if it's not specified on the deploy
itself.
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.

5 participants