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(cloudfront): distribution ARN property #32531

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

nmussy
Copy link
Contributor

@nmussy nmussy commented Dec 15, 2024

Issue # (if applicable)

Closes #32530

Reason for this change

Give the user access to a distribution's ARN via the existing distributionId value.

Description of changes

Implemented by proxying the existing formatDistributionArn function via a getter method.

Description of how you validated changes

Unit tests were added for both created and imported distributions.

Additionally, missing coverage for Distribution.fromDistributionAttributes was added, by copying the existing unit test for CloudFrontWebDistribution.fromDistributionAttributes.

Checklist


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 feature-request A feature should be added or improved. p2 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Dec 15, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team December 15, 2024 18:43
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.

@nmussy
Copy link
Contributor Author

nmussy commented Dec 15, 2024

Exemption Request:

  • A unit test should be sufficient, given there is no real added feature, just a getter method that uses an already relied upon function.
  • The generated documentation should also be sufficient, adding an example on how to access a property would add needless noise

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Dec 15, 2024
Copy link

codecov bot commented Dec 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.80%. Comparing base (d1bb1ca) to head (0833411).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #32531   +/-   ##
=======================================
  Coverage   78.80%   78.80%           
=======================================
  Files         108      108           
  Lines        7159     7159           
  Branches     1319     1319           
=======================================
  Hits         5642     5642           
  Misses       1332     1332           
  Partials      185      185           
Flag Coverage Δ
suite.unit 78.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 78.80% <ø> (ø)

@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 Dec 15, 2024
Copy link
Contributor

@tmokmss tmokmss left a comment

Choose a reason for hiding this comment

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

Nice, thanks! 😄

@aws-cdk-automation aws-cdk-automation added pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Dec 16, 2024
@tmokmss
Copy link
Contributor

tmokmss commented Dec 16, 2024

I found a typo in the PR title btw (cloudfornt)

@nmussy nmussy changed the title feat(cloudfornt): distribution ARN property feat(cloudfront): distribution ARN property Dec 16, 2024
@nmussy
Copy link
Contributor Author

nmussy commented Dec 16, 2024

I found a typo in the PR title btw (cloudfornt)

Whoops, thanks. I thought the PR linter checked for existing packages?

EDIT: Must have confused it with this rule:

/**
* Check that the PR title uses the typical convention for package names.
*
* For example, "fix(s3)" is preferred over "fix(aws-s3)".
*/
function validateTitleScope(pr: GitHubPr): TestResult {
const result = new TestResult();
const scopesExemptFromThisRule = ['aws-cdk-lib'];
// Specific commit types are handled by `validateTitlePrefix`. This just checks whether
// the scope includes an `aws-` prefix or not.
// Group 1: Scope with parens - "(aws-<name>)"
// Group 2: Scope name - "aws-<name>"
// Group 3: Preferred scope name - "<name>"
const titleRe = /^\w+(\((aws-([\w_-]+))\))?: /;
const m = titleRe.exec(pr.title);
if (m && !scopesExemptFromThisRule.includes(m[2])) {
result.assessFailure(
!!(m[2] && m[3]),
`The title of the pull request should omit 'aws-' from the name of modified packages. Use '${m[3]}' instead of '${m[2]}'.`,
);
}
return result;
}

@godwingrs22 godwingrs22 self-assigned this Dec 16, 2024
@godwingrs22 godwingrs22 self-requested a review December 16, 2024 20:29
@godwingrs22 godwingrs22 removed their assignment Dec 16, 2024
Copy link
Member

@godwingrs22 godwingrs22 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @nmussy for the contribution.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Dec 16, 2024
@godwingrs22 godwingrs22 added pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-readme The PR linter will not require README changes labels Dec 16, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review December 16, 2024 20:51

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

Copy link
Contributor

mergify bot commented Dec 16, 2024

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: 0833411
  • 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 b7e6141 into aws:main Dec 16, 2024
18 checks passed
Copy link
Contributor

mergify bot commented Dec 16, 2024

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

Copy link

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 Dec 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK feature-request A feature should be added or improved. p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-readme The PR linter will not require README 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.

cloudfront: expose ARN for Distribution
4 participants