-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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(codecommit): make Repository a source for CodeStar Notifications #15739
feat(codecommit): make Repository a source for CodeStar Notifications #15739
Conversation
…b.com/badfun/aws-cdk into add-codecommit-to-notification-source
Title does not follow the guidelines of Conventional Commits. Please adjust title before merge. |
@luckily @skinny85 - I have re-submitted the pull request for issue #15653 here. |
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.
Looks great @badfun, thanks for the contribution!
A few comments, mainly around naming.
@@ -110,8 +123,128 @@ export interface IRepository extends IResource { | |||
* Grant the given identity permissions to read this repository. | |||
*/ | |||
grantRead(grantee: iam.IGrantable): iam.Grant; | |||
|
|||
|
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.
One empty line too many 🙂.
|
||
|
||
/** | ||
* |
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.
No need for this empty line.
/** | ||
* Defines a CodeStar Notification rule which triggers when a comment is made on a commit. | ||
*/ | ||
notifyOnCommentOnCommits( |
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.
notifyOnCommentOnCommits( | |
notifyOnCommitComment( |
/** | ||
* Defines a CodeStar Notification rule which triggers when a comment is made on a pull request | ||
*/ | ||
notifyOnCommentOnPullRequests( |
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.
notifyOnCommentOnPullRequests( | |
notifyOnPullRequestsComment( |
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.
Apologies, this should actually be
notifyOnCommentOnPullRequests( | |
notifyOnPullRequestComment( |
/** | ||
* Defines a CodeStar Notification rule which triggers when an approval status is changed | ||
*/ | ||
notifyOnApprovalsStatusChanged( |
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.
notifyOnApprovalsStatusChanged( | |
notifyOnApprovalStatusChanged( |
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.
Shouldn't this stay plural, to match the event itself: 'codecommit-repository-approvals-status-changed'?
I prefer the singular myself for camel-case, but the event is plural.
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'm fine using a different name.
/** | ||
* Trigger notification when a branch or tag is created | ||
*/ | ||
BRANCHES_AND_TAGS_CREATED = 'codecommit-repository-branches-and-tags-created', |
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.
BRANCHES_AND_TAGS_CREATED = 'codecommit-repository-branches-and-tags-created', | |
BRANCH_OR_TAG_CREATED = 'codecommit-repository-branches-and-tags-created', |
/** | ||
* Trigger notification when a branch or tag is deleted | ||
*/ | ||
BRANCHES_AND_TAGS_DELETED = 'codecommit-repository-branches-and-tags-deleted', |
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.
BRANCHES_AND_TAGS_DELETED = 'codecommit-repository-branches-and-tags-deleted', | |
BRANCH_OR_TAG_DELETED = 'codecommit-repository-branches-and-tags-deleted', |
import * as events from '@aws-cdk/aws-events'; | ||
import * as iam from '@aws-cdk/aws-iam'; | ||
import { IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; | ||
import { Construct } from 'constructs'; | ||
import { CfnRepository } from './codecommit.generated'; | ||
|
||
export interface IRepository extends IResource { | ||
/** | ||
* Additional options to pass to the notification rule |
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.
Docs should be complete sentences, with fullstops.
Same comment everywhere in the PR.
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.
Still not resolved I see 🙂.
/** | ||
* Trigger notification when a branch or tag is updated | ||
*/ | ||
BRANCHES_AND_TAGS_UPDATED = 'codecommit-repository-branches-and-tags-updated', |
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.
BRANCHES_AND_TAGS_UPDATED = 'codecommit-repository-branches-and-tags-updated', | |
BRANCH_OR_TAG_UPDATED = 'codecommit-repository-branches-and-tags-updated', |
@@ -98,7 +99,8 @@ | |||
"@aws-cdk/aws-events": "0.0.0", | |||
"@aws-cdk/aws-iam": "0.0.0", | |||
"@aws-cdk/core": "0.0.0", | |||
"constructs": "^3.3.69" | |||
"constructs": "^3.3.69", | |||
"@aws-cdk/aws-codestarnotifications": "0.0.0" |
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.
Please put this at the beginning of the list, like you did for "dependencies"
.
Thanks @skinny85, |
@badfun please re-request my review (there's a button in the top-right of the PR window, next to my avatar) once you're ready for another round of reviews. Thanks for the contribution! |
@skinny85 I've made most of the changes. Looking for some clarification on a few points commented above. |
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.
Let's change the names according to my comments (I'm fine with the fact that they are not identical to the event names).
import * as events from '@aws-cdk/aws-events'; | ||
import * as iam from '@aws-cdk/aws-iam'; | ||
import { IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; | ||
import { Construct } from 'constructs'; | ||
import { CfnRepository } from './codecommit.generated'; | ||
|
||
export interface IRepository extends IResource { | ||
/** | ||
* Additional options to pass to the notification rule |
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.
Still not resolved I see 🙂.
} | ||
|
||
|
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.
Still here.
…b.com/badfun/aws-cdk into add-codecommit-to-notification-source
@skinny85 I believe I got everything now. Let me know if there is something I've missed. |
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.
Thanks for the contribution @badfun!
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…aws#15739) ---- Fixes aws#15653 Notification rule can be created for CodeCommit Repository events using @aws-cdk/aws-codestarnotifications *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…aws#15739) ---- Fixes aws#15653 Notification rule can be created for CodeCommit Repository events using @aws-cdk/aws-codestarnotifications *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…aws#15739) ---- Fixes aws#15653 Notification rule can be created for CodeCommit Repository events using @aws-cdk/aws-codestarnotifications *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Fixes #15653
Notification rule can be created for CodeCommit Repository events using @aws-cdk/aws-codestarnotifications
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license