Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aws/aws-cdk-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: [email protected]
Choose a base ref
...
head repository: aws/aws-cdk-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: [email protected]
Choose a head ref
  • 3 commits
  • 40 files changed
  • 3 contributors

Commits on Sep 3, 2025

  1. fix: notices key in cdk.json is not respected (#821)

    Fixes #724
    
    ## Description
    Setting `"notices": false` in cdk.json doesn't suppress notices.
    
    The root cause is that we handle logic to determine whether we should
    print notices at *yargs*. Yargs had a default value determined by a
    helper function (`YARGS_HELPERS.shouldDisplayNotices()`) that returned
    true when not in CI, or when in a safe CI.
    
    This meant that any setting in our configuration would be overwritten by
    the output of this helper, because it looks like it's coming from the
    command line!
    
    ## Solution
    
    Centralize logic for notices in `cli.ts`.
    
    Made the notices option in yargs `undefined` by default. Moved the logic
    from `YARGS_HELPERS.shouldDisplayNotices()` into the `cli.ts`. This has
    several implications.
    - Setting `notices` in config now functions as expected; it will still
    not override the command line setting
    - If a CDK app is running in a CI environment where it would not be safe
    to print notices
    - NEW BEHAVIOR: Notices WILL be printed if `notices: true` or `notices:
    [truthy value]` is set in config
    - Notices WILL be printed if flag `--notices` is passed, and NOT printed
    if `--no-notices` / `--notices=false` is passed at the command line (was
    already the case)
    
    **Caveat: `"notices": "false"` in the config will suppress notices, but
    other "truthy" values will cause them to be printed.**
    
    ### Testing
    Added unit tests to verify the hierarchy of behavior:
    1. Flags in CLI (`--notices` or `--no-notices`)
    2. Setting in configuration (`"notices": false` in cdk.json)
    3. Print notices if not in CI or in CI where it is safe
    
    ---
    By submitting this pull request, I confirm that my contribution is made
    under the terms of the Apache-2.0 license
    
    ---------
    
    Signed-off-by: github-actions <[email protected]>
    Co-authored-by: github-actions <[email protected]>
    iankhou and github-actions authored Sep 3, 2025
    Configuration menu
    Copy the full SHA
    1ab5a09 View commit details
    Browse the repository at this point in the history
  2. fix(cli): cdk flags --set without additional options should fail (#833)

    Fixes #832 
    
    Currently, running `cdk flags --set` or `cdk flags --set --recommended`
    is a no-op. Either the `--all` or `--unconfigured` options should be
    passed alongside `--set`. This can be attributed to insufficient testing
    during development of the feature.
    
    Changes:
    - Added validation to fix the problem above
    - Brought `flag-operations.ts` to 100% unit test line coverage
    (previously 92%)
    
    <img width="1498" height="137" alt="Screenshot 2025-09-03 at 12 41 21"
    src="https://github.com/user-attachments/assets/1a9ad22d-4a78-411a-bb09-de4975d8752a"
    />
    
    Validated with unit tests and manual testing.
    
    ---
    By submitting this pull request, I confirm that my contribution is made
    under the terms of the Apache-2.0 license
    
    ---------
    
    Signed-off-by: github-actions <[email protected]>
    Co-authored-by: github-actions <[email protected]>
    iankhou and github-actions authored Sep 3, 2025
    Configuration menu
    Copy the full SHA
    a890d3f View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2025

  1. feat: refactor execution (#674)

    This change introduces the creation and execution of stack refactors. It
    builds on previous work that put all the pieces in place (mapping
    computation, mapping file reading, exclude lists, dry-run etc). The
    following flowcharts summarize the behavior in interactive and
    non-interactive modes, for each environment in the application:
    
    #### Non-interactive case
    
    ```mermaid
    flowchart LR
        mapping{Refactor file present?}
        empty{Empty mapping?}
        dryrun{--dry-run?}
        compute[Compute mapping]
        use[Use mapping]
        print[Print mapping]
        mapping ---|No| compute
        mapping ---|Yes| use
        compute --- empty
        use --- empty
        empty ---|Yes| Exit
        empty ---|No| print
        print --- dryrun
        dryrun ---|Yes| Exit
        dryrun ---|No| Refactor
        Refactor --- Exit
    ```
    
    #### Interactive case
    
    ```mermaid
    flowchart LR
        mapping{Refactor file present?}
        empty{Empty mapping?}
        dryrun{--dry-run?}
        force{--force?}
        compute[Compute mapping]
        use[Use mapping]
        print[Print mapping]
        ask[Ask user]
        mapping ---|No| compute
        mapping ---|Yes| use
        compute --- empty
        use --- empty
        empty ---|Yes| Exit
        empty ---|No| print
        print --- dryrun
        dryrun ---|Yes| Exit
        dryrun ---|No| force
        force ---|Yes| Refactor
        force ---|No| ask
        ask ---|Yes| Refactor
        ask ---|No| Exit
        Refactor --- Exit
    ```
    
    Closes #140.
    
    ---
    By submitting this pull request, I confirm that my contribution is made
    under the terms of the Apache-2.0 license
    otaviomacedo authored Sep 5, 2025
    Configuration menu
    Copy the full SHA
    aef751e View commit details
    Browse the repository at this point in the history
Loading