pulumi/pkg
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
..
backend Correctly rename stack files during a rename (#5812) 2020-12-01 16:55:48 -08:00
cmd/pulumi Correctly rename stack files during a rename (#5812) 2020-12-01 16:55:48 -08:00
codegen [codegen/docs] Exclude eks package API links (#5843) 2020-12-01 12:03:08 -07:00
engine Fix a few issues with resource references. (#5804) 2020-11-23 11:15:10 -08:00
graph Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
operations Ensure CLI doesn't panic when using pulumi watch and ComponentResources (#5675) 2020-11-04 01:14:43 +00:00
resource Enable resource reference feature by default (#5848) 2020-12-01 16:58:49 -07:00
secrets Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
testing/integration Ensure stderr is updated on error even if verbose is not set 2020-11-18 00:56:26 -08:00
util Breaking changes due to Feature 2.0 work 2020-04-14 09:30:25 +01:00
version duplicate version to ensure linking is properly handled 2020-03-19 12:49:34 -07:00
go.mod switch uuid packages (#5608) 2020-11-04 03:13:04 +00:00
go.sum Add additional test to demonstrate strict/relaxed enum semantics 2020-11-18 00:07:42 -08:00