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

Update terraform-plugin-sdk to v1.13.1 #177

Merged
merged 1 commit into from
Jun 10, 2020

Conversation

lafentres
Copy link
Contributor

@lafentres lafentres commented May 19, 2020

Description

This PR upgradse the terraform-plugin-sdk to 1.13.1. There have been a number of new features added to the SDK that would have been super helpful to have when I was working on #182 but I didn't want to update the SDK as part of that PR.

Testing plan

This should be fine as there were no breaking changes to the SDK. These test steps have you test against a config that has many (but not all) of the resources available in the TFE provider.

  1. Make sure the same tests pass and fail on this branch as on master.
  2. Make sure you have a forked copy of this terraform-random-monorepo and this test-policy-set repo. If you've forked these in the past, make sure they are up-to-date with the original repo.
  3. Clone this Terraform config, rename the terraform.tfvars.example file to terraform.tfvars, and add your information to the terraform.tfvars file. You can find descriptions of these variables in the variables.tf file.
  4. Run terraform init and terraform version. Make sure the version of the TFE provider is not unversioned.
  5. Run terraform apply. This should succeed.
  6. Follow the steps in the README to make a local build of the provider from this branch. Copy that build to your ~/.terraform.d/plugins directory.
  7. In the directory where your main.tf is, delete your .terraform folder.
  8. Run terraform init and terraform version. Your provider version should now be unversioned.
    provider.tfe (unversioned)
    
  9. Run terraform apply. There should be no changes.
  10. Try updating various attrtibutes (update workspace names, remove some of the triggers from the notification configuration, change the value of some variables) and run terraform apply. This should succeed.
  11. Run terraform destroy. This should succeed.
  12. Run terraform apply again. This should succeed.

External links

Output from acceptance tests

We have more test failing locally than in CircleCI now. This needs to be fixed but it outside the scope of this PR.

$ envchain terraform-provider-tfe make testacc
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v  -timeout 15m
?       github.com/terraform-providers/terraform-provider-tfe   [no test files]
=== RUN   TestAccTFESSHKeyDataSource_basic
--- PASS: TestAccTFESSHKeyDataSource_basic (6.30s)
=== RUN   TestAccTFETeamAccessDataSource_basic
--- PASS: TestAccTFETeamAccessDataSource_basic (7.97s)
=== RUN   TestAccTFETeamDataSource_basic
--- PASS: TestAccTFETeamDataSource_basic (5.66s)
=== RUN   TestAccTFEWorkspaceIDsDataSource_basic
--- PASS: TestAccTFEWorkspaceIDsDataSource_basic (6.75s)
=== RUN   TestAccTFEWorkspaceIDsDataSource_wildcard
--- PASS: TestAccTFEWorkspaceIDsDataSource_wildcard (6.77s)
=== RUN   TestAccTFEWorkspaceDataSource_basic
--- PASS: TestAccTFEWorkspaceDataSource_basic (5.60s)
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestProvider_versionConstraints
--- PASS: TestProvider_versionConstraints (0.00s)
=== RUN   TestAccTFENotificationConfiguration_basic
--- PASS: TestAccTFENotificationConfiguration_basic (5.49s)
=== RUN   TestAccTFENotificationConfiguration_basicWorkspaceID
--- PASS: TestAccTFENotificationConfiguration_basicWorkspaceID (5.71s)
=== RUN   TestAccTFENotificationConfiguration_update
--- PASS: TestAccTFENotificationConfiguration_update (9.40s)
=== RUN   TestAccTFENotificationConfiguration_updateWorkspaceID
--- PASS: TestAccTFENotificationConfiguration_updateWorkspaceID (8.76s)
=== RUN   TestAccTFENotificationConfiguration_updateWorkspaceExternalIDToWorkspaceID
--- PASS: TestAccTFENotificationConfiguration_updateWorkspaceExternalIDToWorkspaceID (12.18s)
=== RUN   TestAccTFENotificationConfiguration_slackWithToken
--- PASS: TestAccTFENotificationConfiguration_slackWithToken (3.28s)
=== RUN   TestAccTFENotificationConfiguration_duplicateTriggers
--- PASS: TestAccTFENotificationConfiguration_duplicateTriggers (5.69s)
=== RUN   TestAccTFENotificationConfiguration_noWorkspaceID
--- PASS: TestAccTFENotificationConfiguration_noWorkspaceID (3.27s)
=== RUN   TestAccTFENotificationConfigurationImport
--- PASS: TestAccTFENotificationConfigurationImport (6.06s)
=== RUN   TestAccTFEOAuthClient_basic
--- PASS: TestAccTFEOAuthClient_basic (5.09s)
=== RUN   TestAccTFEOrganizationMembership_basic
--- PASS: TestAccTFEOrganizationMembership_basic (4.39s)
=== RUN   TestAccTFEOrganization_basic
--- PASS: TestAccTFEOrganization_basic (3.89s)
=== RUN   TestAccTFEOrganization_update
--- PASS: TestAccTFEOrganization_update (6.26s)
=== RUN   TestAccTFEOrganization_import
--- PASS: TestAccTFEOrganization_import (4.29s)
=== RUN   TestAccTFEOrganizationToken_basic
--- FAIL: TestAccTFEOrganizationToken_basic (2.70s)
    testing.go:683: Step 0 error: errors during apply:
        
        Error: Error checking if a token exists for organization tst-terraform: forbidden
        
          on /var/folders/jq/kcfxsqpd5hz_2cg_w9c_2hf40000gp/T/tf-test691441287/main.tf line 7:
          (source code not available)
        
        
=== RUN   TestAccTFEOrganizationToken_existsWithoutForce
--- FAIL: TestAccTFEOrganizationToken_existsWithoutForce (2.62s)
    testing.go:683: Step 0 error: errors during apply:
        
        Error: Error checking if a token exists for organization tst-terraform: forbidden
        
          on /var/folders/jq/kcfxsqpd5hz_2cg_w9c_2hf40000gp/T/tf-test413567569/main.tf line 7:
          (source code not available)
        
        
=== RUN   TestAccTFEOrganizationToken_existsWithForce
--- FAIL: TestAccTFEOrganizationToken_existsWithForce (2.73s)
    testing.go:683: Step 0 error: errors during apply:
        
        Error: Error checking if a token exists for organization tst-terraform: forbidden
        
          on /var/folders/jq/kcfxsqpd5hz_2cg_w9c_2hf40000gp/T/tf-test128089771/main.tf line 7:
          (source code not available)
        
        
=== RUN   TestAccTFEOrganizationToken_import
--- FAIL: TestAccTFEOrganizationToken_import (2.54s)
    testing.go:683: Step 0 error: errors during apply:
        
        Error: Error checking if a token exists for organization tst-terraform: forbidden
        
          on /var/folders/jq/kcfxsqpd5hz_2cg_w9c_2hf40000gp/T/tf-test081751573/main.tf line 7:
          (source code not available)
        
        
=== RUN   TestAccTFEPolicySetParameter_basic
--- PASS: TestAccTFEPolicySetParameter_basic (6.48s)
=== RUN   TestAccTFEPolicySetParameter_update
--- PASS: TestAccTFEPolicySetParameter_update (10.37s)
=== RUN   TestAccTFEPolicySetParameter_import
--- PASS: TestAccTFEPolicySetParameter_import (6.92s)
=== RUN   TestAccTFEPolicySet_basic
--- PASS: TestAccTFEPolicySet_basic (7.31s)
=== RUN   TestAccTFEPolicySet_update
--- PASS: TestAccTFEPolicySet_update (13.07s)
=== RUN   TestAccTFEPolicySet_updateWorkspaceIDs
--- PASS: TestAccTFEPolicySet_updateWorkspaceIDs (16.01s)
=== RUN   TestAccTFEPolicySet_updateEmpty
--- PASS: TestAccTFEPolicySet_updateEmpty (9.72s)
=== RUN   TestAccTFEPolicySet_updatePopulated
--- PASS: TestAccTFEPolicySet_updatePopulated (14.68s)
=== RUN   TestAccTFEPolicySet_updatePopulatedWorkspaceIDs
--- PASS: TestAccTFEPolicySet_updatePopulatedWorkspaceIDs (14.83s)
=== RUN   TestAccTFEPolicySet_updateToGlobal
--- PASS: TestAccTFEPolicySet_updateToGlobal (12.41s)
=== RUN   TestAccTFEPolicySet_updateWorkspaceIDsToGlobal
--- PASS: TestAccTFEPolicySet_updateWorkspaceIDsToGlobal (12.14s)
=== RUN   TestAccTFEPolicySet_updateToWorkspace
--- PASS: TestAccTFEPolicySet_updateToWorkspace (12.50s)
=== RUN   TestAccTFEPolicySet_updateGlobalToWorkspaceIDs
--- PASS: TestAccTFEPolicySet_updateGlobalToWorkspaceIDs (12.56s)
=== RUN   TestAccTFEPolicySet_vcs
--- PASS: TestAccTFEPolicySet_vcs (9.57s)
=== RUN   TestAccTFEPolicySetImport
--- PASS: TestAccTFEPolicySetImport (7.60s)
=== RUN   TestAccTFERunTrigger_basic
--- PASS: TestAccTFERunTrigger_basic (6.25s)
=== RUN   TestAccTFERunTrigger_basicWorkspaceID
--- PASS: TestAccTFERunTrigger_basicWorkspaceID (5.96s)
=== RUN   TestAccTFERunTrigger_updateWorkspaceExternalIDToWorkspaceID
--- PASS: TestAccTFERunTrigger_updateWorkspaceExternalIDToWorkspaceID (9.59s)
=== RUN   TestAccTFERunTriggerImport
--- PASS: TestAccTFERunTriggerImport (6.19s)
=== RUN   TestAccTFESentinelPolicy_basic
--- PASS: TestAccTFESentinelPolicy_basic (6.17s)
=== RUN   TestAccTFESentinelPolicy_update
--- PASS: TestAccTFESentinelPolicy_update (11.06s)
=== RUN   TestAccTFESentinelPolicy_import
--- PASS: TestAccTFESentinelPolicy_import (7.04s)
=== RUN   TestAccTFESSHKey_basic
--- PASS: TestAccTFESSHKey_basic (4.80s)
=== RUN   TestAccTFESSHKey_update
--- PASS: TestAccTFESSHKey_update (7.58s)
=== RUN   TestResourceTfeTeamAccessStateUpgradeV0
--- PASS: TestResourceTfeTeamAccessStateUpgradeV0 (0.24s)
=== RUN   TestAccTFETeamAccess_basic
--- PASS: TestAccTFETeamAccess_basic (6.04s)
=== RUN   TestAccTFETeamAccess_import
--- PASS: TestAccTFETeamAccess_import (6.68s)
=== RUN   TestPackTeamMemberID
--- PASS: TestPackTeamMemberID (0.00s)
=== RUN   TestUnpackTeamMemberID
--- PASS: TestUnpackTeamMemberID (0.00s)
=== RUN   TestAccTFETeamMember_basic
--- FAIL: TestAccTFETeamMember_basic (3.30s)
    testing.go:683: Step 0 error: errors during apply:
        
        Error: Error adding user "admin" to team team-ny24RWS26pNNF6uc: bad request
        
        admin is not a member of the organization
        
          on /var/folders/jq/kcfxsqpd5hz_2cg_w9c_2hf40000gp/T/tf-test802578776/main.tf line 12:
          (source code not available)
        
        
=== RUN   TestAccTFETeamMember_import
--- FAIL: TestAccTFETeamMember_import (3.52s)
    testing.go:683: Step 0 error: errors during apply:
        
        Error: Error adding user "admin" to team team-88sku7E1mw2vyMzy: bad request
        
        admin is not a member of the organization
        
          on /var/folders/jq/kcfxsqpd5hz_2cg_w9c_2hf40000gp/T/tf-test540182090/main.tf line 12:
          (source code not available)
        
        
=== RUN   TestAccTFETeamMembers_basic
--- FAIL: TestAccTFETeamMembers_basic (3.52s)
    testing.go:683: Step 0 error: errors during apply:
        
        Error: Error adding users to team team-9421cA5MN2GVrrzE: bad request
        
        tfe-provider-user1 is not a member of the organization
        
          on /var/folders/jq/kcfxsqpd5hz_2cg_w9c_2hf40000gp/T/tf-test179051532/main.tf line 12:
          (source code not available)
        
        
=== RUN   TestAccTFETeamMembers_update
--- FAIL: TestAccTFETeamMembers_update (3.41s)
    testing.go:683: Step 0 error: errors during apply:
        
        Error: Error adding users to team team-kTYvESo24Lq11sJf: bad request
        
        tfe-provider-user1 is not a member of the organization
        
          on /var/folders/jq/kcfxsqpd5hz_2cg_w9c_2hf40000gp/T/tf-test671626014/main.tf line 12:
          (source code not available)
        
        
=== RUN   TestAccTFETeamMembers_import
--- FAIL: TestAccTFETeamMembers_import (3.56s)
    testing.go:683: Step 0 error: errors during apply:
        
        Error: Error adding users to team team-zYXKsptvtULecc5B: bad request
        
        tfe-provider-user1 is not a member of the organization
        
          on /var/folders/jq/kcfxsqpd5hz_2cg_w9c_2hf40000gp/T/tf-test976909824/main.tf line 12:
          (source code not available)
        
        
=== RUN   TestPackTeamOrganizationMemberID
--- PASS: TestPackTeamOrganizationMemberID (0.00s)
=== RUN   TestUnpackTeamOrganizationMemberID
--- PASS: TestUnpackTeamOrganizationMemberID (0.00s)
=== RUN   TestAccTFETeamOrganizationMember_basic
--- PASS: TestAccTFETeamOrganizationMember_basic (5.83s)
=== RUN   TestAccTFETeamOrganizationMember_import
--- PASS: TestAccTFETeamOrganizationMember_import (6.10s)
=== RUN   TestAccTFETeam_basic
--- PASS: TestAccTFETeam_basic (4.97s)
=== RUN   TestAccTFETeam_full
--- PASS: TestAccTFETeam_full (4.83s)
=== RUN   TestAccTFETeam_full_update
--- PASS: TestAccTFETeam_full_update (7.62s)
=== RUN   TestAccTFETeam_import
--- PASS: TestAccTFETeam_import (4.85s)
=== RUN   TestAccTFETeamToken_basic
--- FAIL: TestAccTFETeamToken_basic (3.48s)
    testing.go:683: Step 0 error: errors during apply:
        
        Error: Error checking if a token exists for team team-imt86q8xq4ZayX8q: forbidden
        
          on /var/folders/jq/kcfxsqpd5hz_2cg_w9c_2hf40000gp/T/tf-test607297391/main.tf line 12:
          (source code not available)
        
        
=== RUN   TestAccTFETeamToken_existsWithoutForce
--- FAIL: TestAccTFETeamToken_existsWithoutForce (3.36s)
    testing.go:683: Step 0 error: errors during apply:
        
        Error: Error checking if a token exists for team team-Q8vqma2ZgA151P93: forbidden
        
          on /var/folders/jq/kcfxsqpd5hz_2cg_w9c_2hf40000gp/T/tf-test030735737/main.tf line 12:
          (source code not available)
        
        
=== RUN   TestAccTFETeamToken_existsWithForce
--- FAIL: TestAccTFETeamToken_existsWithForce (3.32s)
    testing.go:683: Step 0 error: errors during apply:
        
        Error: Error checking if a token exists for team team-VrmUbQkCdpAiZafk: forbidden
        
          on /var/folders/jq/kcfxsqpd5hz_2cg_w9c_2hf40000gp/T/tf-test604023315/main.tf line 12:
          (source code not available)
        
        
=== RUN   TestAccTFETeamToken_import
--- FAIL: TestAccTFETeamToken_import (3.47s)
    testing.go:683: Step 0 error: errors during apply:
        
        Error: Error checking if a token exists for team team-1nVnwRH27woiNNKk: forbidden
        
          on /var/folders/jq/kcfxsqpd5hz_2cg_w9c_2hf40000gp/T/tf-test942128573/main.tf line 12:
          (source code not available)
        
        
=== RUN   TestResourceTfeVariableStateUpgradeV0
--- PASS: TestResourceTfeVariableStateUpgradeV0 (0.22s)
=== RUN   TestAccTFEVariable_basic
--- PASS: TestAccTFEVariable_basic (6.48s)
=== RUN   TestAccTFEVariable_update
--- PASS: TestAccTFEVariable_update (11.13s)
=== RUN   TestAccTFEVariable_import
--- PASS: TestAccTFEVariable_import (7.38s)
=== RUN   TestResourceTfeWorkspaceStateUpgradeV0
--- PASS: TestResourceTfeWorkspaceStateUpgradeV0 (0.00s)
=== RUN   TestAccTFEWorkspace_basic
--- PASS: TestAccTFEWorkspace_basic (4.61s)
=== RUN   TestAccTFEWorkspace_panic
--- PASS: TestAccTFEWorkspace_panic (4.68s)
=== RUN   TestAccTFEWorkspace_monorepo
--- PASS: TestAccTFEWorkspace_monorepo (4.92s)
=== RUN   TestAccTFEWorkspace_renamed
--- PASS: TestAccTFEWorkspace_renamed (7.02s)
=== RUN   TestAccTFEWorkspace_update
--- PASS: TestAccTFEWorkspace_update (7.74s)
=== RUN   TestAccTFEWorkspace_updateWorkingDirectory
--- PASS: TestAccTFEWorkspace_updateWorkingDirectory (10.89s)
=== RUN   TestAccTFEWorkspace_updateFileTriggers
--- PASS: TestAccTFEWorkspace_updateFileTriggers (7.73s)
=== RUN   TestAccTFEWorkspace_updateTriggerPrefixes
--- PASS: TestAccTFEWorkspace_updateTriggerPrefixes (7.41s)
=== RUN   TestAccTFEWorkspace_updateVCSRepo
--- PASS: TestAccTFEWorkspace_updateVCSRepo (24.72s)
=== RUN   TestAccTFEWorkspace_sshKey
--- PASS: TestAccTFEWorkspace_sshKey (11.71s)
=== RUN   TestAccTFEWorkspace_import
--- PASS: TestAccTFEWorkspace_import (5.06s)
=== RUN   TestFetchWorkspaceExternalID
=== RUN   TestFetchWorkspaceExternalID/non_exisiting_organization
=== RUN   TestFetchWorkspaceExternalID/non_exisiting_workspace
=== RUN   TestFetchWorkspaceExternalID/found_workspace
--- PASS: TestFetchWorkspaceExternalID (0.23s)
    --- PASS: TestFetchWorkspaceExternalID/non_exisiting_organization (0.00s)
    --- PASS: TestFetchWorkspaceExternalID/non_exisiting_workspace (0.00s)
    --- PASS: TestFetchWorkspaceExternalID/found_workspace (0.00s)
=== RUN   TestFetchWorkspaceHumanID
=== RUN   TestFetchWorkspaceHumanID/found_workspace
=== RUN   TestFetchWorkspaceHumanID/non_exisiting_workspace
--- PASS: TestFetchWorkspaceHumanID (0.00s)
    --- PASS: TestFetchWorkspaceHumanID/found_workspace (0.00s)
    --- PASS: TestFetchWorkspaceHumanID/non_exisiting_workspace (0.00s)
=== RUN   TestPackWorkspaceID
--- PASS: TestPackWorkspaceID (0.00s)
=== RUN   TestUnpackWorkspaceID
--- PASS: TestUnpackWorkspaceID (0.00s)
FAIL
FAIL    github.com/terraform-providers/terraform-provider-tfe/tfe       564.479s
?       github.com/terraform-providers/terraform-provider-tfe/version   [no test files]

@lafentres lafentres self-assigned this May 19, 2020
@ghost ghost added the size/XXL label May 19, 2020
@lafentres lafentres force-pushed the lafentres/upgrade-terraform-plugin-sdk branch from 974e73a to 58c2550 Compare May 19, 2020 18:18
@lafentres lafentres changed the title [DRAFT] Update terraform-plugin-sdk to v1.12.0 [DRAFT] Update terraform-plugin-sdk to v1.6.0 May 19, 2020
@lafentres lafentres force-pushed the lafentres/upgrade-terraform-plugin-sdk branch from 58c2550 to d18188d Compare May 19, 2020 18:35
@lafentres lafentres changed the title [DRAFT] Update terraform-plugin-sdk to v1.6.0 [DRAFT] Update terraform-plugin-sdk to v1.12.0 May 19, 2020
@lafentres lafentres force-pushed the lafentres/upgrade-terraform-plugin-sdk branch from d18188d to 7bbbfbf Compare May 19, 2020 19:24
@lafentres lafentres force-pushed the lafentres/upgrade-terraform-plugin-sdk branch from 7bbbfbf to dfb2721 Compare June 3, 2020 19:51
@lafentres lafentres force-pushed the lafentres/upgrade-terraform-plugin-sdk branch from dfb2721 to ef026b9 Compare June 5, 2020 16:00
@lafentres lafentres changed the title [DRAFT] Update terraform-plugin-sdk to v1.12.0 Update terraform-plugin-sdk to v1.13.1 Jun 5, 2020
@lafentres lafentres marked this pull request as ready for review June 5, 2020 19:23
@lafentres lafentres requested a review from a team June 5, 2020 19:25
Copy link

@stasquatch stasquatch left a comment

Choose a reason for hiding this comment

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

Tested locally following your test steps and everything looks good to me.

Copy link
Member

@chrisarcand chrisarcand left a comment

Choose a reason for hiding this comment

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

:shipit:

@lafentres lafentres merged commit 2b2125d into master Jun 10, 2020
@lafentres lafentres deleted the lafentres/upgrade-terraform-plugin-sdk branch June 10, 2020 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants