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

(TFECO-7637) Raise HCL diagnostics #1850

Merged
merged 2 commits into from
Nov 15, 2024
Merged

(TFECO-7637) Raise HCL diagnostics #1850

merged 2 commits into from
Nov 15, 2024

Conversation

jpogran
Copy link
Contributor

@jpogran jpogran commented Oct 17, 2024

This change updates the stack metadata loading to merge the new diagnostics with the existing ones. This is necessary to ensure that we don't lose any diagnostics that were previously reported.

Needs hashicorp/terraform-schema#412

@jpogran jpogran self-assigned this Oct 17, 2024
@jpogran jpogran changed the title Raise HCL diagnostics (TFECO-7637) Raise HCL diagnostics Nov 4, 2024
@jpogran jpogran requested a review from dbanck November 7, 2024 21:54
@jpogran jpogran marked this pull request as ready for review November 8, 2024 16:02
@jpogran jpogran requested a review from a team as a code owner November 8, 2024 16:02
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

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

I noticed a few things when I tried to use this feature. These don't require changes to this PR, but rather to terraform-schema. I am sorry that I missed them during the review of hashicorp/terraform-schema#412 and am only bringing them up now.

Maybe we can add more test cases to the decoder in terraform-schema to cover them.


We need to check that req.Source and req.VersionConstraints are both not null when iterating over the requirements, to avoid crashing due to a null pointer dereference.

Both diagnostic messages contain nil because we are using an empty field in our string (e.g. pr.source instead of source.AsString()).

CleanShot 2024-11-11 at 11 59 41@2x

CleanShot 2024-11-11 at 11 59 22@2x

go.sum Outdated Show resolved Hide resolved
internal/features/stacks/jobs/metadata.go Show resolved Hide resolved
This change updates the stack metadata loading to merge the new diagnostics with the existing ones. This is necessary to ensure that we don't lose any diagnostics that were previously reported.
@jpogran jpogran merged commit e4e739c into main Nov 15, 2024
22 checks passed
@jpogran jpogran deleted the raise_hcl_diags branch November 15, 2024 14:03
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants