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

Manual cherrypick to add moved block to language docs #35127

Closed
wants to merge 295 commits into from

Conversation

trujillo-adam
Copy link
Contributor

This PR is a manual cherry-pick a backport of #35112

crw and others added 30 commits September 22, 2022 14:46
…tswith/highly-gorgeous-katydid

Backport of fixed typo: `startsswith` -> `startswith` into v1.3
…t-optional-defaults/virtually-able-mouse

Backport of Upgrade hcl to fix crash with optional attributes into v1.3
…n-fixes/secondly-huge-titmouse

Backport of Update workspace documentation into v1.3
…e-cycles/instantly-prepared-hagfish

Backport of prevent cycles when connecting destroy nodes into v1.3
…destroy/inherently-close-fly

Backport of prune unused nodes from a destroy plan graph into v1.3
…ned-during-import/genuinely-shining-boar

Backport of RemovePlannedResourceInstanceObjects during import into v1.3
We were previously _trying_ to handle diagnostics here but were not quite
doing it right because we were testing whether the resulting error was
nil rather than appending it to the diagnostics and then seeing if the
result has errors.

The difference here is important because it allows DynamicExpand to return
warnings without associated errors when needed. Previously the graph
walker would treat a warnings-only result as if it were an error.

Ideally we'd change DynamicExpand to return diagnostics directly, but we
previously decided against that because there were so many implementors
to update, and my intent for this change is to be surgical in the update
so we minimize risk of backporting the change into patch releases.
We previously did two levels of DynamicExpand to go from ConfigResource to
AbsResource and then from AbsResource to AbsResourceInstance.

We'll now do the full expansion from ConfigResource to AbsResourceInstance
in a single DynamicExpand step inside nodeExpandPlannableResource.

The new approach is essentially functionally equivalent to the old except
that it fixes a bug in the previous implementation: we will now call
checkState.ReportCheckableObjects only once for the entire set of
instances for a particular resource, which is what the checkable objects
infrastructure expects so that it can always mention all of the checkable
objects in the check report even if we bail out partway through due to
a downstream error.

This is essentially the same code but now turned into additional methods
on nodeExpandPlannableResource instead of having the extra graph node
type. This has the further advantage of this now being straight-through
code with standard control flow, instead of the unusual inversion of
control we were doing before bouncing in and out of different Execute and
DynamicExpand implementations to get this done.
We use a non-pointer value for this particular node, which means that
there can never be two root nodes in the same graph: the graph
implementation will just coalesce them together when a second one is added.

Our resource expansion code is relying on that coalescing so that it can
subsume together multiple graphs for different modules instances into a
single mega-graph with all instances across all module instances, with
any root nodes coalescing together to produce a single root.

This also updates one of the context tests that exercises resource
expansion so that it will generate multiple resource instance nodes per
module and thus potentially have multiple roots to coalesce together.
However, we aren't currently explicitly validating the return values from
DynamicExpand and so this test doesn't actually fail if the coalescing
doesn't happen. We may choose to validate the DynamicExpand result in a
later commit in order to make it more obvious if future modifications fail
to uphold this invariant.
…ges-all-computed/centrally-factual-colt

Backport of filter computed attrs from `ignore_changes=all` into v1.3
…rce-instance-state-nil-checks/greatly-elegant-yak

Backport of Fix panic when planning orphaned deposed instances into v1.3
…-orphan-nodes-for-deposed-instances/newly-apt-lionfish

Backport of Do not add orphan nodes for deposed instances into v1.3
Terraform 1.5 introduced a new check result kind, which causes a decode
failure when read by Terraform 1.3 and 1.4. This means that a 1.5+ state
file cannot be read by the `terraform_remote_state` data source in 1.3
or 1.4 series.

Aborting state decode at this point isn't strictly necessary, as we
don't stand to lose important data by failing to round-trip these check
results. Instead we can ignore those check results, allowing decode to
elide them from the state.

This has no negative effect on the remote state data source, which only
exposes root module outputs anyway.
…-compatibility-1.3

statefile: Ignore unknown check results on decode
These seem unnecessary for our current release process.
Co-authored-by: Marko Eremija <marko.eremija@gmail.com>
…d-ref

added reference page for  block

Added docs for moved block
Copy link

hashicorp-cla-app bot commented May 7, 2024

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


9 out of 11 committers have signed the CLA.

  • alisdair
  • yardbirdsax
  • trujillo-adam
  • mcdonagj
  • mdeggies
  • jbardin
  • crw
  • liamcervante
  • nfagerlund
  • teamterraform
  • hc-github-team-tf-core

Have you signed the CLA already but the status is still pending? Recheck it.

@trujillo-adam trujillo-adam deleted the manual-cherrypick-add-moved-lang-docs branch May 7, 2024 22:01
Copy link

github-actions bot commented Jun 7, 2024

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 contributions.
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 Jun 7, 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.

None yet