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

Add support for updates to resource type(s) with auto-upgrade support #203

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

owenfarrell
Copy link

@owenfarrell owenfarrell commented Nov 2, 2022

Signed-off-by: Owen Farrell [email protected]

Fixes #140
Supercedes: #196

PR Checklist


  • I have read the CONTRIBUTING.MD instructions
  • I have changed the resourceDefinition.json
  • I have generated the resource model (there's a models_generated.go file in my PR)
  • I have updated the README.md#resource-status
  • I have checked to ensure there aren't other open Pull Requests for the same update/change?

Description

Does this introduce a breaking change

  • YES
  • NO

While this doesn't inherently introduce a backwards-breaking change, I'm not sure that my attempt at an auto-upgrade is a sure thing. The approach that I used was a bit of a "guess and check" based on the existing outputs. In a worst case scenarios, anyone who attempts to auto-upgrade will incur the existing behavior (a forced deletion/recreation of downstream resources) one last time. Any suggestions on how to mitigate this issue would be appreciated.

Testing

In addition to local unit testing, I've exercised these updates via a local provider override and it seems to meet the need.

$ make build
go generate

2022/11/02 12:22:28 File generated
go fmt ./...
azurecaf/data_environment_variable.go
azurecaf/models_generated.go
azurecaf/provider_test.go
go build -o ./terraform-provider-azurecaf
go test ./...
?       github.com/aztfmod/terraform-provider-azurecaf  [no test files]
ok      github.com/aztfmod/terraform-provider-azurecaf/azurecaf 24.284s
?       github.com/aztfmod/terraform-provider-azurecaf/completness      [no test files]

@owenfarrell owenfarrell changed the title Migration Add support for updates to resource type(s) with auto-upgrade support Nov 2, 2022
@sonarcloud
Copy link

sonarcloud bot commented Nov 29, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

No Coverage information No Coverage information
26.7% 26.7% Duplication

@arnaudlh arnaudlh added this to the 1.3.0 milestone Mar 9, 2023
@patpicos
Copy link

any update on this enhancement? this would save a lot of headaches for folks who didnt notice this behavior and encountered significant cascading impacts (resource re-creation)

Copy link

sonarcloud bot commented Mar 13, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
20.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

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.

r/azurecaf_name: recreation of dependent resources on resource_types update
3 participants