pulumi/pkg/resource/deploy
bors[bot] 8e83ce445d
Merge #13480
13480: Fix resoloution of aliased parent aliases. r=Frassle a=Frassle

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Fixes https://github.com/pulumi/pulumi/issues/13324.

When collapsing an alias that specifies a parent we need to use the parents alias if it had one. 

This is so that for example given a state with three resources:
```
urn:pulumi:test::test::prog:index:myStandardType::resA
urn:pulumi:test::test::prog:index:myType::resB
urn:pulumi:test::test::prog:index:myType$pkgAⓂ️typA::resC
```
Which is then updated such that resB and resC are re-parented to resA we end up with the following alias specifications:
```
resB: { NoParent = True}
resC: { Parent = "urn:pulumi:test::test::prog:index:myStandardType$prog:index:myType::resB
```
Note that resC's alias uses the _new_ URN for resB. If we do a simple collapse of that alias we'd end up trying to find an old URN of `urn:pulumi:test::test::prog:index:myStandardType$prog:index:myType$pkgAⓂ️typA::resC` but actually it's old URN would have been `urn:pulumi:test::test::prog:index:myType$pkgAⓂ️typA::resC`.

This change fixes alias to URN collapse to take into account if the parent was aliased so we get the correct old URN.

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [ ] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [x] I have added tests that prove my fix is effective or that my feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Fraser Waters <fraser@pulumi.com>
2023-07-17 16:28:39 +00:00
..
deploytest [engine] Add support for source positions 2023-07-10 14:35:40 -07:00
providers Don't try to install provider during schema loading unless missing 2023-06-28 14:12:17 +01:00
builtins.go Send old inputs to diff and update 2023-06-21 21:04:50 +01:00
deployment.go Consolidated Target parameters 2023-06-08 08:42:03 -07:00
deployment_executor.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
deployment_executor_test.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
deployment_test.go Remove source_fixed 2022-11-08 15:55:45 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
import.go [engine] Add support for source positions 2023-07-10 14:35:40 -07:00
manifest.go Split Manifest type to it's own file (#8712) 2022-01-10 12:25:24 +00:00
plan.go all: Fix revive issues 2023-03-21 08:55:11 -07:00
snapshot.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
snapshot_test.go all: Fix revive issues 2023-03-21 08:55:11 -07:00
source.go [engine] Add support for source positions 2023-07-10 14:35:40 -07:00
source_error.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
source_eval.go [engine] Add support for source positions 2023-07-10 14:35:40 -07:00
source_eval_test.go [engine] Add support for source positions 2023-07-10 14:35:40 -07:00
source_null.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
source_query.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
source_query_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
state_builder.go all: Fix revive issues 2023-03-21 08:55:11 -07:00
state_builder_test.go Non-mutating snapshot normalization (#10128) 2022-07-18 14:04:19 -04:00
step.go [engine] Add support for source positions 2023-07-10 14:35:40 -07:00
step_executor.go Mark outputs secret if there is a matching secret input. 2023-06-23 09:24:21 -07:00
step_generator.go Merge #13480 2023-07-17 16:28:39 +00:00
step_generator_test.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
target.go Add getOrganization to nodejs and python (#10504) 2022-08-31 10:33:29 +01:00