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(codecommit): make Repository a source for CodeStar Notifications #15739

Merged
merged 18 commits into from
Aug 25, 2021

Conversation

badfun
Copy link
Contributor

@badfun badfun commented Jul 23, 2021


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

@gitpod-io
Copy link

gitpod-io bot commented Jul 23, 2021

@mergify
Copy link
Contributor

mergify bot commented Jul 23, 2021

Title does not follow the guidelines of Conventional Commits. Please adjust title before merge.

@badfun badfun changed the title fix(aws-codecommit) : added codestarnotifications to repository construct fix(aws-codecommit): added codestarnotifications to repository construct Jul 23, 2021
@badfun badfun marked this pull request as ready for review July 23, 2021 21:32
@badfun
Copy link
Contributor Author

badfun commented Jul 23, 2021

@luckily @skinny85 - I have re-submitted the pull request for issue #15653 here.

@skinny85 skinny85 self-assigned this Jul 25, 2021
Copy link
Contributor

@skinny85 skinny85 left a 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;


Copy link
Contributor

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 🙂.



/**
*
Copy link
Contributor

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(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
notifyOnCommentOnCommits(
notifyOnCommitComment(

/**
* Defines a CodeStar Notification rule which triggers when a comment is made on a pull request
*/
notifyOnCommentOnPullRequests(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
notifyOnCommentOnPullRequests(
notifyOnPullRequestsComment(

Copy link
Contributor

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

Suggested change
notifyOnCommentOnPullRequests(
notifyOnPullRequestComment(

/**
* Defines a CodeStar Notification rule which triggers when an approval status is changed
*/
notifyOnApprovalsStatusChanged(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
notifyOnApprovalsStatusChanged(
notifyOnApprovalStatusChanged(

Copy link
Contributor Author

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.

Copy link
Contributor

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',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Contributor

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.

Copy link
Contributor

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',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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"
Copy link
Contributor

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".

@badfun
Copy link
Contributor Author

badfun commented Jul 29, 2021

Thanks @skinny85,
I will make the changes asap.

@skinny85
Copy link
Contributor

@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!

@mergify mergify bot dismissed skinny85’s stale review July 30, 2021 15:03

Pull request has been modified.

@badfun
Copy link
Contributor Author

badfun commented Jul 30, 2021

@skinny85 I've made most of the changes. Looking for some clarification on a few points commented above.
thanks,
Ken

Copy link
Contributor

@skinny85 skinny85 left a 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
Copy link
Contributor

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 🙂.

}


Copy link
Contributor

Choose a reason for hiding this comment

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

Still here.

@skinny85 skinny85 changed the title fix(aws-codecommit): added codestarnotifications to repository construct feat(codecommit): make Repository a source for CodeStar Notifications Jul 30, 2021
@mergify mergify bot dismissed skinny85’s stale review August 1, 2021 23:10

Pull request has been modified.

@badfun badfun requested a review from skinny85 August 1, 2021 23:13
@badfun
Copy link
Contributor Author

badfun commented Aug 1, 2021

@skinny85 I believe I got everything now. Let me know if there is something I've missed.

Copy link
Contributor

@skinny85 skinny85 left a 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!

@mergify
Copy link
Contributor

mergify bot commented Aug 25, 2021

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).

@mergify mergify bot merged commit ae34d4a into aws:master Aug 25, 2021
@mergify
Copy link
Contributor

mergify bot commented Aug 25, 2021

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: b95a5c9
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@badfun badfun deleted the add-codecommit-to-notification-source branch August 25, 2021 21:43
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this pull request Aug 26, 2021
…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*
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Sep 6, 2021
…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*
david-doyle-as24 pushed a commit to david-doyle-as24/aws-cdk that referenced this pull request Sep 7, 2021
…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*
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.

(@aws-cdk/aws-codestarnotifications): CodeCommit repository not supported as source for Notification Rule
3 participants