-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
…n Project sources. Also fixed the weird casing of the 'GitHubEnterPrise' SourceType enum value while I was in the area. Fixes aws#1789
repository: codecommit.IRepository; | ||
} | ||
|
||
/** | ||
* CodeCommit Source definition for a CodeBuild project. | ||
*/ | ||
export class CodeCommitSource extends BuildSource { | ||
export class CodeCommitSource extends GitBuildSource { |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOLx
Also fixed the weird casing of the 'GitHubEnterPrise' SourceType enum value while I was in the area.
Fixes #1789
Pull Request Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.