Skip to content

Remove trailing comma before the end of the array

Context

We had some CI/CD jobs failing when no jobs failed in the last X hours.

The problem

We add a trailing comma right before closing an array, which is apparently not allowed in the JSON spec.

Before, we didn't hit this problem because we had an extra divider at the end of the array.

The fix

Remove the trailing comma before the end of the array 🎉 💪 😆

The result

Before the fix

$ bundle exec bin/failed_jobs_report -t <redacted> --hours 1 --job 'review-qa-reliable' --output=slack; jsonlint failed_jobs_report.json; echo $?
failed_jobs_report.json
  expected array element, not an array close (after blocks) at line 24, column 4 [parse.c:613]
1

After the fix

$ bundle exec bin/failed_jobs_report -t <redacted> --hours 1 --job 'review-qa-reliable' --output=slack; jsonlint failed_jobs_report.json; echo $?
0

Merge request reports