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

Rewrite DeletedWith properties when renaming stacks #16216

Merged
merged 1 commit into from
May 16, 2024

Conversation

lunaris
Copy link
Contributor

@lunaris lunaris commented May 16, 2024

When renaming a stack, we need to rewrite URN references to use the new stack name instead of the old one. Presently such references can occur as:

  • Parent references
  • Provider references
  • Dependencies
  • PropertyDependencies
  • DeletedWith references

The current renaming implementation fails to rewrite DeletedWith references. Previously this went unnoticed since such references were also omitted when checking snapshot integrity. Now that integrity checks correctly inspect DeletedWith properties, the omission during rename has been surfaced. This commit fixes renaming to handle DeletedWith correctly. A follow-up should also ensure that renaming checks integrity itself prior to operation completion.

Fixes #16215

@lunaris lunaris requested a review from a team as a code owner May 16, 2024 14:09
@pulumi-bot
Copy link
Contributor

pulumi-bot commented May 16, 2024

Changelog

[uncommitted] (2024-05-16)

Bug Fixes

  • [backend/diy] Rewrite DeletedWith references when renaming stacks
    #16216

When renaming a stack, we need to rewrite URN references to use the new
stack name instead of the old one. Presently such references can occur
as:

* `Parent` references
* `Provider` references
* `Dependencies`
* `PropertyDependencies`
* `DeletedWith` references

The current renaming implementation fails to rewrite `DeletedWith`
references. Previously this went unnoticed since such references were
also omitted when checking snapshot integrity. Now that integrity checks
correctly inspect `DeletedWith` properties, the omission during rename
has been surfaced. This commit fixes renaming to handle `DeletedWith`
correctly. A follow-up should also ensure that renaming checks integrity
itself prior to operation completion.
@lunaris lunaris force-pushed the wjones/rename-deleted-with branch from d6ae52d to 8eea7aa Compare May 16, 2024 14:13
Copy link
Contributor

@Zaid-Ajaj Zaid-Ajaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lunaris lunaris added this pull request to the merge queue May 16, 2024
Merged via the queue into master with commit 41b967d May 16, 2024
49 checks passed
@lunaris lunaris deleted the wjones/rename-deleted-with branch May 16, 2024 16:05
github-merge-queue bot pushed a commit that referenced this pull request May 24, 2024
Tentative changelog:

### Features

- [engine] Guess ID references of dependant resources when generating
code for import operations
  [#16208](#16208)


### Bug Fixes

- [engine] Check property dependencies and deleted-with relationships
for target dependents
  [#16220](#16220)

- [engine] Propagate dependencies of untargeted resources correctly
during targeted updates
  [#16247](#16247)

- [backend/diy] Rewrite DeletedWith references when renaming stacks
  [#16216](#16216)

- [sdk/python] Use a separate type variable for static methods on Output
  [#16172](#16172)

- [sdk/python] Relax Output.all types to better match the implementation
  [#16172](#16172)

- [sdkgen/python] Generate __init__.py files for modules that only
contain enumerations
  [#16229](#16229)
@justinvp justinvp mentioned this pull request May 24, 2024
github-merge-queue bot pushed a commit that referenced this pull request May 24, 2024
To be merged after:
- #16261
- pulumi/pulumi-docker-containers#195

Tentative changelog...

### Features

- [engine] Guess ID references of dependant resources when generating
code for import operations
  [#16208](#16208)


### Bug Fixes

- [engine] Check property dependencies and deleted-with relationships
for target dependents
  [#16220](#16220)

- [engine] Propagate dependencies of untargeted resources correctly
during targeted updates
  [#16247](#16247)

- [backend/diy] Rewrite DeletedWith references when renaming stacks
  [#16216](#16216)

- [cli/state] Fix state renames involving DeletedWith

- [sdk/python] Use a separate type variable for static methods on Output
  [#16172](#16172)

- [sdk/python] Relax Output.all types to better match the implementation
  [#16172](#16172)

- [sdkgen/python] Generate __init__.py files for modules that only
contain enumerations
  [#16229](#16229)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Renaming stacks with pulumi stack rename fails to rewrite DeletedWith references
3 participants