Skip to content

Conversation

@Kasra-G
Copy link
Contributor

@Kasra-G Kasra-G commented Jun 18, 2025

Issue # (if applicable)

Closes #28929

Reason for this change

Cloudwatch Dashboard console has this option but cdk GraphWidget does not

Description of changes

  • adds a new optional boolean parameter to GraphWidgetProps called displayLabelsOnChart
    • naming obtained from description of the option in the AWS Console
  • updates aws-cloudwatch README.md with sample usage

Describe any new or updated permissions being added

N/A

Description of how you validated changes

Created new unit and integration test and ran them

Checklist


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

@aws-cdk-automation aws-cdk-automation requested a review from a team June 18, 2025 05:38
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Jun 18, 2025
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.

(This review is outdated)

@Kasra-G Kasra-G changed the title feat(aws-cloudwatch): add option to show labels on pie chart feat(cloudwatch): add option to show labels on pie chart Jun 18, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review June 18, 2025 05:51

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

@Kasra-G Kasra-G marked this pull request as ready for review June 18, 2025 05:54
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 18, 2025
@Kasra-G Kasra-G force-pushed the ft/aws-cloudwatch/labeled-pie branch from f2c794c to b120954 Compare June 19, 2025 08:13
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

*
* @default false
*/
readonly displayLabelsOnChart?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this applies specifically to pie charts, the name can be more specific:

Suggested change
readonly displayLabelsOnChart?: boolean;
readonly displayLabelsOnPieChart?: boolean;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this depends on how confident we are that cloudwatch won't add more widgets in the future that have the same option to show labels on the graph. Ideally we would have something like a PieGraph class so we could have props that only make sense for pie charts. I think that would be too big of a change for this feature, though.

I plan on just adding the validation and extra unit test. Please let me know if you disagree, and if we should still move forward with the rename.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this depends on how confident we are that cloudwatch won't add more widgets in the future that have the same option to show labels on the graph

I did think about, but I saw the comment above stating that it is for Pie charts only, which is what prompted the suggestion.

I think it's fine to keep the current naming, but let's update the JSdoc to clarify that this only works for Pie charts for now.

}]);
});

test('add displayLabelsOnChart to GraphWidget', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a test which verifies what happens when the graph type is not a pie chart.

@vishaalmehrishi vishaalmehrishi self-assigned this Aug 20, 2025
@vishaalmehrishi
Copy link
Contributor

Hi @Kasra-G , just checking if you need any further feedback/support to update this PR.

@Kasra-G
Copy link
Contributor Author

Kasra-G commented Aug 28, 2025

Thanks for the check-in. Haven't had a chance to make the changes yet, I do intend on getting that done before the PR gets marked stale

@Kasra-G Kasra-G force-pushed the ft/aws-cloudwatch/labeled-pie branch from b120954 to 94295c3 Compare September 1, 2025 02:24
@mergify mergify bot dismissed vishaalmehrishi’s stale review September 1, 2025 02:24

Pull request has been modified.

@Kasra-G
Copy link
Contributor Author

Kasra-G commented Sep 1, 2025

Not sure why request-cli-integ-test is failing, I simply squashed, rebased to tip of mainline, and force pushed. I suppose I could look through my reflog and force push back to the previous version.

Edit: Force pushed back to the previous version and I guess the check is still failing. Not sure what I can do, my guess is that the check itself is broken given I see several other open PRs with the same error

@Kasra-G Kasra-G force-pushed the ft/aws-cloudwatch/labeled-pie branch from 94295c3 to b120954 Compare September 1, 2025 02:33
@Kasra-G
Copy link
Contributor Author

Kasra-G commented Sep 1, 2025

@vishaalmehrishi I have made the appropriate changes but for some reason the PR code build is not rerunning and I am getting some file not found error in the request-cli-integ-test/cli-changes workflow, even when I pushed the commit you previously reviewed which had no workflow issues prior. Not sure how I can resolve that.

I noticed my other PR is also not running the PR code build, did that change recently?

@Kasra-G
Copy link
Contributor Author

Kasra-G commented Sep 1, 2025

Seems the issue might be that pr code build only runs for branches targeting v2-release. Any reason why we wouldn't want these builds running for pull requests targeting main?

https://github.com/aws/aws-cdk/blob/main/.github/workflows/codebuild-pr-build.yml#L12-L13

@mergify
Copy link
Contributor

mergify bot commented Sep 1, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Contributor

mergify bot commented Sep 1, 2025

This pull request has been removed from the queue for the following reason: checks failed.

The merge conditions cannot be satisfied due to failing checks:

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@mergify
Copy link
Contributor

mergify bot commented Sep 1, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@vishaalmehrishi
Copy link
Contributor

@Mergifyio requeue

@mergify
Copy link
Contributor

mergify bot commented Sep 1, 2025

requeue

✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Sep 1, 2025
@mergify
Copy link
Contributor

mergify bot commented Sep 1, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Contributor

mergify bot commented Sep 1, 2025

Thank you for contributing! Your pull request will be updated from main 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 83f0a61 into aws:main Sep 1, 2025
18 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2025

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2025
@Kasra-G Kasra-G deleted the ft/aws-cloudwatch/labeled-pie branch September 2, 2025 03:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(aws-cloudwatch): support labels on pie charts

3 participants