Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bot is not listening to issue body #352

Closed
12rambau opened this issue Mar 21, 2021 · 13 comments
Closed

bot is not listening to issue body #352

12rambau opened this issue Mar 21, 2021 · 13 comments

Comments

@12rambau
Copy link

Describe the bug
In this repository : https://github.com/openforis/sepal-doc
I've set up everything to update automatically the AUTHORS.rst file.
But when i' wanted to test it with the following issue, the bot never answered (openforis/sepal-doc#6)

Expected behavior
I would have expect to have at least an answer from the bot but nothing

@Berkmann18 Berkmann18 transferred this issue from all-contributors/all-contributors Mar 22, 2021
@Berkmann18
Copy link
Member

That's possibly because your config is missing fields. Have you created the config and generated the table yourself? Or with the CLI?

@12rambau
Copy link
Author

I've created the table myself previously and discovered the bot afterward. The config is reflecting the way i've designed it

@Berkmann18
Copy link
Member

I see, have you tried using the CLI and saw if there were any issues?

@12rambau
Copy link
Author

12rambau commented Mar 30, 2021

I don't really know how to manage nodes dependencies and based on your doc the bot has been designed to avoid using the cli.

My .all-contributorsrc file contains the following :

{
  "files": ["AUTHORS.rst"],
  "imageSize": 100,
  "contributorsPerLine": 7,
  "contributorsSortAlphabetically": false,
  "badgeTemplate": "<img src="https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg?style=flat-square" alt="All contributors">",
  "contributorTemplate": <a href=\"<%= contributor.profile %>\"><img src=\"<%= contributor.avatar_url %>\" width=\"<%= options.imageSize %>px;\" alt=\"\"/><br /><sub><b><%= contributor.name %></b></sub></a>",
  "skipCi": "true",
  "contributors": []
}

But from what I understand if a bug occurs during the handling of my request, the bot should anwser something like "I didn't understand your request".

Edit

To confirm that it is not related to my configuration file, I've created a new repository and test the exact same issue.
https://github.com/12rambau/test_all_contrib/issues/1

Same result the bot is not answering.

Aditional info

As I don't want to use the all_contributor bot on all my repositories, I've only allowed it on specific repository (this one and the openfors/sepal-doc in my organisation) could it be the source of the problem ?

@12rambau
Copy link
Author

Ok tested on my own repositories. So this is it, the bot is not answering if the app is only authorized on specific repository. Can it be considered a bug or is it a normal behaviour ?

@gr2m
Copy link
Contributor

gr2m commented Mar 30, 2021

It should work if you install the app on selected repositories only, we don't use any organization/user account APIs. And I don't see any errors in our logs for your repository.

The problem with openforis/sepal-doc#6 is that the bot does only listen to comments, not issue bodies. You are the 2nd person I see being confused by it, I think we should implement reacting to newly created issues, too.

Would you like to send a pull request for that?

@12rambau
Copy link
Author

If you can show me where to look I would be happy to open a PR

@gr2m
Copy link
Contributor

gr2m commented Mar 30, 2021

I'd start out by creating a new file test/integration/issue.test.js based on https://github.com/all-contributors/app/blob/master/test/integration/issue_comment.test.js, the "happy path" test will suffice for getting started.

Next we need to add handling of the issues.opened event in app.js, it should work similar to

app/app.js

Lines 11 to 34 in aba4cbf

app.on("issue_comment.created", async (context) => {
if (isMessageByApp(context)) return;
if (!isMessageForApp(context)) return;
// process comment and reply
const commentReply = new CommentReply(context);
try {
await processIssueComment({ context, commentReply });
} catch (error) {
const isKnownError = error instanceof AllContributorBotError;
if (!isKnownError) {
commentReply.reply(
`We had trouble processing your request. Please try again later.`
);
throw error;
}
context.log.info({ isKnownError, error: error.name }, error.message);
commentReply.reply(error.message);
} finally {
await commentReply.send();
}
});

Once we get the test passing, we can look into refactoring to remove code duplication. One thing at a time :)

@krzkaczor
Copy link

@12rambau i've also run into problems with the bot in the past. In the end, I've created a GitHub Action that works much better IMO and even commits changes automatically to the repo: https://github.com/actionwareio/all-contributors-action

@12rambau
Copy link
Author

12rambau commented Mar 31, 2021

@krzkaczor I've already seen you advertising the gihub action process that you developed. It seems fantastic.

BUT I don't want to authorize an automatic process to push to my repositories. I'm working with people that are not 100% reliable when it come to git processes so having the extra security of the PR is perfect to handle it.

@gr2m I'm starting a fork. I've never used any of the technology used here, it's out of my league. When I find the time I'll have a look but I will be very slow...

If anyone want to get a headstart, be my guest

@12rambau 12rambau changed the title Bot is not answering bot is not listening to issue body Apr 16, 2021
@tenshiAMD
Copy link
Member

@12rambau is this still irrelevant today? Closing this one for now.

@tenshiAMD tenshiAMD closed this as not planned Won't fix, can't repro, duplicate, stale Oct 13, 2022
@12rambau
Copy link
Author

I think it's not an issue any more, sorry for leaving it on stale

@tenshiAMD
Copy link
Member

I think it's not an issue any more, sorry for leaving it on stale

@12rambau it's okay. no worries 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants