all-contributors / all-contributors/app

Better error handling when the configuration file data structure is incorrect

Open
#102 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
634
Forks
168
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
When the configuration file datastructure is incorrect,the bot fails in weird and wonderful ways. e.g.

```
{
"projectName": "coding_challenge-13",
"projectOwner": "zeroDevs",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": true,
"contributors": [
{
"login": "The24thDS",
"name": "David Sima",
"avatar_url": "https://avatars0.githubusercontent.com/u/26633429?v=4",
"profile": "https://github.com/The24thDS",
"contributions": [
"code",
"bug",
"review"
]
},
{
"login": "mikeattara",
"name": "Mike Perry Y Attara",
"avatar_url": "https://avatars1.githubusercontent.com/u/31483629?v=4",
"profile": "https://mikeattara.com",
"contributions": [
"ideas",
"code",
"review",
"test"
]
},
{
"login": "AkinAguda",
"name": "Akinwunmi Aguda",
"avatar_url": "https://avatars0.githubusercontent.com/u/39712415?v=4",
"profile": "https://github.com/AkinAguda",
"contributions": [
"bug"
]
},
{
"login": "jakebolam",
"name": "Jake Bolam",
"avatar_url": "https://avatars2.githubusercontent.com/u/3534236?v=4",
"profile": "https://jakebolam.com",
"contributions": [
"question"
]
},
{
"login": "aneagoie",
"name": "Andrei Neagoie",
"avatar_url": "https://avatars3.githubusercontent.com/u/10776230?v=4",
"profile": "https://github.com/aneagoie",
"contributions": [
"bug",
"code",
"ideas",
"review"
]
},
{
"login": "MattCSmith",
"name": "Matt Smith",
"avatar_url": "https://avatars3.githubusercontent.com/u/6190356?v=4",
"profile": "https://github.com/MattCSmith",
"contributions": [
"question",
"bug",
"code",
"ideas",
"review"
]
},
{
"contributions": [
"ideas"
]
},
]
}
```

Technically valid JSON but the schema is busted.

**Describe the solution you'd like**
Provide great error messages, so users no whats wrong with the schema.

Even better: Auto fix it!

**Additional context**
See: https://sentry.io/all-contributors/github-bot/issues/859146506/?query=is%3Aunresolved

Also issues: https://github.com/zeroDevs/coding_challenge-13/pull/182

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.