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(codebuild): add support for setting the gitCloneDepth property on Project sources #1798

Merged
merged 1 commit into from
Feb 20, 2019

Conversation

skinny85
Copy link
Contributor

Also fixed the weird casing of the 'GitHubEnterPrise' SourceType enum value while I was in the area.

Fixes #1789


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.

…n Project sources.

Also fixed the weird casing of the 'GitHubEnterPrise' SourceType enum value while I was in the area.

Fixes aws#1789
@skinny85 skinny85 requested review from RomainMuller and a team as code owners February 19, 2019 23:53
repository: codecommit.IRepository;
}

/**
* CodeCommit Source definition for a CodeBuild project.
*/
export class CodeCommitSource extends BuildSource {
export class CodeCommitSource extends GitBuildSource {
Copy link
Contributor

Choose a reason for hiding this comment

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

BTW, based on our discussions around #1743, this class should technically be in CodeCommit...

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 think you're probably right, but that seems like a separate change.

/**
* A common superclass of all build sources that are backed by Git.
*/
export abstract class GitBuildSource extends BuildSource {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is an example of over-modeling. Now what happens if we have another Git source that's not in the codebuild package, then what...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I was so proud of how I DRYied it up... 😭

What alternative would you propose here Elad?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just duplicate. Sometimes it's too DRY

Copy link
Contributor

Choose a reason for hiding this comment

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

But I am okay with this too :-D

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 can't. I can't bear myself to copy & paste cloneDepth after I've so beautifully applied inheritance and the Decorator pattern here. My object-oriented programming education forbids me.

I'll leave this as is for now, feel free to open a separate PR changing this behind my back 😃

@@ -318,7 +349,7 @@ export enum SourceType {
CodeCommit = 'CODECOMMIT',
CodePipeline = 'CODEPIPELINE',
GitHub = 'GITHUB',
GitHubEnterPrise = 'GITHUB_ENTERPRISE',
Copy link
Contributor

Choose a reason for hiding this comment

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

LOLx

@skinny85 skinny85 merged commit 5408a53 into aws:master Feb 20, 2019
@skinny85 skinny85 deleted the fix/codebuild-gitclonedepth branch February 20, 2019 22:27
eladb pushed a commit that referenced this pull request Feb 26, 2019
…n Project sources. (#1798)

Also fixed the weird casing of the 'GitHubEnterPrise' SourceType enum value while I was in the area.

Fixes #1789
@NGL321 NGL321 added the contribution/core This is a PR that came from AWS. label Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to specify GitCloneDepth in codebuild.Project
3 participants