all-contributors / app

đŸ¤– A GitHub App to automate acknowledging contributors to your open source projects
https://allcontributors.org
MIT License
571 stars 148 forks source link

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

Open brandonlenz opened 11 months ago

brandonlenz commented 11 months ago

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

https://github.com/trussworks/react-uswds/pull/2618#issuecomment-1768572938

image

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

image

https://github.com/trussworks/react-uswds/pull/2653#issuecomment-1810802029

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: https://github.com/Berkmann18/commit-conv/issues/35 to allow scope.

nicrie commented 10 months ago

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

brandonlenz commented 10 months ago

@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 10 months ago

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.

brandonlenz commented 10 months ago

Indeed it fixed it: https://github.com/trussworks/react-uswds/pull/2653#issuecomment-1810802029.

Updating issue.

brandonlenz commented 10 months ago

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.