app icon indicating copy to clipboard operation
app copied to clipboard

Handle case where no all-contributors table exists in file, but `.all-contributorsrc` exists in the repository

Open jakebolam opened this issue 6 years ago • 6 comments

Is your feature request related to a problem? Please describe. The bot currently decides whether to 'init' (install the placeholders for the table and badge) for the README if there is no .all-contributorsrc file. If the file is found, it skips this step. This causes the bot to crash if a user has an .all-contributorsrc file but has nothing else.

Describe the solution you'd like Handle the case where the .all-contributorsrc file exist, but the contentFiles (READMEs) have not been setup yet.

Describe alternatives you've considered Better documentation?

Additional context Code that determines whether to 'init'/setup/add place holders to contentFiles (READMEs): https://github.com/all-contributors/all-contributors-bot/blob/master/src/tasks/processIssueComment/probot-processIssueComment.js#L50-L53

    await contentFiles.fetch(optionsConfig)
    if (optionsConfig.getOriginalSha() === undefined) {
        contentFiles.init()
    }

Table placeholders that are inserted into files during 'init':

 <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
 <!-- ALL-CONTRIBUTORS-LIST:END -->

jakebolam avatar May 04 '19 12:05 jakebolam

Having the bot give more useful messages would also already help a lot:

allcontributors

sypets avatar Jul 14 '19 11:07 sypets

I've been battling with setting this up on the repo over at https://github.com/i0natan/nodebestpractices/issues/410

I believe I am running into this issue (added a .all-contributorsrc file, but it is pointing to a blank file other than README.md). I've tried to manually add the tags to that file, but still running into problems.

So I am keen to take a look into this issue if no-one else has started yet (doesn't look like it)?

js-kyle avatar Aug 02 '19 22:08 js-kyle

All yours :)

gr2m avatar Aug 05 '19 21:08 gr2m

Great, looking at it now!

js-kyle avatar Aug 10 '19 05:08 js-kyle

@gr2m (or anyone here) If you have some spare time would you be able to check my approach to this one before I work on fixing the remaining tests? https://github.com/js-kyle/all-contributors-bot/pull/1

js-kyle avatar Aug 16 '19 23:08 js-kyle