Commit 1dfeffe
authored
[MAINT] Convert legacy Schema Migrations to use StateUpgraders (#3065)
* Convert `resourceGithubActionsOrganizationSecret` to use `StateUpgraders` for schema migrations
Signed-off-by: Timo Sand <[email protected]>
* Convert `resourceGithubActionsSecret` to use `StateUpgraders` for schema migrations
Signed-off-by: Timo Sand <[email protected]>
* Convert `resourceGithubRepositoryWebhook` and `resourceGithubOrganizationWebhook` schema migrations to use StateUpgraders
Signed-off-by: Timo Sand <[email protected]>
* Convert `resourceGithubRepository` schema migration to use StateUpgraders
Signed-off-by: Timo Sand <[email protected]>
* Restructure github_actions_secret state migration files
Signed-off-by: Timo Sand <[email protected]>
* Rename to new naming scheme `<resource>_migration.go`
Signed-off-by: Timo Sand <[email protected]>
* Mmove migration code to _migration.go file and exxtract tests to _migartion_test.go file
Signed-off-by: Timo Sand <[email protected]>
* refactor(github): rename actions organization secret migration files
Rename migrate_github_actions_organization_secret*.go to
resource_github_actions_organization_secret_migration*.go for
consistent naming with resource files.
* refactor(github): rename branch protection migration file
Rename migrate_github_branch_protection.go to
resource_github_branch_protection_migration.go for
consistent naming with resource files.
* refactor(github): rename organization webhook migration files
Rename migrate_github_organization_webhook*.go to
resource_github_organization_webhook_migration*.go for
consistent naming with resource files.
* refactor(github): rename repository migration files
Rename migrate_github_repository*.go to
resource_github_repository_migration*.go for
consistent naming with resource files.
* refactor(github): rename repository webhook migration files
Rename migrate_github_repository_webhook*.go to
resource_github_repository_webhook_migration*.go for
consistent naming with resource files.
* refactor(github): migrate actions secret to context-aware CRUD
Migrate resource_github_actions_secret.go from legacy CRUD functions
to Context-aware functions (CreateContext, ReadContext, DeleteContext).
- Add diag import
- Update function signatures to accept context.Context
- Return diag.Diagnostics instead of error
- Use StateContext for importer
Ref: #2996
* refactor(actions-org-secret): migrate to context-aware CRUD functions
Migrate resource_github_actions_organization_secret.go from legacy
CRUD to context-aware CRUD functions (CreateContext, ReadContext,
DeleteContext) per Terraform Plugin SDK v2 best practices.
Ref: #2996
* refactor(org-webhook): migrate to context-aware CRUD functions
Migrate resource_github_organization_webhook.go from legacy CRUD to
context-aware CRUD functions (CreateContext, ReadContext, UpdateContext,
DeleteContext) per Terraform Plugin SDK v2 best practices.
Ref: #2996
* refactor(repo-webhook): migrate to context-aware CRUD functions
Migrate resource_github_repository_webhook.go from legacy CRUD to
context-aware CRUD functions (CreateContext, ReadContext, UpdateContext,
DeleteContext) per Terraform Plugin SDK v2 best practices.
Ref: #2996
---------
Signed-off-by: Timo Sand <[email protected]>1 parent 253fa50 commit 1dfeffe
24 files changed
Lines changed: 850 additions & 488 deletions
File tree
- github
This file was deleted.
Lines changed: 0 additions & 69 deletions
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments