pulumi/pkg/backend
Joe Duffy 01d0d64e84
Correctly rename stack files during a rename (#5812)
* Correctly rename stack files during a rename

This fixes pulumi/pulumi#4463, by renaming a stack's configuration
file based on its stack-part, and ignoring the owner-part. Our
workspace system doesn't recognize configuration files with fully
qualified names. That, by the way, causes problems if we have
multiple stacks in different organizations that share a stack-part.

The fix here is simple: propagate the new StackReference from the
Rename operation and rely on the backend's normalization to a
simple name, and then use that the same way we are using a
StackReference to determine the path for the origin stack.

An alternative fix is to recognize fully qualified config files,
however, there's a fair bit of cleanup we will be doing as part of
https://github.com/pulumi/pulumi/issues/2522 and
https://github.com/pulumi/pulumi/issues/4605, so figured it is best
to make this work the way the system expects first, and revisit it
as part of those overall workstreams. I also suspect we may want to
consider changing the default behavior here as part of
https://github.com/pulumi/pulumi/issues/5731.

Tests TBD; need some advice on how best to test this since it
only happens with our HTTP state backend -- all integration tests
appear to use the local filestate backend at the moment.

* Add a changelog entry for bug fix

* Add some stack rename tests

* Fix a typo

* Address CR feedback

* Make some logic clearer

Use "parsedName" instead of "qn", add a comment explaining why
we're doing this, and also explicitly ignore the error rather
than implicitly doing so with _.
2020-12-01 16:55:48 -08:00
..
display Small UX change to the output of policy violations (#5773) 2020-11-17 21:14:28 +00:00
filestate Correctly rename stack files during a rename (#5812) 2020-12-01 16:55:48 -08:00
httpstate Correctly rename stack files during a rename (#5812) 2020-12-01 16:55:48 -08:00
state Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
apply.go [cli] Add an import command. (#4765) 2020-10-14 12:51:53 +01:00
backend.go Correctly rename stack files during a rename (#5812) 2020-12-01 16:55:48 -08:00
backend_test.go Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
errors.go Add a link to docs for the 409 Conflict error message (#3207) 2019-09-10 13:25:08 -07:00
mock.go Correctly rename stack files during a rename (#5812) 2020-12-01 16:55:48 -08:00
policypack.go Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
query.go Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
snapshot.go Revert "Narrow a few interfaces." (#4987) 2020-07-09 15:19:12 +01:00
snapshot_test.go Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
stack.go Correctly rename stack files during a rename (#5812) 2020-12-01 16:55:48 -08:00
updates.go expose execution kind via update metadata (#5258) 2020-08-31 09:07:59 -07:00
watch.go Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00