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

fix(codebuild): remove oauthToken property from source #2252

Merged
merged 4 commits into from
Apr 16, 2019

Conversation

Kaixiang-AWS
Copy link
Contributor

@Kaixiang-AWS Kaixiang-AWS commented Apr 12, 2019

Auth field should not be set since it's ignored by CodeBuild
https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ProjectSource.html#CodeBuild-Type-ProjectSource-auth

Refactored some unit tests as well

BREAKING CHANGE: customers who use GitHub, GitHubEnterprise or Bitbucket as source
will need to remove the oauthToken field as it's no longer available

Fixes #2199


Pull Request Checklist

  • Testing
    • Unit test added (prefer not to modify an existing test, otherwise, it's probably a breaking change)
    • CLI change?: coordinate update of integration tests with team
    • cdk-init template change?: coordinated update of integration tests with team
  • Docs
    • jsdocs: All public APIs documented
    • README: README and/or documentation topic updated
  • Title and Description
    • Change type: title prefixed with fix, feat will appear in changelog
    • Title: use lower-case and doesn't end with a period
    • Breaking?: last paragraph: "BREAKING CHANGE: <describe what changed + link for details>"
    • Issues: Indicate issues fixed via: "Fixes #xxx" or "Closes #xxx"
  • Sensitive Modules (requires 2 PR approvers)
    • IAM Policy Document (in @aws-cdk/aws-iam)
    • EC2 Security Groups and ACLs (in @aws-cdk/aws-ec2)
    • Grant APIs (only if not based on official documentation with a reference)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.

Auth field should not be set since it's ignored by CodeBuild
https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ProjectSource.html#CodeBuild-Type-ProjectSource-auth

BREAKING CHANGE: customers who use GitHub, GitHubEnterprise or Bitbucket as source
will need to remove the oauthToken field as it's no longer available

Fixes aws#2199
@Kaixiang-AWS Kaixiang-AWS requested review from RomainMuller, skinny85 and a team as code owners April 12, 2019 00:41
@@ -261,7 +251,6 @@ export class GitHubSource extends GitBuildSource {

protected toSourceProperty(): any {
return {
auth: { type: 'OAUTH', resource: this.oauthToken },
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is correct. I believe you still need to supply auth: { type: 'OAUTH' } here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Kaixiang-AWS can you confirm whether the auth: { type: 'OAUTH' } is still required here, even without the Token?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have updated the PR and added an integ test against github source to make sure it can deploy.

I can confirm that auth field is not required. There might be an issue with the doc. I will report it to the doc writer and ask him to update the doc.

@@ -103,7 +100,7 @@ This source type can be used to build code from a BitBucket repository.

## Environment

By default, projects use a small instance with an Ubuntu 14.04 image. You
By default, projects use a small instance with an Ubuntu 18.04 image. You
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for not mentioning that in the PR. I have already pushed a commit to change the image, but forgot to update the documentation in the previous commit.

87b1ea0

@rix0rrr
Copy link
Contributor

rix0rrr commented Apr 12, 2019

I think it would also be good to add an example of an ImportCredentials call. Can you add this to the README in a section title "Using GitHub repositories" or something similar?

aws codebuild import-source-credentials --server-type GITHUB --auth-type PERSONAL_ACCESS_TOKEN --token <token_value>

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.

GitHub source authentication works differently
3 participants