GithubHelp home page GithubHelp logo

cdk-diff-action's Introduction

cdk-diff-action's People

Contributors

corymhall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hranum

cdk-diff-action's Issues

Fails with error "Body is too long" for apps with many stacks/stages

Hi @corymhall , I tried using this action on a private repo with many stacks to replace a different (but worse) diff tool. You know which repo. It has a lot of stacks and it seems like this causes the action to fail with the following error:

Error commenting stages:  RequestError [HttpError]: Validation Failed: {"resource":"IssueComment","code":"unprocessable","field":"data","message":"Body is too long (maximum is 65536 characters)"}

Maybe an option to have a comment per stack? Or do some clever magic to shorten the body?

GitHub Actions can't find the @v1 version of the action

It seems the example in the readme file is using @v1 as the version of the action. GitHub can't find this version. Using @v1.0.0 works, so I guess there either needs to be a new tag/release with just v1 or the example should be updated to use v1.0.0.

The action itself works really well, thank you!

Support `diffForStages` and `failOnDestructiveChanges`

This is basically the inverse of the current noDiffForStages and noFailOnDestructiveChanges.

But that's probably just one solution to my actual use case:

  • I have a large app with many stacks/stages across different regions
  • For reasons, I cannot have a single role that can perform diff for all stages across all regions
  • I am looking for a way to group my stacks into multiple jobs that each use a different role and diff a subset of stages
  • Currently I have to exclude the unwanted stages, which causes a lot of repetition.

PS: Not using failOnDestructiveChanges. Just threw this in for good measure. ๐Ÿ˜‚

Ignore certain stages

Add the ability to ignore certain stages.

  1. Ignore stages completely
  2. Show the diff, but don't fail anything for the stage

handle authentication issues

I don't think we are currently handling authentication issues very well. We should at a minimum

  • Compare the credentials with the stack account and if they don't match, throw an error
  • Log a warning if the lookup role is not found

Feature Request: Allow to run this on subfolders

The action should accept an optional "subfolder" where the CDK project lives. This is useful for monorepo projects, where there might be a folder for backend, folder for frontend and folder for IaC, rather than everything being in the root.

Update PR description instead of making a comment

Will it be possible to post to the PR description instead of commenting on the PR?

This will reduce noise, because GitHub notifies for every comment created on a PR. I am not sure if the PR description length will be the limiting factor here. If it does, maybe post to the PR description first, but if it is too long, truncate and create the rest as comments.

Error commenting stages: Error: Comment for stack foobar is too long, please report this as a bug

#32 is fixed and works great, however we are still getting the following error for one of the stacks. Reporting this for completeness. FWIW I think we are getting this because the diff (incorrectly, but probably a configuration issue on my end) believes this is a new stack and so it just lists all changes which is very long.

Further ideas for fixing:

  • truncate if needed
  • maybe there's a way to give github extra long strings, just not as a comment?
  • The IAM change list is very long. It's obviously useful though.
Run corymhall/cdk-diff-action@e154417b2bd6f6c53234d7432043044d965e69d5
  
Error commenting stages:  Error: Comment for stack foobar is too long, please report this as a bug https://github.com/corymhall/cdk-diff-action/issues/new
Error: Comment for stack foobar is too long, please report this as a bug https://github.com/corymhall/cdk-diff-action/issues/new
    at StageProcessor.commentStacks (/home/runner/work/_actions/corymhall/cdk-diff-action/e154417b2bd6f6c53234d7432043044d965e69d5/lib/stage-processor.js:94:1)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at StageProcessor.commentStages (/home/runner/work/_actions/corymhall/cdk-diff-action/e154417b2bd6f6c53234d7432043044d965e69d5/lib/stage-processor.js:[12](https://github.com/cdklabs/cdk-ops/actions/runs/7299188526/job/19891550494?pr=3055#step:8:13)5:1)
    at run (/home/runner/work/_actions/corymhall/cdk-diff-action/e154417b2bd6f6c53234d7432043044d965e69d5/lib/action.js:61:1)
Error performing diff:  Error: Comment for stack foobar is too long, please report this as a bug https://github.com/corymhall/cdk-diff-action/issues/new
    at StageProcessor.commentStacks (/home/runner/work/_actions/corymhall/cdk-diff-action/e154417b2bd6f6c53234d7432043044d965e69d5/lib/stage-processor.js:94:1)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at StageProcessor.commentStages (/home/runner/work/_actions/corymhall/cdk-diff-action/e154417b2bd6f6c53234d7432043044d965e69d5/lib/stage-processor.js:125:1)
    at run (/home/runner/work/_actions/corymhall/cdk-diff-action/e[15](https://github.com/cdklabs/cdk-ops/actions/runs/7299188526/job/19891550494?pr=3055#step:8:16)44[17](https://github.com/cdklabs/cdk-ops/actions/runs/7299188526/job/19891550494?pr=3055#step:8:18)b2bd6f6c53234d743[20](https://github.com/cdklabs/cdk-ops/actions/runs/7299188526/job/19891550494?pr=3055#step:8:21)43044d965e69d5/lib/action.js:61:1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.