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(cloudwatch): add verticalAnnotations property to GraphWidget #22568

Closed
wants to merge 1 commit into from

Conversation

brendo-m
Copy link

@brendo-m brendo-m commented Oct 19, 2022

Adds a verticalAnnotation property to GraphWidget. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html#CloudWatch-Dashboard-Properties-Annotation-Format.

Also see #7622


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the p2 label Oct 19, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team October 19, 2022 22:25
@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Oct 19, 2022
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

@brendo-m brendo-m force-pushed the vertical-annotation branch 2 times, most recently from f6ca465 to 2054e46 Compare October 20, 2022 15:12
@gitpod-io
Copy link

gitpod-io bot commented Oct 20, 2022

@aws-cdk-automation aws-cdk-automation dismissed their stale review October 20, 2022 15:14

✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.

Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! This looks very close to being ready to go. Just a few comments inline.

/**
* The date and time in the graph where the vertical annotation line is to appear
*/
readonly value: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is supposed to be a timestamp, I think we should type it that way instead of as a string.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, should this be called date instead?

Copy link
Author

Choose a reason for hiding this comment

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

done

@@ -413,6 +420,11 @@ export class GraphWidget extends ConcreteWidget {
...(this.props.leftAnnotations || []).map(mapAnnotation('left')),
...(this.props.rightAnnotations || []).map(mapAnnotation('right')),
];
const verticalAnnotations = this.props.verticalAnnotations || [];
Copy link
Contributor

Choose a reason for hiding this comment

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

This line doesn't seem needed. When you check against verticalAnnotations.length you could instead just check against this.props.verticalAnnotations?.length > 0.

Copy link
Author

Choose a reason for hiding this comment

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

that doesn't compile, and we are actually referencing verticalAnnotations 3 times so this seems cleaner

@@ -53,6 +53,13 @@ dashboard.addWidgets(new cloudwatch.GraphWidget({
title: 'More messages in queue with alarm annotation',
left: [numberOfMessagesVisibleMetric],
leftAnnotations: [alarm.toAnnotation()],
verticalAnnotations: [
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to see a new test that includes these annotations instead of editing an existing test.

Copy link
Author

Choose a reason for hiding this comment

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

may I ask why? that would involve a whole lot of boilerplate setting up a new test, this was trivial to add

Copy link
Contributor

Choose a reason for hiding this comment

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

Because when we pile too much functionality into one test, it's harder to decipher if we're getting the output we're looking for and harder to troubleshoot when a test fails.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, was this test run and deployed? If so, I'd expect to see changes to more than these two files. It appears that this was run with --dry-run or that it was manually edited.

@TheRealAmazonKendra TheRealAmazonKendra changed the title feat(aws-cloudwatch): add verticalAnnotations property to GraphWidget feat(cloudwatch): add verticalAnnotations property to GraphWidget Oct 21, 2022
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

3 similar comments
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@brendo-m brendo-m force-pushed the vertical-annotation branch from 2054e46 to d759a24 Compare November 2, 2022 16:14
@mergify mergify bot dismissed TheRealAmazonKendra’s stale review November 2, 2022 16:14

Pull request has been modified.

@brendo-m brendo-m force-pushed the vertical-annotation branch from d759a24 to 19dd676 Compare November 2, 2022 16:54
Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

Back into changes requested for the integ test update I requested.

@@ -53,6 +53,13 @@ dashboard.addWidgets(new cloudwatch.GraphWidget({
title: 'More messages in queue with alarm annotation',
left: [numberOfMessagesVisibleMetric],
leftAnnotations: [alarm.toAnnotation()],
verticalAnnotations: [
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, was this test run and deployed? If so, I'd expect to see changes to more than these two files. It appears that this was run with --dry-run or that it was manually edited.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 19dd676
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@aws-cdk-automation
Copy link
Collaborator

This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error.

@aws-cdk-automation aws-cdk-automation added the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label Dec 1, 2022
@mschlaipfer
Copy link

Would be great to have vertical annotations in CDK widgets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants