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

feat: Add timeout_in_minutes to action block for aws_codepipeline #36316

Merged

Conversation

acwwat
Copy link
Contributor

@acwwat acwwat commented Mar 12, 2024

Description

This PR is to add the new timeout_in_minutes argument to the action block for the aws_codepipeline resource. Note that this argument only applies to manual approval steps (i.e. category = Approval and provider = Manual). For other action types, we just let the AWS API through a validation error.

Also note that timeout_in_minutes is an integer type argument, I am not able to set it to a null value in cases where it's not returned by the AWS API. Values that are not set will be stored as 0 in the state for all action blocks. The AWS API also doesn't return the non-configurable default value described in the documentation either. If there is another approach to keep the default value exact, please let me know.

Relations

Closes #36278

References

Referred to ActionDeclaration in the API reference for specs and wordings.

Output from Acceptance Testing

Note: TestAccCodePipeline_manualApprovalTimeoutInMinutes is a new test case.

$ make testacc TESTARGS="-run=TestAccCodePipeline_" PKG=codepipeline
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/codepipeline/... -v -count 1 -parallel 20  -run=TestAccCodePipeline_ -timeout 360m
=== RUN   TestAccCodePipeline_basic
=== PAUSE TestAccCodePipeline_basic
=== RUN   TestAccCodePipeline_disappears
=== PAUSE TestAccCodePipeline_disappears
=== RUN   TestAccCodePipeline_emptyStageArtifacts
=== PAUSE TestAccCodePipeline_emptyStageArtifacts
=== RUN   TestAccCodePipeline_deployWithServiceRole
=== PAUSE TestAccCodePipeline_deployWithServiceRole
=== RUN   TestAccCodePipeline_tags
=== PAUSE TestAccCodePipeline_tags
=== RUN   TestAccCodePipeline_MultiRegion_basic
=== PAUSE TestAccCodePipeline_MultiRegion_basic
=== RUN   TestAccCodePipeline_MultiRegion_update
=== PAUSE TestAccCodePipeline_MultiRegion_update
=== RUN   TestAccCodePipeline_MultiRegion_convertSingleRegion
=== PAUSE TestAccCodePipeline_MultiRegion_convertSingleRegion
=== RUN   TestAccCodePipeline_withNamespace
=== PAUSE TestAccCodePipeline_withNamespace
=== RUN   TestAccCodePipeline_withGitHubV1SourceAction
    codepipeline_test.go:479: Environment variable GITHUB_TOKEN is not set, skipping test
--- SKIP: TestAccCodePipeline_withGitHubV1SourceAction (0.00s)
=== RUN   TestAccCodePipeline_ecr
=== PAUSE TestAccCodePipeline_ecr
=== RUN   TestAccCodePipeline_pipelinetype
=== PAUSE TestAccCodePipeline_pipelinetype
=== RUN   TestAccCodePipeline_manualApprovalTimeoutInMinutes
=== PAUSE TestAccCodePipeline_manualApprovalTimeoutInMinutes
=== CONT  TestAccCodePipeline_basic
=== CONT  TestAccCodePipeline_MultiRegion_update
=== CONT  TestAccCodePipeline_ecr
=== CONT  TestAccCodePipeline_deployWithServiceRole
=== CONT  TestAccCodePipeline_withNamespace
=== CONT  TestAccCodePipeline_manualApprovalTimeoutInMinutes
=== CONT  TestAccCodePipeline_MultiRegion_convertSingleRegion
=== CONT  TestAccCodePipeline_MultiRegion_basic
=== CONT  TestAccCodePipeline_emptyStageArtifacts
=== CONT  TestAccCodePipeline_tags
=== CONT  TestAccCodePipeline_pipelinetype
=== CONT  TestAccCodePipeline_disappears
--- PASS: TestAccCodePipeline_ecr (333.83s)
--- PASS: TestAccCodePipeline_disappears (355.55s)
--- PASS: TestAccCodePipeline_withNamespace (380.77s)
--- PASS: TestAccCodePipeline_emptyStageArtifacts (387.33s)
--- PASS: TestAccCodePipeline_MultiRegion_basic (436.19s)
--- PASS: TestAccCodePipeline_deployWithServiceRole (495.10s)
--- PASS: TestAccCodePipeline_manualApprovalTimeoutInMinutes (511.73s)
--- PASS: TestAccCodePipeline_basic (529.09s)
--- PASS: TestAccCodePipeline_MultiRegion_update (582.26s)
--- PASS: TestAccCodePipeline_tags (599.13s)
--- PASS: TestAccCodePipeline_MultiRegion_convertSingleRegion (637.11s)
--- PASS: TestAccCodePipeline_pipelinetype (757.62s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline       757.806s

$

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/codepipeline Issues and PRs that pertain to the codepipeline service. and removed size/L Managed by automation to categorize the size of a PR. labels Mar 12, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 12, 2024
@acwwat acwwat force-pushed the f-aws_codepipeline-add_timeout_in_minutes_arg branch from f08b923 to 93fa57f Compare March 12, 2024 06:56
@acwwat acwwat force-pushed the f-aws_codepipeline-add_timeout_in_minutes_arg branch from 93fa57f to 880fc9e Compare March 12, 2024 06:59
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 12, 2024
# Conflicts:
#	internal/service/codepipeline/codepipeline.go
@ewbankkit ewbankkit requested a review from a team as a code owner July 17, 2024 13:18
@ewbankkit ewbankkit self-assigned this Jul 17, 2024
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccCodePipeline_' PKG=codepipeline ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.5 test ./internal/service/codepipeline/... -v -count 1 -parallel 3  -run=TestAccCodePipeline_ -timeout 360m
=== RUN   TestAccCodePipeline_basic
=== PAUSE TestAccCodePipeline_basic
=== RUN   TestAccCodePipeline_disappears
=== PAUSE TestAccCodePipeline_disappears
=== RUN   TestAccCodePipeline_emptyStageArtifacts
=== PAUSE TestAccCodePipeline_emptyStageArtifacts
=== RUN   TestAccCodePipeline_deployWithServiceRole
=== PAUSE TestAccCodePipeline_deployWithServiceRole
=== RUN   TestAccCodePipeline_tags
=== PAUSE TestAccCodePipeline_tags
=== RUN   TestAccCodePipeline_MultiRegion_basic
=== PAUSE TestAccCodePipeline_MultiRegion_basic
=== RUN   TestAccCodePipeline_MultiRegion_update
=== PAUSE TestAccCodePipeline_MultiRegion_update
=== RUN   TestAccCodePipeline_MultiRegion_convertSingleRegion
=== PAUSE TestAccCodePipeline_MultiRegion_convertSingleRegion
=== RUN   TestAccCodePipeline_withNamespace
=== PAUSE TestAccCodePipeline_withNamespace
=== RUN   TestAccCodePipeline_withGitHubV1SourceAction
    codepipeline_test.go:479: Environment variable GITHUB_TOKEN is not set, skipping test
--- SKIP: TestAccCodePipeline_withGitHubV1SourceAction (0.00s)
=== RUN   TestAccCodePipeline_ecr
=== PAUSE TestAccCodePipeline_ecr
=== RUN   TestAccCodePipeline_pipelinetype
=== PAUSE TestAccCodePipeline_pipelinetype
=== RUN   TestAccCodePipeline_manualApprovalTimeoutInMinutes
=== PAUSE TestAccCodePipeline_manualApprovalTimeoutInMinutes
=== CONT  TestAccCodePipeline_basic
=== CONT  TestAccCodePipeline_MultiRegion_update
=== CONT  TestAccCodePipeline_ecr
--- PASS: TestAccCodePipeline_ecr (22.83s)
=== CONT  TestAccCodePipeline_manualApprovalTimeoutInMinutes
--- PASS: TestAccCodePipeline_basic (40.61s)
=== CONT  TestAccCodePipeline_pipelinetype
--- PASS: TestAccCodePipeline_MultiRegion_update (41.77s)
=== CONT  TestAccCodePipeline_withNamespace
--- PASS: TestAccCodePipeline_manualApprovalTimeoutInMinutes (33.86s)
=== CONT  TestAccCodePipeline_deployWithServiceRole
--- PASS: TestAccCodePipeline_withNamespace (20.30s)
=== CONT  TestAccCodePipeline_MultiRegion_basic
--- PASS: TestAccCodePipeline_deployWithServiceRole (25.18s)
=== CONT  TestAccCodePipeline_tags
--- PASS: TestAccCodePipeline_MultiRegion_basic (25.54s)
=== CONT  TestAccCodePipeline_emptyStageArtifacts
--- PASS: TestAccCodePipeline_emptyStageArtifacts (21.42s)
=== CONT  TestAccCodePipeline_disappears
--- PASS: TestAccCodePipeline_pipelinetype (74.32s)
=== CONT  TestAccCodePipeline_MultiRegion_convertSingleRegion
--- PASS: TestAccCodePipeline_disappears (18.31s)
--- PASS: TestAccCodePipeline_tags (47.35s)
--- PASS: TestAccCodePipeline_MultiRegion_convertSingleRegion (52.46s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline	172.265s

@ewbankkit
Copy link
Contributor

@acwwat Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit c3b9b48 into hashicorp:main Jul 17, 2024
46 checks passed
@github-actions github-actions bot added this to the v5.59.0 milestone Jul 17, 2024
Copy link

This functionality has been released in v5.59.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@acwwat acwwat deleted the f-aws_codepipeline-add_timeout_in_minutes_arg branch July 20, 2024 19:07
@justinretzolk justinretzolk added the external-maintainer Contribution from a trusted external contributor. label Jul 29, 2024
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. external-maintainer Contribution from a trusted external contributor. service/codepipeline Issues and PRs that pertain to the codepipeline service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: CodePipeline - Manual Approval Timeout
3 participants