Conversation
This PR refactors the diff and assembly processing to use the new `@aws-cdk/toolkit-lib` library. This allows us to greatly simplify the logic that we have to maintain and offload more work to the core library. For example, this allows us to use the default CDK authentication instead of trying to replicate it ourselves (see #62). Couple of other changes that I've included in this PR since v2 allows me a chance to make breaking changes. BREAKING CHANGE: several breaking changes with details below There are several breaking changes in this release. 1. Replace `noDiffForStages` with `stackSelectionStrategy` & `stackSelectorPatterns` This uses the native selection stack filtering capability of `toolkit-lib` and should be a more robust option for users to filter stacks. `stackSelectorPatterns` also uses a multi-line input instead of a comma delimited string input. To migrate from `noDiffForStages` to `stackSelectorPatterns` you can do this: ```yaml - name: Diff uses: corymhall/cdk-diff-action@v1 with: noDiffForStages: "Stage1,Stage2" githubToken: ${{ secrets.GITHUB_TOKEN }} - name: Diff uses: corymhall/cdk-diff-action@v2-beta with: stackSelectorPatterns: | !Stage1/* !Stage2/* githubToken: ${{ secrets.GITHUB_TOKEN }} ``` 2. The default `diffMethod` is changed to `change-set` to match the cdk default behavior. This also changes the IAM Role used for diff from the `lookup-role` to the `deploy-role`. To keep the old behavior you can specify `diffMethod: template-only` 3. `allowDestroyTypes` and `noFailOnDestructiveChanges` input types were changed from a comma delimited string to a multi-line string. ```yaml - name: Diff uses: corymhall/cdk-diff-action@v1 with: noFailOnDestructiveChanges: "Stage1,Stage2" githubToken: ${{ secrets.GITHUB_TOKEN }} - name: Diff uses: corymhall/cdk-diff-action@v2-beta with: noFailOnDestructiveChanges: | Stage1 Stage2 githubToken: ${{ secrets.GITHUB_TOKEN }} ``` Closes #44 Fixes #62 --------- Signed-off-by: github-actions <github-actions@github.com> Co-authored-by: github-actions <github-actions@github.com>
This adds two new inputs to the action. 1. `title` an optional title to include with each stage comment 2. `defaultStageDisplayName` an optional name to use for the default stage instead of `DefaultStage` closes #130 --------- Signed-off-by: github-actions <github-actions@github.com> Co-authored-by: github-actions <github-actions@github.com>
This upgrades toolkit-lib to the latest version which fixes the libCheck typechecking. In the latest version toolkit-lib also updates the diff to use the stack display name instead of the name/id so this updates the action to also use the display name.
This is the first step in attempting to solve the case when diff comments are too long. From testing it looks like the comment limit that the API returns (65535) is not the real limit, but it is hard to find any concrete information on what the real limit is. I was able to post some comments with a length > 150000. Instead of doing any validation on our end and failing early, this PR updates the logic to rely on the GH API failure message. We will always attempt to comment and catch any "Body too long" errors that occur. This should increase the size of the comment allowed and may fix the issue for some users. I will follow up this with additional PRs fixing the issue completely. re #34
Add ISO formatted timestamp to PR comments. fixes #132
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refactors the diff and assembly processing to use the new
@aws-cdk/toolkit-liblibrary.This allows us to greatly simplify the logic that we have to maintain
and offload more work to the core library.
For example, this allows us to use the default CDK authentication
instead of trying to replicate it ourselves (see #62).
Couple of other changes that I've included in this PR since v2 allows me
a chance to make breaking changes.
BREAKING CHANGE: several breaking changes with details below
There are several breaking changes in this release.
noDiffForStageswithstackSelectionStrategy&stackSelectorPatternsThis uses the native selection stack filtering capability of
toolkit-liband should be a more robust option for users to filterstacks.
stackSelectorPatternsalso uses a multi-line input instead ofa comma delimited string input. To migrate from
noDiffForStagestostackSelectorPatternsyou can do this:diffMethodis changed tochange-setto match the cdkdefault behavior. This also changes the IAM Role used for diff from the
lookup-roleto thedeploy-role. To keep the old behavior you canspecify
diffMethod: template-onlyallowDestroyTypesandnoFailOnDestructiveChangesinput types werechanged from a comma delimited string to a multi-line string.
Closes #44
Fixes #62
Signed-off-by: github-actions github-actions@github.com
Co-authored-by: github-actions github-actions@github.comFixes #