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

HPR-1173: Channel Restriction Management #555

Merged
merged 16 commits into from
Jul 31, 2023

Conversation

aidan-mundy
Copy link
Contributor

@aidan-mundy aidan-mundy commented Jul 19, 2023

🛠️ Description

Depends on an upcoming change to the Packer API and hcp-sdk-go

  • Remove the deprecated iteration block from hcp_packer_channel
    • Closes HPR-1176
  • Add support for managing channel restriction with hcp_packer_channel
    • Closes HPR-1173
  • Add support for importing and "creating" (automatic adoption during the create step) for HCP Managed channels
  • Parallelize some Packer tests
    • Results in the Packer portion of the acceptance test suite running ~45% faster! 🎉
    • Work to parallelize tests for the image/iteration data sources is captured in HPR-1232

🏗️ Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

$ make testacc TESTARGS='-run=.*Packer.* -test.v'
==> Checking that code complies with gofmt requirements...
golangci-lint run --config ./golangci-config.yml 
TF_ACC=1 go test ./internal/... -v -run=.*Packer.* -test.v -timeout 360m -parallel=10
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/clients    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/consul     (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/input      (cached) [no tests to run]
=== RUN   TestAcc_dataSourcePackerBucketNames
--- PASS: TestAcc_dataSourcePackerBucketNames (15.84s)
=== RUN   TestAcc_dataSourcePacker
--- PASS: TestAcc_dataSourcePacker (3.99s)
=== RUN   TestAcc_dataSourcePacker_revokedIteration
--- PASS: TestAcc_dataSourcePacker_revokedIteration (9.23s)
=== RUN   TestAcc_dataSourcePackerImage
--- PASS: TestAcc_dataSourcePackerImage (6.26s)
=== RUN   TestAcc_dataSourcePackerImage_revokedIteration
--- PASS: TestAcc_dataSourcePackerImage_revokedIteration (4.05s)
=== RUN   TestAcc_dataSourcePackerImage_emptyChannel
--- PASS: TestAcc_dataSourcePackerImage_emptyChannel (1.00s)
=== RUN   TestAcc_dataSourcePackerImage_channelAndIterationIDReject
--- PASS: TestAcc_dataSourcePackerImage_channelAndIterationIDReject (2.38s)
=== RUN   TestAcc_dataSourcePackerImage_channelAccept
--- PASS: TestAcc_dataSourcePackerImage_channelAccept (4.30s)
=== RUN   TestAcc_dataSourcePackerIteration
--- PASS: TestAcc_dataSourcePackerIteration (4.22s)
=== RUN   TestAcc_dataSourcePackerIteration_revokedIteration
--- PASS: TestAcc_dataSourcePackerIteration_revokedIteration (9.47s)
=== RUN   TestAcc_dataSourcePackerRunTask
--- PASS: TestAcc_dataSourcePackerRunTask (6.21s)
=== RUN   TestAccPackerChannelAssignment_SimpleSetUnset
=== PAUSE TestAccPackerChannelAssignment_SimpleSetUnset
=== RUN   TestAccPackerChannelAssignment_AssignLatest
=== PAUSE TestAccPackerChannelAssignment_AssignLatest
=== RUN   TestAccPackerChannelAssignment_InvalidInputs
=== PAUSE TestAccPackerChannelAssignment_InvalidInputs
=== RUN   TestAccPackerChannelAssignment_CreateFailsWhenPreassigned
=== PAUSE TestAccPackerChannelAssignment_CreateFailsWhenPreassigned
=== RUN   TestAccPackerChannelAssignment_HCPManagedChannelErrors
=== PAUSE TestAccPackerChannelAssignment_HCPManagedChannelErrors
=== RUN   TestAccPackerChannelAssignment_EnforceNull
=== PAUSE TestAccPackerChannelAssignment_EnforceNull
=== RUN   TestAccPackerChannel
=== PAUSE TestAccPackerChannel
=== RUN   TestAccPackerChannel_HCPManaged
=== PAUSE TestAccPackerChannel_HCPManaged
=== RUN   TestAccPackerChannel_RestrictionDrift
=== PAUSE TestAccPackerChannel_RestrictionDrift
=== RUN   TestAccPackerChannel_RestrictionDriftHCPManaged
=== PAUSE TestAccPackerChannel_RestrictionDriftHCPManaged
=== RUN   TestAccPackerRunTask
--- PASS: TestAccPackerRunTask (19.40s)
=== CONT  TestAccPackerChannelAssignment_SimpleSetUnset
=== CONT  TestAccPackerChannelAssignment_EnforceNull
=== CONT  TestAccPackerChannel_RestrictionDrift
=== CONT  TestAccPackerChannel_RestrictionDriftHCPManaged
=== CONT  TestAccPackerChannelAssignment_HCPManagedChannelErrors
=== CONT  TestAccPackerChannelAssignment_CreateFailsWhenPreassigned
=== CONT  TestAccPackerChannelAssignment_InvalidInputs
=== CONT  TestAccPackerChannelAssignment_AssignLatest
=== CONT  TestAccPackerChannel_HCPManaged
=== CONT  TestAccPackerChannel
--- PASS: TestAccPackerChannelAssignment_HCPManagedChannelErrors (3.92s)
--- PASS: TestAccPackerChannelAssignment_InvalidInputs (5.11s)
--- PASS: TestAccPackerChannelAssignment_CreateFailsWhenPreassigned (7.56s)
--- PASS: TestAccPackerChannelAssignment_SimpleSetUnset (10.40s)
--- PASS: TestAccPackerChannelAssignment_AssignLatest (12.96s)
--- PASS: TestAccPackerChannel (13.77s)
--- PASS: TestAccPackerChannel_HCPManaged (14.60s)
--- PASS: TestAccPackerChannel_RestrictionDriftHCPManaged (14.95s)
--- PASS: TestAccPackerChannel_RestrictionDrift (15.00s)
--- PASS: TestAccPackerChannelAssignment_EnforceNull (22.90s)
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider   109.727s

@aidan-mundy aidan-mundy added the enhancement New feature or request label Jul 19, 2023
@aidan-mundy aidan-mundy force-pushed the HPR-1173/channel-restriction-management branch 2 times, most recently from 793b305 to 629a830 Compare July 24, 2023 20:05
@aidan-mundy aidan-mundy reopened this Jul 28, 2023
@aidan-mundy aidan-mundy force-pushed the HPR-1173/channel-restriction-management branch 3 times, most recently from 89c7608 to babb9b7 Compare July 28, 2023 18:27
@aidan-mundy aidan-mundy marked this pull request as ready for review July 28, 2023 18:27
@aidan-mundy aidan-mundy requested a review from a team as a code owner July 28, 2023 18:27
@aidan-mundy aidan-mundy force-pushed the HPR-1173/channel-restriction-management branch from babb9b7 to 97d6a64 Compare July 28, 2023 19:31
Copy link
Contributor

@sylviamoss sylviamoss left a comment

Choose a reason for hiding this comment

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

👍🏼

.changelog/555.txt Outdated Show resolved Hide resolved
.changelog/555.txt Outdated Show resolved Hide resolved
internal/clients/packer.go Show resolved Hide resolved
internal/provider/resource_packer_channel.go Show resolved Hide resolved
@aidan-mundy aidan-mundy force-pushed the HPR-1173/channel-restriction-management branch from 97d6a64 to 739e9d3 Compare July 31, 2023 15:39
@hashicorp hashicorp deleted a comment from sylviamoss Jul 31, 2023
@aidan-mundy aidan-mundy merged commit 2f09806 into main Jul 31, 2023
5 checks passed
@aidan-mundy aidan-mundy deleted the HPR-1173/channel-restriction-management branch July 31, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants