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

[BUG] all changes regardless of type are grouped incorrectly into modified_files in danger.git #1446

Open
xphir opened this issue May 7, 2024 · 0 comments
Labels

Comments

@xphir
Copy link

xphir commented May 7, 2024

Describe the bug

Since version 12.0.1, all changes (including deletions, creations, and modifications) are incorrectly grouped under modified_files. The created_files and deleted_files arrays remain empty, even when there are clearly file creations or deletions.

To Reproduce
Steps to reproduce the behavior:

  1. On version 11.3.1, create a dangerfile.ts as follows:
import { danger} from "danger"

console.log("Created", danger.git.created_files)
console.log("Deleted", danger.git.deleted_files)
console.log("Modified", danger.git.modified_files)
  1. Run the command npx danger pr https://github.com/danger/danger-js/pull/9.
  2. Observe the expected output:
Starting Danger PR on danger/danger-js#9
Created [ 'yarn.lock' ]
Deleted [ 'npm-shrinkwrap.json' ]
Modified [ 'README.md', 'package.json' ]

Danger: ✓ passed review, received no feedback.
  1. Update the version to 12.0.1
  2. Run the same command: npx danger pr https://github.com/danger/danger-js/pull/9
  3. Notice the unexpected and incorrect output:
Starting Danger PR on danger/danger-js#9
Created []
Deleted []
Modified [ 'README.md', 'npm-shrinkwrap.json', 'package.json', 'yarn.lock' ]

Danger: ✓ passed review, received no feedback.

Expected behavior
I would expect the behavior to remain consistent with version 11.3.1, where deletions are grouped in deleted_files, creations in created_files, etc.

Your Environment

software version
danger.js 12.0.1, 12.1.0 & 12.2.0
node v20.12.1 & v18.20.2
npm 10.5.0
Operating System MacOS Sonoma 14.4.1
@xphir xphir added the bug label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
@xphir and others