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

fix(region-info): facts only returned from constant region list #27506

Merged
merged 9 commits into from
Oct 24, 2023

Conversation

msambol
Copy link
Contributor

@msambol msambol commented Oct 11, 2023

Facts are only being returned from the regions in a constant list.
This PR returns facts for all Regions in AWS_REGIONS + this.database.

Closes #27260.


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 October 11, 2023 23:31
@github-actions github-actions bot added admired-contributor [Pilot] contributed between 13-24 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p2 labels Oct 11, 2023
@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 Oct 12, 2023
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

@returns the list of names of AWS regions for which there is at least one registered fact.

In my opionion updating the regions() method to return Array.from(Object.keys(this.database)) is the way to go here.
Also, the PR should be a fix.

@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 Oct 12, 2023
@msambol
Copy link
Contributor Author

msambol commented Oct 12, 2023

@lpizzinidev Updated per your feedback—thanks!

@msambol msambol changed the title chore(region-info): update fact not found error message fix(region-info): registering a fact for a new region should add the region Oct 12, 2023
@msambol msambol changed the title fix(region-info): registering a fact for a new region should add the region fix(region-info): update register logic for adding fact with new region Oct 12, 2023
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.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@msambol
Copy link
Contributor Author

msambol commented Oct 12, 2023

@lpizzinidev For this, I think it makes sense to ignore the linter error about integration tests?

Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

Thanks 👍
I agree that an integration test is not necessary in this case.
Also, the title should be updated to describe the bug fixed.

packages/aws-cdk-lib/region-info/test/region-info.test.ts Outdated Show resolved Hide resolved
@msambol msambol changed the title fix(region-info): update register logic for adding fact with new region fix(region-info): facts only returned from constant region list, missing facts added to new region Oct 13, 2023
@msambol msambol changed the title fix(region-info): facts only returned from constant region list, missing facts added to new region fix(region-info): facts only returned from constant region list Oct 13, 2023
@msambol
Copy link
Contributor Author

msambol commented Oct 13, 2023

@lpizzinidev I updated the title per your recommendation.

Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

Thanks! 👍

@msambol
Copy link
Contributor Author

msambol commented Oct 16, 2023

@kaizencc Can you this be approved/merged without the linter passing?

@msambol
Copy link
Contributor Author

msambol commented Oct 21, 2023

Exemption Request

region-info doesn't have integration tests.

@aws-cdk-automation aws-cdk-automation added pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-maintainer-review This PR needs a review from a Core Team Member labels Oct 21, 2023
@mrgrain
Copy link
Contributor

mrgrain commented Oct 23, 2023

This has been "static" for a long time now:
#17984

I'm also concerned that we are using this list in other places and rely on it containing all regions.

Can we change the code and description so that it includes all AWS Regions plus any custom defined regions?

@msambol
Copy link
Contributor Author

msambol commented Oct 24, 2023

@mrgrain Updated per your recommendation. Thanks!

@mrgrain mrgrain added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Oct 24, 2023
@aws-cdk-automation aws-cdk-automation dismissed their stale review October 24, 2023 13:12

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

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Oct 24, 2023
@mergify
Copy link
Contributor

mergify bot commented Oct 24, 2023

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@mergify mergify bot merged commit 7121c7e into aws:main Oct 24, 2023
9 checks passed
@mergify
Copy link
Contributor

mergify bot commented Oct 24, 2023

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

mrgrain pushed a commit that referenced this pull request Nov 1, 2023
Facts are only being returned from the regions in a constant list.
This PR returns facts for all Regions in `AWS_REGIONS` + `this.database`.

Closes #27260.

----

*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
admired-contributor [Pilot] contributed between 13-24 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

region-info: Fact.regions behavior does not match description.
4 participants