-
Notifications
You must be signed in to change notification settings - Fork 133
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
Centralize diagnostics publishing #1361
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dbanck
force-pushed
the
f-diagnostic-map
branch
from
August 24, 2023 15:54
0832cfa
to
13faff3
Compare
radeksimko
approved these changes
Aug 29, 2023
dbanck
added a commit
that referenced
this pull request
Aug 29, 2023
* Introduce different source for diagnostics * Add reference validation job * Run terraform validate as a job * Track validation job states * Review feedback * Pass pathCtx to reference validation funcs * Rename early validation job * Bump hcl-lang to `29034e` * Introduce VarsDiagnosticsState * Fix tests
1 task
1 task
dbanck
added a commit
that referenced
this pull request
Aug 31, 2023
* Introduce different source for diagnostics * Add reference validation job * Run terraform validate as a job * Track validation job states * Review feedback * Pass pathCtx to reference validation funcs * Rename early validation job * Bump hcl-lang to `29034e` * Introduce VarsDiagnosticsState * Fix tests
dbanck
added a commit
that referenced
this pull request
Sep 1, 2023
* Introduce different source for diagnostics * Add reference validation job * Run terraform validate as a job * Track validation job states * Review feedback * Pass pathCtx to reference validation funcs * Rename early validation job * Bump hcl-lang to `29034e` * Introduce VarsDiagnosticsState * Fix tests
radeksimko
pushed a commit
that referenced
this pull request
Sep 4, 2023
* Introduce different source for diagnostics * Add reference validation job * Run terraform validate as a job * Track validation job states * Review feedback * Pass pathCtx to reference validation funcs * Rename early validation job * Bump hcl-lang to `29034e` * Introduce VarsDiagnosticsState * Fix tests
radeksimko
pushed a commit
that referenced
this pull request
Sep 5, 2023
* Introduce different source for diagnostics * Add reference validation job * Run terraform validate as a job * Track validation job states * Review feedback * Pass pathCtx to reference validation funcs * Rename early validation job * Bump hcl-lang to `29034e` * Introduce VarsDiagnosticsState * Fix tests
dbanck
added a commit
that referenced
this pull request
Sep 7, 2023
* Introduce different source for diagnostics * Add reference validation job * Run terraform validate as a job * Track validation job states * Review feedback * Pass pathCtx to reference validation funcs * Rename early validation job * Bump hcl-lang to `29034e` * Introduce VarsDiagnosticsState * Fix tests
radeksimko
pushed a commit
that referenced
this pull request
Sep 11, 2023
* Introduce different source for diagnostics * Add reference validation job * Run terraform validate as a job * Track validation job states * Review feedback * Pass pathCtx to reference validation funcs * Rename early validation job * Bump hcl-lang to `29034e` * Introduce VarsDiagnosticsState * Fix tests
dbanck
added a commit
that referenced
this pull request
Sep 12, 2023
* Introduce different source for diagnostics * Add reference validation job * Run terraform validate as a job * Track validation job states * Review feedback * Pass pathCtx to reference validation funcs * Rename early validation job * Bump hcl-lang to `29034e` * Introduce VarsDiagnosticsState * Fix tests
radeksimko
pushed a commit
that referenced
this pull request
Sep 13, 2023
* Introduce different source for diagnostics * Add reference validation job * Run terraform validate as a job * Track validation job states * Review feedback * Pass pathCtx to reference validation funcs * Rename early validation job * Bump hcl-lang to `29034e` * Introduce VarsDiagnosticsState * Fix tests
radeksimko
pushed a commit
that referenced
this pull request
Sep 20, 2023
* Introduce different source for diagnostics * Add reference validation job * Run terraform validate as a job * Track validation job states * Review feedback * Pass pathCtx to reference validation funcs * Rename early validation job * Bump hcl-lang to `29034e` * Introduce VarsDiagnosticsState * Fix tests
dbanck
added a commit
that referenced
this pull request
Sep 27, 2023
* Introduce different source for diagnostics * Add reference validation job * Run terraform validate as a job * Track validation job states * Review feedback * Pass pathCtx to reference validation funcs * Rename early validation job * Bump hcl-lang to `29034e` * Introduce VarsDiagnosticsState * Fix tests
dbanck
added a commit
that referenced
this pull request
Sep 28, 2023
* Introduce different source for diagnostics * Add reference validation job * Run terraform validate as a job * Track validation job states * Review feedback * Pass pathCtx to reference validation funcs * Rename early validation job * Bump hcl-lang to `29034e` * Introduce VarsDiagnosticsState * Fix tests
dbanck
added a commit
that referenced
this pull request
Sep 28, 2023
* Introduce a new setting for early validation (#1353) Adds `validation.earlyValidation` as a new setting. I chose to use `validation` as a primary key as we expect to add future settings for this feature. * Introduce a new job for running early validation (#1346) * Implement unreferenced variable validation (#1357) Add the ability to use the collected origin and target references in early validation by providing a hook for validation funcs. This also adds a validator for unreferenced variables. Validation funcs will be provided by terraform-ls for now, but may be moved into hcl-lang in the future. * Introduce ValidationDiagnostics field to module * Publish early validation diagnostics * Include validation diagnotics in changes check * Introduce early validation job * Check ValidationDiagnosticsState when running validation * Run early validation job after collection jobs * Bump hcl-lang to `b6a3f8` * Update internal/terraform/module/module_ops.go Co-authored-by: Radek Simko <radek.simko@gmail.com> --------- Co-authored-by: James Pogran <jpogran@outlook.com> Co-authored-by: Radek Simko <radek.simko@gmail.com> * Centralize diagnostics publishing (#1361) * Introduce different source for diagnostics * Add reference validation job * Run terraform validate as a job * Track validation job states * Review feedback * Pass pathCtx to reference validation funcs * Rename early validation job * Bump hcl-lang to `29034e` * Introduce VarsDiagnosticsState * Fix tests * Check early validation setting before scheduling jobs (#1363) * Introduce new context for valiation settings * Check context before scheduling jobs * Only validate a single file on `didChange` (#1370) * Introduce new RPCContextData for storing rpc info * Attach RPCContextData to jobs * Add RPCContextData to walker ctx, fix params * Check RPCContext on SchemaValidation * Bump hcl-lang to `485c60` * Review feedback * Add progress reporting for Terraform validate (#1373) * validations: Limit ref. validation to only LocalOrigin(s) (#1379) * validations: Limit ref. validation to only LocalOrigin(s) * validations: add test for disabled origins * validations: Validate only first 2 segments of a reference (#1380) * validations: Enable reference validation of locals (#1381) * validations: Enable reference validation of locals * Update internal/decoder/validations/unreferenced_origin.go Co-authored-by: Daniel Banck <dbanck@users.noreply.github.com> * fix imports --------- Co-authored-by: Daniel Banck <dbanck@users.noreply.github.com> * decoder: Update comments about validation of other Origin types (#1396) * Update diagnostic source to `Terraform` (#1399) * early validation - bump `hcl-lang` and reflect upstream changes (#1416) * deps: bump hcl-lang to aa9b38d (#1414) * re-define decoupled validators * Introduce validation of `*.tfvars` files (#1413) * Introduce validation of tfvars files * clarify existing job name/type * add tests * Fix delayed diagnostics / job ordering (#1417) * Move everything into defer * Add comment about lsctx * Have module registry job depend on module metadata * Fix RPCContext related test failures --------- Co-authored-by: James Pogran <jpogran@outlook.com> Co-authored-by: Radek Simko <radek.simko@gmail.com>
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the way we store and publish diagnostics to allow publishing from a single location (a module hook).
Whereas before we only stored diagnostics from parsing inside the module state, we now store a map instead, which can contain diagnostics from different sources. The map is filled by different jobs, such as parsing or early validation.
We've moved the execution of
terraform validate
into its own job that is scheduled on save (if enabled) to remove the manual publishing of diagnostics in that command. This leaves us with a single place for publishing (a module hook) that is automatically triggered whenever a module's diagnostic map changes.Resolves #1337