Skip to content

[BUG] Github/Git JSON DSL Parse Error -- when moving Folders/Files #1181

@fbartho

Description

@fbartho

Describe the bug
A refactor in a Github-based project that moved some directories around caused DangerJS to stop reporting errors, with the following output:

Reached Bottom of Dangerfile // custom log line we injected

Unable to evaluate the Dangerfile
 TypeError: Cannot read properties of null (reading 'name')
    at Object.get (/home/runner/work/backend/backend/node_modules/jsonpointer/jsonpointer.js:69:14)
    at /home/runner/work/backend/backend/node_modules/danger/distribution/platforms/git/gitJSONToGitDSL.js:143:63
    at Array.reduce (<anonymous>)
    at /home/runner/work/backend/backend/node_modules/danger/distribution/platforms/git/gitJSONToGitDSL.js:135:48
    at step (/home/runner/work/backend/backend/node_modules/danger/distribution/platforms/git/gitJSONToGitDSL.js:52:23)
    at Object.next (/home/runner/work/backend/backend/node_modules/danger/distribution/platforms/git/gitJSONToGitDSL.js:33:53)
    at fulfilled (/home/runner/work/backend/backend/node_modules/danger/distribution/platforms/git/gitJSONToGitDSL.js:24:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)


Failing the build, there is 1 fail.
[Additional log output about updating/posting the comment]

To Reproduce
Unclear, we don't have a minimal reproduction set. I'm happy to inject any debugging code or flags that you deem helpful!

Expected behavior
No error thrown.

Screenshots
N/A

Your Environment

software version
danger.js 10.7.1
node 16
yarn 1.22.17
Operating System Github Actions ubuntu-latest

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions