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(core): does not generate a valid artifact id from some construct IDs #33863

Merged
merged 6 commits into from
Mar 21, 2025

Conversation

mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Mar 21, 2025

Issue

Closes #32808

Minimal reproduction:

const app = new cdk.App();
const stack = new cdk.Stack(app, 'Stack:Test', { stackName: "valid" });
assert(!stack.artifactId.match(/[^A-Za-z0-9_\-\.]/g))

Reason for this change

When users create a Stack with an id containing certain special characters, the produced artifact file name would contain invalid characters.

Description of changes

Ensure only valid artifact files names are produces, no matter the input.

Describe any new or updated permissions being added

n/a

Description of how you validated changes

New unit tests, existing test suite

I have updated the integ test using --dry-run as per instructions in the test file.
I have deployed the integ test using the instructions in the test file.

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 March 21, 2025 14:01
@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p1 labels Mar 21, 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)

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Mar 21, 2025
Copy link

codecov bot commented Mar 21, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.38%. Comparing base (3ff5501) to head (273143a).

❌ Your patch check has failed because the patch coverage (50.00%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33863   +/-   ##
=======================================
  Coverage   82.38%   82.38%           
=======================================
  Files         120      120           
  Lines        6937     6938    +1     
  Branches     1170     1170           
=======================================
+ Hits         5715     5716    +1     
  Misses       1119     1119           
  Partials      103      103           
Flag Coverage Δ
suite.unit 82.38% <50.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
packages/aws-cdk ∅ <ø> (∅)
packages/aws-cdk-lib/core 82.38% <50.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mrgrain mrgrain changed the title fix(core): does not generate valid stack name from some construct IDs fix(core): does not generate a valid artifact id from some construct IDs Mar 21, 2025
@mrgrain mrgrain marked this pull request as ready for review March 21, 2025 15:01
@mrgrain mrgrain requested a review from a team as a code owner March 21, 2025 15:01
@mrgrain mrgrain added pr-linter/exempt-codecov The PR linter will not require codecov checks to pass pr-linter/exempt-integ-test The PR linter will not require integ test changes labels Mar 21, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review March 21, 2025 15:07

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

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Mar 21, 2025
Copy link
Contributor

mergify bot commented Mar 21, 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).

@mrgrain mrgrain added the pr/do-not-merge This PR should not be merged at this time. label Mar 21, 2025
Copy link
Contributor

mergify bot commented Mar 21, 2025

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

Pull request #33863 has been dequeued. The pull request rule doesn't match anymore. The following conditions don't match anymore:

  • -label~=(blocked|do-not-merge|no-squash|two-approvers|priority-pr)
  • status-success=validate-pr
  • status-success~=AWS CodeBuild us-east-1
  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default-squash]
      • any of: [🛡 GitHub branch protection]
        • check-neutral = validate-pr
        • check-skipped = validate-pr
        • check-success = validate-pr
      • any of: [🛡 GitHub branch protection]
        • check-neutral = AWS CodeBuild us-east-1 (AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv)
        • check-skipped = AWS CodeBuild us-east-1 (AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv)
        • check-success = AWS CodeBuild us-east-1 (AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv)

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you can post a @mergifyio requeue comment.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Mar 21, 2025
@mrgrain mrgrain removed the pr/do-not-merge This PR should not be merged at this time. label Mar 21, 2025
@mrgrain
Copy link
Contributor Author

mrgrain commented Mar 21, 2025

@Mergifyio requeue

Copy link
Contributor

mergify bot commented Mar 21, 2025

requeue

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

Copy link
Contributor

mergify bot commented Mar 21, 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 6a5638a into main Mar 21, 2025
29 of 31 checks passed
@mergify mergify bot deleted the mrgrain/fix/core/stack-names branch March 21, 2025 18:49
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 Mar 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort p1 pr-linter/exempt-codecov The PR linter will not require codecov checks to pass pr-linter/exempt-integ-test The PR linter will not require integ test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-codepipeline-actions: Problem Cloning the AWS CDK Repository on Windows
4 participants