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

CodeBuild SourceVersion #5777

Closed
2 tasks
knorms101 opened this issue Jan 13, 2020 · 4 comments
Closed
2 tasks

CodeBuild SourceVersion #5777

knorms101 opened this issue Jan 13, 2020 · 4 comments
Assignees
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild feature-request A feature should be added or improved. in-progress This issue is being actively worked on.

Comments

@knorms101
Copy link
Contributor

I would like to be able to specify the sourceVersion associated with a CodeBuild project.

new cb.Project(this, projectName, {
    source: cb.Source.gitHub({
        owner: githubOwner,
        repo: githubRepo,
      }),
    sourceVersion: "branch-name",
});

Use Case

To specify which Github branch CodeBuild should use for its source version.

Proposed Solution

Would need to add an optional sourceVersion property that errors if a source isn't specified.
https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-codebuild/lib/project.ts#L521

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@knorms101 knorms101 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jan 13, 2020
@SomayaB SomayaB added the @aws-cdk/aws-codebuild Related to AWS CodeBuild label Jan 13, 2020
@skinny85
Copy link
Contributor

skinny85 commented Jan 13, 2020

Hey @knorms101 ,

thanks for opening the issue, but I think I would solve it differently :).

I think we should add an optional property branch to the GitHubProps interface, and then an optional sourceVersion property to the SourceConfig interface, and populate it from the GitHubSource class. Finally, render it in the main Project class' constructor.

Would you be interested in submitting us a PR with this feature @knorms101 ?

Thanks,
Adam

@skinny85 skinny85 removed the needs-triage This issue or PR still needs to be triaged. label Jan 13, 2020
@knorms101
Copy link
Contributor Author

Hello @skinny85,

I'm happy to submit a PR for this! And I prefer your solution, so I'll plan on submitting a PR with that implementation later this week or early next week.

Thanks,
Katie

@SomayaB SomayaB added the in-progress This issue is being actively worked on. label Jan 21, 2020
@SomayaB
Copy link
Contributor

SomayaB commented Jan 21, 2020

Thanks for opening a PR @knorms101, much appreciated! 👍

mergify bot added a commit that referenced this issue Feb 4, 2020
* feat(aws-codebuild): allow github sourceversion branch
Addresses issue #5777.Users may want to specify which github branch a codebuild should use as its source. Currently the branch always defaults to 'master', but users may want to test features in development on other branches

* add required documentation

* add sourceVersion to all CodeBuild sources. Add secondarySourceVersions option

* unify version on GitSource to branch or ref. fix indentation. remove unused property. only render secondary sources versions when present.

* update s3 name to version

* remove duplication

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
@skinny85
Copy link
Contributor

skinny85 commented Feb 6, 2020

This was done in #5890 . Thanks again for the contribution @knorms101 !

@skinny85 skinny85 closed this as completed Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild feature-request A feature should be added or improved. in-progress This issue is being actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants