ataylorme / eslint-annotate-action

A GitHub action that takes ESLint results from a JSON file and adds them as annotated pull request comments
MIT License
88 stars 32 forks source link

Bug: For 'properties/start_column', nil is not an integer. #72

Closed andys8 closed 2 months ago

andys8 commented 7 months ago

Issue

We see an issue where there is an error nil is not integer resulting in a hanging result / check job.

2 ESLint error(s) and 0 ESLint warning(s) found in pull request changed files.
0 ESLint error(s) and 0 ESLint warning(s) found in files outside of the pull request.

ℹ  info      Found 2 ESLint errors and warnings, processing batch 1 of 1...
✖  fatal     Invalid request.

For 'properties/start_column', nil is not an integer.
For 'properties/start_column', nil is not an integer.

Leads to dangling / hanging result lint CI job:

image

Github Action

      - name: Lint
        run: yarn lint --output-file eslint_report.json --format json
        working-directory: ./apps/dashboard/
        continue-on-error: true

      - name: Annotate Linting Results
        uses: ataylorme/eslint-annotate-action@2.2.0
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"
          report-json: "./apps/dashboard/eslint_report.json"
          fail-on-warning: ${{ github.event_name == 'pull_request' }}
          only-pr-files: true
          check-name: "Lint Result Dashboard"

Is this an issue with the action? Can we provide more information to solve this issue?

Maybe related, but by the name: https://github.com/ataylorme/eslint-annotate-action/pull/17

ataylorme commented 5 months ago

@andys8 can you please provide a copy of the ESLint report .json file that causes this error? I would like to use it to build a unit test

andys8 commented 5 months ago

I don't think I've data or can reproduce it at this point (2 months later, setup changed), but I will keep an eye open if we encounter the issue again.

ataylorme commented 5 months ago

No worries, sorry for the delayed reply on my end.

andys8 commented 5 months ago

Encountered the issue. The output is from a client, redacted, looks roughly like this.

Main issue is likely column being null. Not sure if that's allowed / within spec, but that's likely the input and reason for the action to fail.

 {
   "filePath": "/path/to/file.json",
   "messages": [
     {
       "ruleId": "i18n-json/identical-keys",
       "severity": 2,
       "message": "my message",
       "line": 0,
       "column": null,
       "nodeType": null
     }
   ],
   "errorCount": 1,
   "warningCount": 0,
   "fixableErrorCount": 0,
   "fixableWarningCount": 0,
   "source": "{}",
   "usedDeprecatedRules": []
 }
ataylorme commented 4 months ago

Thanks for the example. It should be fixed in this commit in the v3-beta. I'll let you know when there is a 3.0.0 release for testing

ataylorme commented 2 months ago

3.0.0 has been released. Please update any references to the v3 branch instead of v3-beta