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

[Do not merge] Add hcp_packer_bucket, hcp_packer_bucket_iam_binding, and hcp_packer_bucket_iam_policy resources #866 #852

Merged
merged 9 commits into from
Jul 2, 2024

Conversation

JenGoldstrich
Copy link
Contributor

@JenGoldstrich JenGoldstrich commented May 30, 2024

🛠️ Description

Add HCP Packer Bucket Resource with some acceptance testing.

🏗️ Acceptance tests

  • Are there any feature flags that are required to use this functionality?
  • 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=TestAccPackerBucket*'
==> Checking that code complies with gofmt requirements...
golangci-lint run --config ./golangci-config.yml
TF_ACC=1 go test ./internal/... -v -run=TestAccPackerBucket* -timeout 360m -parallel=10
?       github.com/hashicorp/terraform-provider-hcp/internal/clients/iampolicy  [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/clients/packerv2   [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider   [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/clients    0.725s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/consul     0.386s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/hcpvalidator       0.258s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/input      0.681s [no tests to run]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/acctest   [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/customtypes       [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/iam/helper        [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/modifiers [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer    [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils  [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/configbuilder    [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/configbuilder/packerconfig       [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/testcheck        [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/testclient       [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/utils      [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/utils/base [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/utils/location     [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/iam       1.351s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/logstreaming      0.868s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/datasources/artifact       2.224s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/datasources/version        1.763s [no tests to run]
=== RUN   TestAccPackerBucketIamPolicyResource
--- PASS: TestAccPackerBucketIamPolicyResource (7.95s)
=== RUN   TestAccPackerBucketIamBindingResource
--- PASS: TestAccPackerBucketIamBindingResource (7.10s)
=== RUN   TestAccPackerBucketResource
--- PASS: TestAccPackerBucketResource (5.74s)
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/resources/bucket   23.498s
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/resourcemanager   1.993s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/vaultsecrets      2.373s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/waypoint  2.853s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/webhook   3.354s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/webhook/validator 2.686s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/providersdkv2      3.097s [no tests to run]

...

@JenGoldstrich JenGoldstrich changed the title WIP -> [HPR 1729] hcp_packer_bucket resource WIP -> hcp_packer_bucket resource May 30, 2024
@JenGoldstrich JenGoldstrich force-pushed the hpr-1729-bucket-resource branch 3 times, most recently from 7bcaea3 to 174398c Compare May 31, 2024 15:06
@JenGoldstrich JenGoldstrich changed the title WIP -> hcp_packer_bucket resource Add hcp_packer_bucket resource May 31, 2024
@JenGoldstrich JenGoldstrich marked this pull request as ready for review May 31, 2024 15:12
@JenGoldstrich JenGoldstrich requested review from a team as code owners May 31, 2024 15:12
@JenGoldstrich JenGoldstrich force-pushed the hpr-1729-bucket-resource branch from 174398c to 4b96f3c Compare May 31, 2024 15:26
@JenGoldstrich JenGoldstrich marked this pull request as draft May 31, 2024 21:57
@JenGoldstrich JenGoldstrich force-pushed the hpr-1729-bucket-resource branch 5 times, most recently from e0a8a58 to bf86bb9 Compare June 3, 2024 21:14
@JenGoldstrich JenGoldstrich marked this pull request as ready for review June 3, 2024 21:26
@JenGoldstrich JenGoldstrich requested a review from a team as a code owner June 3, 2024 23:42
@JenGoldstrich JenGoldstrich force-pushed the hpr-1729-bucket-resource branch from babd3f9 to 3084a33 Compare June 4, 2024 06:29
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.

LGTM 👍🏼

I added a comment about parsing the resource name to get the bucket name and project ID, which is unnecessary because you also have those values from the state.

@JenGoldstrich JenGoldstrich changed the title Add hcp_packer_bucket resource [Do not merge] Add hcp_packer_bucket resource Jun 4, 2024
@JenGoldstrich JenGoldstrich force-pushed the hpr-1729-bucket-resource branch 2 times, most recently from 7ec5de7 to 8cf049e Compare June 4, 2024 22:30
@JenGoldstrich JenGoldstrich force-pushed the hpr-1729-bucket-resource branch from 73e1d84 to 9a9c057 Compare June 5, 2024 18:09
@JenGoldstrich JenGoldstrich force-pushed the hpr-1729-bucket-resource branch from 9a9c057 to df6c4bc Compare June 17, 2024 14:52
@JenGoldstrich JenGoldstrich changed the title [Do not merge] Add hcp_packer_bucket resource [Do not merge] Add hcp_packer_bucket & hcp_packer_bucket_iam_binding & hcp_packer_bucket_iam_policy resources #866 Jun 17, 2024
@JenGoldstrich JenGoldstrich changed the title [Do not merge] Add hcp_packer_bucket & hcp_packer_bucket_iam_binding & hcp_packer_bucket_iam_policy resources #866 [Do not merge] Add hcp_packer_bucket, hcp_packer_bucket_iam_binding, and hcp_packer_bucket_iam_policy resources #866 Jun 17, 2024
@JenGoldstrich JenGoldstrich force-pushed the hpr-1729-bucket-resource branch from fc57e35 to 8f4bcaa Compare June 18, 2024 15:19
@JenGoldstrich JenGoldstrich force-pushed the hpr-1729-bucket-resource branch from 8f4bcaa to 6a44b00 Compare June 28, 2024 17:41
@sylviamoss
Copy link
Contributor

Test after rebase and error handling updates

 make testacc TESTARGS='-run=TestAccPackerBucket*'
==> Checking that code complies with gofmt requirements...
golangci-lint run --config ./golangci-config.yml 
TF_ACC=1 go test ./internal/... -v -run=TestAccPackerBucket* -timeout 360m -parallel=10
?       github.com/hashicorp/terraform-provider-hcp/internal/clients/iampolicy  [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/clients/packerv2   [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/customdiags        [no test files]
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/hcpvalidator       (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]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider   [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/acctest   [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/customtypes       [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/iam/helper        [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/modifiers [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer    [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/iam       (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/logstreaming      (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/datasources/artifact       (cached) [no tests to run]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils  [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/configbuilder    [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/configbuilder/packerconfig       [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/testcheck        [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/testclient       [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/utils      [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/utils/base [no test files]
?       github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/utils/location     [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/datasources/version        (cached) [no tests to run]
=== RUN   TestAccPackerBucketIamPolicyResource
--- PASS: TestAccPackerBucketIamPolicyResource (16.64s)
=== RUN   TestAccPackerBucketIamBindingResource
--- PASS: TestAccPackerBucketIamBindingResource (9.12s)
=== RUN   TestAccPackerBucketResource
--- PASS: TestAccPackerBucketResource (8.60s)
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/resources/bucket   (cached)
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/resourcemanager   (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/vaultsecrets      (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/waypoint  (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/webhook   (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider/webhook/validator (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/providersdkv2      (cached) [no tests to run]

@sylviamoss sylviamoss merged commit d3ec11f into main Jul 2, 2024
6 checks passed
@sylviamoss sylviamoss deleted the hpr-1729-bucket-resource branch July 2, 2024 16:11
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.

3 participants