all-contributors/app

Improve bot error messaging on invalid commitType config (Example inside)

brandonlenz opened this issue · 5 comments

Describe the bug
When fed a valid request, the bot says it is unable to process the request:

trussworks/react-uswds#2618 (comment)

image

This was due to the repository config using a commitType that also included a scope. Reverting the scope fixed the issue:

image

trussworks/react-uswds#2653 (comment)

To Reproduce
Steps to reproduce the behavior:

  1. Create a repo with an all contributors config file that includes commitType: "chore(someScope)"
  2. Try to use the bot
  3. Note that it fails. The error sounds like it is network, API, or all-contributors code related. I suspect since it works for others (presumably) that there is actually an issue with our repo or configuration. Note that the bot used to work in this repo.

Expected behavior
The bot should properly create the contributor PR

OR

The bot should indicate what the problem is, in this case, specifically handling an error that I assume bubbles up from https://github.com/Berkmann18/commit-conv

Additional

Opened an issue with commit-conv: Berkmann18/commit-conv#35 to allow scope.

nicrie commented

It seems I've just hit the same issue here.

@nicrie I have a hunch that this will fix it for me:
https://github.com/trussworks/react-uswds/pull/2653/files#diff-cb22095514d0cab1f755ae3a7902f7d64d10199da210fbd1eb2b29eb758b38d2R223
image

Looking at your config file, it won't be the same resolution for you.

That said, if this does fix it for me I will update this issue to request error handling around the culprit so that the error messaging can be improved.

nicrie commented

Thanks for the hint, @brandonlenz. How do you know that the commitType will solve it for you? I still tried your solution myself, but - as you already indicated - to no avail.

Indeed it fixed it: trussworks/react-uswds#2653 (comment).

Updating issue.

Thanks for the hint, @brandonlenz. How do you know that the commitType will solve it for you? I still tried your solution myself, but - as you already indicated - to no avail.

I didn't know it would fix it, but I had a guess. I had to look at the underlying libraries used by the bot to see that my commitType configuration was likely invalid. The other hint was the bot stopped working after that was added to our repo's config.