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

Migrate tfe_organization_run_task to plugin model #1282

Merged
merged 4 commits into from
Mar 21, 2024

Conversation

glennsarti
Copy link
Contributor

@glennsarti glennsarti commented Mar 12, 2024

Description

Requires #1291 to be merged first

This commit migrates the tfe_organization_run_task resource to the newer
plugin model. It uses a schema v0 as there is no difference in schema.

Later changes will migrate the other resource and data source objects.

As this is a no-op as far as customer changes go, no changelog is required.

Testing plan

  1. This should be a noop. so all acceptance and unit tests will pass.

Manually tested

  • Create a tfe_resource_run_task resource with the existing provider
  • Then re-run terraform plan using the newer version, which includes this PR
  • Note that no state changes will be present. Again, this should be a noop

External links

N/A

Output from acceptance tests

Local testing...

?   	github.com/hashicorp/terraform-provider-tfe/internal/provider/validators	[no test files]
=== RUN   TestAccTFEOrganizationRunTaskDataSource_basic
2024/03/18 14:25:51 [DEBUG] Configuring client for host "REDACTED"
2024/03/18 14:25:51 [WARN] Unable to read CLI config or credentials file REDACTED: open REDACTED: no such file or directory
2024/03/18 14:25:51 [DEBUG] Service discovery for REDACTED
--- PASS: TestAccTFEOrganizationRunTaskDataSource_basic (8.34s)
=== RUN   TestAccTFEOrganizationRunTask_validateSchemaAttributeUrl
--- PASS: TestAccTFEOrganizationRunTask_validateSchemaAttributeUrl (0.24s)
=== RUN   TestAccTFEOrganizationRunTask_create
--- PASS: TestAccTFEOrganizationRunTask_create (9.24s)
=== RUN   TestAccTFEOrganizationRunTask_import
--- PASS: TestAccTFEOrganizationRunTask_import (6.90s)
PASS
ok  	github.com/hashicorp/terraform-provider-tfe/internal/provider	25.378s

@glennsarti glennsarti force-pushed the gs/refactor-run-task-resources branch 3 times, most recently from 3117b50 to 691565d Compare March 15, 2024 05:59
@glennsarti glennsarti self-assigned this Mar 15, 2024
@glennsarti glennsarti changed the title {WIP} Refactor run task resources and data sources Migrate tfe_organization_run_task to plugin model Mar 15, 2024
@glennsarti glennsarti marked this pull request as ready for review March 15, 2024 06:03
@glennsarti glennsarti requested a review from a team as a code owner March 15, 2024 06:03
Copy link
Collaborator

@brandonc brandonc left a comment

Choose a reason for hiding this comment

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

Thanks for migrating this resource to the framework! This is the first time I've had to review a simple sdk -> framework migration and you made it really easy.

Shout out @ctrombley for the pair code review

@glennsarti glennsarti force-pushed the gs/refactor-run-task-resources branch from 691565d to f4e1679 Compare March 18, 2024 06:23
@glennsarti
Copy link
Contributor Author

@brandonc and @ctrombley Fixed up the PR as per comments and I also noticed that the resource import was completely removed (Whoops). I put that back in. Although I am tad concerned that the CI tests didn't pick that up. My testing did.

@glennsarti
Copy link
Contributor Author

Although I am tad concerned that the CI tests didn't pick that up. My testing did.

Found it. GHA was using the wrong variable name. Fixed it.

@glennsarti glennsarti force-pushed the gs/refactor-run-task-resources branch 2 times, most recently from 5be15e2 to 9fa7cd7 Compare March 18, 2024 07:21
@glennsarti
Copy link
Contributor Author

I've found too many errors in the acceptance testing and moved them all to #1291. Blocked this PR in the mean time

@glennsarti glennsarti force-pushed the gs/refactor-run-task-resources branch from 9fa7cd7 to dfcd2f8 Compare March 20, 2024 03:09
@glennsarti
Copy link
Contributor Author

@brandonc This is back ready for review

Copy link
Collaborator

@brandonc brandonc left a comment

Choose a reason for hiding this comment

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

Well done

This commit migrates the tfe_organization_run_task resource to the newer
plugin model. It uses a schema v0 as there is no difference in schema.

Later changes will migrate the other resource and data source objects.
Previously the Org. Run Task resource would not trigger a change if it was
using the default organization. This commit updates the plan modifier to
detect when this happens and trigger a modification.
Due to the DataSource test using the Resource code to create the test
fixture we also need to update the provider factories from only the old
one to the newer Mux provider.
@glennsarti glennsarti force-pushed the gs/refactor-run-task-resources branch from 64509ab to 7a086ca Compare March 21, 2024 02:02
@glennsarti glennsarti merged commit b89d0da into main Mar 21, 2024
9 checks passed
@glennsarti glennsarti deleted the gs/refactor-run-task-resources branch March 21, 2024 02:51
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.

2 participants