core: `diff` should imply `--fail` by default
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
Rather than a separate `--fail` flag, `cdk diff` should return a non-zero exit code if there is a diff. This would provide more information to the end user, making it easier to automate `cdk diff` commands.
### Expected Behavior
`cdk diff` should return zero if there is no difference, and a non-zero exit code if there is a difference.
### Current Behavior
`cdk diff` returns a zero exit code if there is a difference.
### Reproduction Steps
Run `cdk diff` on a stack with differences.
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### CDK CLI Version
2.93.0 (build 724bd01)
### Framework Version
_No response_
### Node.js Version
v18.17.1
### OS
NixOS
### Language
Typescript
### Language Version
5.2.2
### Other information
_No response_
Contributor guide
Research direction
The issue names the cdk diff CLI entry point but no source file or test. First run cdk diff on a stack with differences and on one without, then trace the command's exit-status handling. Done means no differences return zero and differences return non-zero.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100