Skip to content

Add GitHub v2 Authentication to CodePipeline#16959

Merged
gdavison merged 6 commits into
masterfrom
b-codepipeline-github
Jan 14, 2021
Merged

Add GitHub v2 Authentication to CodePipeline#16959
gdavison merged 6 commits into
masterfrom
b-codepipeline-github

Conversation

@gdavison

@gdavison gdavison commented Jan 4, 2021

Copy link
Copy Markdown
Contributor

Adds GitHub v2 Authentication (using CodeStar Connection) to CodePipeline and deprecates GitHub v1.

Community Note

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

Closes #15200
Closes #16042

Release note for CHANGELOG:

* resource/aws_codepipeline: Deprecates GitHub v1 (OAuth token) authentication and removes hashing of GitHub token
* resource/aws_codepipeline: Adds GitHub v2 (CodeStar Connetion) authentication

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSCodePipeline_'

--- SKIP: TestAccAWSCodePipeline_WithGitHubv1SourceAction (2.08s)
--- PASS: TestAccAWSCodePipeline_disappears (91.38s)
--- PASS: TestAccAWSCodePipeline_multiregion_basic (123.22s)
--- PASS: TestAccAWSCodePipeline_deployWithServiceRole (124.72s)
--- PASS: TestAccAWSCodePipeline_emptyStageArtifacts (125.54s)
--- PASS: TestAccAWSCodePipeline_WithNamespace (127.54s)
--- PASS: TestAccAWSCodePipeline_basic (172.57s)
--- PASS: TestAccAWSCodePipeline_multiregion_Update (175.38s)
--- PASS: TestAccAWSCodePipeline_multiregion_ConvertSingleRegion (203.24s)
--- PASS: TestAccAWSCodePipeline_tags (207.99s)

@gdavison gdavison requested a review from a team as a code owner January 4, 2021 19:25
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/codepipeline Issues and PRs that pertain to the codepipeline service. service/codestarconnections Issues and PRs that pertain to the codestarconnections service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jan 4, 2021
@bflad bflad self-assigned this Jan 12, 2021
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. bug Addresses a defect in current functionality. labels Jan 12, 2021
Comment thread aws/provider_test.go
}
}

func testAccEnvironmentVariableSetPreCheck(variable string, t *testing.T) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not for this PR, but we could replace some other acceptance testing environment handling we have if this could have a custom message (usually a description of what the environment variable is needed for) and this returned the value as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've created #17083

Comment thread aws/resource_aws_codepipeline.go
},
{
Config: testAccAWSCodePipelineConfig_backToBasic(name, githubToken),
Config: testAccAWSCodePipelineConfig_backToBasic(name),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure if related to changes here, but this test step is failing for me locally and in TeamCity:

=== CONT  TestAccAWSCodePipeline_multiregion_ConvertSingleRegion
    resource_aws_codepipeline_test.go:380: Step 3/4 error: Error running apply:
        Error: region cannot be set for a single-region CodePipeline


--- FAIL: TestAccAWSCodePipeline_multiregion_ConvertSingleRegion (62.80s)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a pre-existing error with Terraform 0.14, though it passes with Terraform 0.12.29

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Heh, I created #16706 in December

@bflad bflad self-requested a review January 13, 2021 00:03

@bflad bflad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good 🚀

Output from acceptance testing in AWS Commercial:

--- FAIL: TestAccAWSCodePipeline_multiregion_ConvertSingleRegion (60.26s) # known test failure
--- PASS: TestAccAWSCodePipeline_basic (60.85s)
--- PASS: TestAccAWSCodePipeline_deployWithServiceRole (36.29s)
--- PASS: TestAccAWSCodePipeline_disappears (28.09s)
--- PASS: TestAccAWSCodePipeline_emptyStageArtifacts (29.98s)
--- PASS: TestAccAWSCodePipeline_multiregion_basic (40.22s)
--- PASS: TestAccAWSCodePipeline_multiregion_Update (57.81s)
--- PASS: TestAccAWSCodePipeline_tags (76.03s)
--- PASS: TestAccAWSCodePipeline_WithGitHubv1SourceAction (52.87s)
--- PASS: TestAccAWSCodePipeline_WithNamespace (30.38s)

Output from acceptance testing in AWS GovCloud (US):

--- SKIP: TestAccAWSCodePipeline_basic (2.73s)
--- SKIP: TestAccAWSCodePipeline_deployWithServiceRole (2.72s)
--- SKIP: TestAccAWSCodePipeline_disappears (1.42s)
--- SKIP: TestAccAWSCodePipeline_emptyStageArtifacts (2.75s)
--- SKIP: TestAccAWSCodePipeline_multiregion_basic (0.36s)
--- SKIP: TestAccAWSCodePipeline_multiregion_ConvertSingleRegion (0.35s)
--- SKIP: TestAccAWSCodePipeline_multiregion_Update (1.84s)
--- SKIP: TestAccAWSCodePipeline_tags (1.40s)
--- SKIP: TestAccAWSCodePipeline_WithGitHubv1SourceAction (1.30s)
--- SKIP: TestAccAWSCodePipeline_WithNamespace (1.42s)

@gdavison gdavison merged commit 4474070 into master Jan 14, 2021
@gdavison gdavison deleted the b-codepipeline-github branch January 14, 2021 18:43
@github-actions github-actions Bot added this to the v3.24.0 milestone Jan 14, 2021
gdavison added a commit that referenced this pull request Jan 14, 2021
@ghost

ghost commented Jan 15, 2021

Copy link
Copy Markdown

This has been released in version 3.24.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 for triage. Thanks!

@ghost

ghost commented Feb 14, 2021

Copy link
Copy Markdown

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Addresses a defect in current functionality. documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/codepipeline Issues and PRs that pertain to the codepipeline service. service/codestarconnections Issues and PRs that pertain to the codestarconnections service. size/XL Managed by automation to categorize the size of a PR. 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.

Add CodePipeline GitHub version 2 source action support aws_codepipeline with Github OAuth still breaking auth

3 participants