-
-
Notifications
You must be signed in to change notification settings - Fork 997
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
Missing Dependency Outputs Has Insufficiently Helpful Error Message #3567
Comments
hey, Wouldn't emitting a suggestion about using a dependencies block instead be better and considered a best practice? I'm happy to pick it up over the weekend! |
I believe a user would still encounter an error if they used a The crux of the issue is that most people use mocks in the scenario I outlined above because they want to be able to |
Sorry, I should be more precise. I agree that if the user is using outputs from other units in the inputs attribute, we should provide a suggestion to add the mock values, ideally with a fix based on the inputs they are trying to use. However, if there is no reference in the inputs, perhaps we should suggest using the dependencies block instead. in your example if we would populate dependencies {
paths = ["../foo"]
} plan is passing without issues - that's why I mentioned that maybe, in cases where the end user is not passing anything to inputs, we should consider suggesting the other block as a best practice. I'm just not sure if we can actually 'peek' that far into the parsing structure? |
Ah, I see. I think there may be a case where seeing both recommended could be useful. The guidance would be something like: """ e.g. dependency "foo" {
config_path = "../foo"
mock_outputs = {
foo_output = "mock-foo-output"
}
} You can learn more about this here: If you do not need outputs from your dependency, consider using dependencies instead: |
…g the dependencies block, fix gruntwork-io#3567
…g the dependencies block, fix gruntwork-io#3567
…g the dependencies block, fix gruntwork-io#3567
…g the dependencies block, fix gruntwork-io#3567
Describe the bug
When a unit depends on outputs from another unit with no dependencies, it throws an error that looks like the following:
While the error does accurately describe the problem, it doesn't offer the best prescriptive guidance on how to fix the issue.
Steps To Reproduce
Create the following fixture:
Then populate
bar/terragrunt.hcl
with the following:Expected behavior
The error that Terragrunt could not determine the underlying exit code should be removed, as it's clear what the underlying error is, and there should be a hint that a user could have used mocks to avoid the issue if they encountered the error during a plan of a dependency that wasn't applied yet.
Ideally, there should actually be an HCL sample emitted that a user could copy + paste to bypass the issue.
Nice to haves
Versions
v0.68.13
v1.8.5
Additional context
I encountered this as an expected error while writing up a guide for new users to adopt Terragrunt. These are the most important errors to get right, and they should be as good as possible.
The text was updated successfully, but these errors were encountered: