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

refactor(cli): generate yargs configuration from TS #31850

Merged
merged 29 commits into from
Nov 5, 2024

Conversation

comcalvi
Copy link
Contributor

@comcalvi comcalvi commented Oct 22, 2024

Issue # (if applicable)

N/A

Reason for this change

We'd like to create a programmatic interface to the CDK Toolkit. A bonus of this overhaul is moving to a single source of truth for both the programmatic interface to the CDK Toolkit and the command line interface to the CDK Toolkit. This PR generates the existing yargs configuration from a TS configuration. In the long term, we'd generate the yargs configuration purely from the programmatic interface to the Toolkit, but this is an improvement with less effort.

Description of changes

Creates a new package, @aws-cdk/yargs-gen, which generates our yargs configuration from a CliConfig defined in aws-cdk/config.ts using @cdklabs/typewriter.

Description of how you validated changes

N/A yet.

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 the p2 label Oct 22, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team October 22, 2024 17:00
@comcalvi comcalvi changed the title Comcalvi/cli yargs code gen feat (CLI): generate yargs arguments from a TS configuration Oct 22, 2024
@comcalvi comcalvi changed the title feat (CLI): generate yargs arguments from a TS configuration feat (CLI): generate yargs configuration from TS Oct 22, 2024
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 22, 2024
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.

@aws-cdk-automation aws-cdk-automation added the pr/needs-cli-test-run This PR needs CLI tests run against it. label Oct 22, 2024
@mrgrain
Copy link
Contributor

mrgrain commented Oct 23, 2024

I'm a inclined the check the generated code in for visibility and reviewability. WDYT?

@comcalvi
Copy link
Contributor Author

My first instinct was to follow the codegen pattern we have for L1s, which is to ignore them, but the nature of the yargs code is very different from that of the L1s, so I agree that checking this file in is good. I've added it.

@aws-cdk-automation
Copy link
Collaborator

➡️ PR build request submitted to test-main-pipeline ⬅️

A maintainer must now check the pipeline and add the pr-linter/cli-integ-tested label once the pipeline succeeds.

@mrgrain mrgrain changed the title feat(CLI): generate yargs configuration from TS feat(cli): generate yargs configuration from TS Nov 5, 2024
@mrgrain mrgrain changed the title feat(cli): generate yargs configuration from TS refactor(cli): generate yargs configuration from TS Nov 5, 2024
@mrgrain mrgrain marked this pull request as ready for review November 5, 2024 11:50
@mrgrain mrgrain added pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested and removed pr/needs-cli-test-run This PR needs CLI tests run against it. labels Nov 5, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 5, 2024 11:52

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Copy link
Contributor

mergify bot commented Nov 5, 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).

@mergify mergify bot merged commit 4f8ecae into main Nov 5, 2024
20 of 21 checks passed
@mergify mergify bot deleted the comcalvi/cli-yargs-code-gen branch November 5, 2024 12:20
Copy link

github-actions bot commented Nov 5, 2024

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 Nov 5, 2024
@mrgrain mrgrain added pr/do-not-merge This PR should not be merged at this time. and removed pr/do-not-merge This PR should not be merged at this time. labels Nov 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contribution/core This is a PR that came from AWS. p2 pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested 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.

3 participants