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): allow setting the Project's logging configuration #11444

Merged
merged 14 commits into from
Nov 19, 2020

Conversation

wulfmann
Copy link
Contributor

@wulfmann wulfmann commented Nov 12, 2020

Fixes: #3856


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 Nov 12, 2020

@mergify
Copy link
Contributor

mergify bot commented Nov 12, 2020

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

@wulfmann wulfmann changed the title feat(codebuild): add logsConfig option feat(aws-codebuild): add logsConfig option Nov 12, 2020
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 @wulfmann !

I'd like to see the used classes changed a little bit (including their names), but looks pretty solid!

packages/@aws-cdk/aws-codebuild/lib/project.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project.ts Outdated Show resolved Hide resolved
@wulfmann
Copy link
Contributor Author

@skinny85 I've updated the changes you requested.

One thing i'm curious about is how would I implement a helper to allow for both of these log configurations? Would I add another class that implements ProjectLogs like the others? A config can have both s3 and cloudwatch configurations.

@skinny85
Copy link
Contributor

One thing i'm curious about is how would I implement a helper to allow for both of these log configurations? Would I add another class that implements ProjectLogs like the others? A config can have both s3 and cloudwatch configurations.

Oh shit. Is that really allowed?

@wulfmann
Copy link
Contributor Author

wulfmann commented Nov 16, 2020

Oh shit. Is that really allowed?

Yep, see the logs config section here

@skinny85
Copy link
Contributor

Damn. I was not aware of that. I thought you could only have a single type of logs active in a given Project. In that case, your original design might be better 😕.

Would you mind going back to the firs revision of this R?

Apologies for the churn ❤️.

@wulfmann
Copy link
Contributor Author

Sure I’ll go back. In thinking about this, we might as well allow the enabled/disabled flag too. This might be the use case:

Cloudwatch logging is enabled by default so if you only wanted to send to s3, you would have to pass in the cloudwatch block with disabled.

Let me know your thoughts on that!

@skinny85
Copy link
Contributor

skinny85 commented Nov 17, 2020

Cloudwatch logging is enabled by default so if you only wanted to send to s3, you would have to pass in the cloudwatch block with disabled.

Let me know your thoughts on that!

Sure, but kill the enum. Just make it an enabled?: boolean property, which defaults to true.

@skinny85
Copy link
Contributor

Also, thanks!

@wulfmann
Copy link
Contributor Author

Ok should be good to go for another review!

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 @wulfmann ! Looks very good. Some comments below.

packages/@aws-cdk/aws-codebuild/lib/project-logs.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project-logs.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project-logs.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project-logs.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project-logs.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project-logs.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/package.json Outdated Show resolved Hide resolved
@mergify mergify bot dismissed skinny85’s stale review November 18, 2020 12:28

Pull request has been modified.

@wulfmann
Copy link
Contributor Author

@skinny85 Alright I've made the corrections you suggested. Let me know if you see anything else that should be changed!

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.

We're almost there @wulfmann , thanks for your patience!

The biggest thing is the naming: make sure all places use camelCase, so CloudWatch, not Cloudwatch.

Thanks!

packages/@aws-cdk/aws-codebuild/lib/project.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project-logs.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project-logs.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-codebuild/lib/project.ts Outdated Show resolved Hide resolved
@mergify mergify bot dismissed skinny85’s stale review November 19, 2020 15:20

Pull request has been modified.

@wulfmann
Copy link
Contributor Author

@skinny85 Alright ready for another round. I appreciate your thoroughness!!

@wulfmann wulfmann changed the title feat(aws-codebuild): add logsConfig option feat(aws-codebuild): add logging options Nov 19, 2020
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 fantastic. Thanks for the great contribution @wulfmann , and for your patience in dealing with my barrage of comments! 😬

@mergify
Copy link
Contributor

mergify bot commented Nov 19, 2020

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

@skinny85 skinny85 changed the title feat(aws-codebuild): add logging options feat(codebuild): allow setting the Project's logging configuration Nov 19, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 3ceba4e
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify
Copy link
Contributor

mergify bot commented Nov 19, 2020

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 6a4b22d into aws:master Nov 19, 2020
skinny85 added a commit to skinny85/aws-cdk that referenced this pull request Dec 23, 2020
In aws#11444, we added the option of setting the logging configuration of the Project.
Unfortuantely, the Project's Role was not given permissions to write into that destination,
which means executing the Project's build would fail.

Fixes aws#12179
mergify bot pushed a commit that referenced this pull request Dec 23, 2020
…2213)

In #11444, we added the option of setting the logging configuration of the Project.
Unfortuantely, the Project's Role was not given permissions to write into that destination,
which means executing the Project's build would fail.

Fixes #12179

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
flochaz pushed a commit to flochaz/aws-cdk that referenced this pull request Jan 5, 2021
…s#12213)

In aws#11444, we added the option of setting the logging configuration of the Project.
Unfortuantely, the Project's Role was not given permissions to write into that destination,
which means executing the Project's build would fail.

Fixes aws#12179

----

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

CodeBuild: Add support for logging configuration in Project
3 participants