Auto comment on issues found in pull request#34
Conversation
| elif error_counter["warnings"] > 0: | ||
| # If we only found warnings, don't mark the build as broken | ||
| colorPrint("We found %s problems and %s warnings, please check the logfile." % ( | ||
| error_counter["problems"], error_counter["warnings"]), "35") |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
git_comments.py
Outdated
| # These are default Travis variables identifying a pull request | ||
| # https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables | ||
| repo = os.environ["TRAVIS_REPO_SLUG"] | ||
| pr = os.environ["TRAVIS_PULL_REQUEST"] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
check_addon.py
Outdated
|
|
||
| def _logProblem(error_counter, problem_string): | ||
| colorPrint("PROBLEM: %s" % problem_string, "31") | ||
| comments.append("PROBLEM: %s" % problem_string) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Thank you for this, looks very promissing. I will try to run it on my github branch via travis as soon as you are able to fix the minors :) |
|
I've fixed the issues and also tested on travis |
check_repo.py
Outdated
| addon_path = os.path.join(repo_path, addon_folder) | ||
| error_counter = check_addon.start(error_counter, addon_path, config) | ||
|
|
||
| if check_addon.comments: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Made few changes suggested by @MartijnKaijser and @razzeee |
|
@razzeee I have added option for I have tested it on a config file similar to this: |
|
@razzeee Are there any other changes required in this ? |
|
I'm a bit short on review time at the moment. The only thing you could do is sqash your commits if you know how to do that :) |
|
I think the travis ci file also needs changes as you added some dependencies that are not installed on ci otherwise |
be0ae6f to
fb30e47
Compare
|
I took the liberty to add |
|
It's not perfect yet, check https://github.com/Razzeee/repo-plugins/pull/1 for an example. I'm not sure if it might be prettier to show the errors in a markdown list? Might get very long, but at least you don't need to scroll horizontally. |
check_repo.py
Outdated
| GithubAPI().remove_label(["Checks failed"]) | ||
| GithubAPI().set_label(["Checks passed"]) | ||
| else: | ||
| colorPrint("No config file found", "7") |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Tested a bit more and it's failing quiet often due to |
|
Seems awy more relyable 🎉 But formatting is still off https://github.com/Razzeee/repo-plugins/pull/1#issuecomment-369303762 |
check_addon.py
Outdated
|
|
||
| def _logProblem(error_counter, problem_string): | ||
| colorPrint("PROBLEM: %s" % problem_string, "31") | ||
| comments.append("PROBLEM: %s" % problem_string) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@razzeee I have made changes suggested by you |
|
This is perfect, thank you 🌮 And sorry for taking so long to review and having you go back so many times 💃 |
|
Crap, would have been to easy. |
|
@razzeee Wow, this is bad. There must be some recourse against this, right? Considering so many other tools do this GitHub comments thing. At worst, we would have to stop using Travis CI (just for commenting; we can continue using it for builds) and maybe dedicate our own server for commenting, which would work via GitHub/Travis events hook API. There are existing tools for this or we could try to come up with our own lean implementation in Python. for. eg. this is how TravisBuddy's comments look, notice that they are on a pull created from a fork of the repo. But perhaps there is a better way to deal with this? |
|
I think we'll have to add some github hook which we can grant access to be able to comment |
|
Well that travis buddy is running on their own infrastructure which obviously can keep the api key secret. While we try to let travis do that for us :/ |
|
Yeah, but Travis isn't able to fulfill what we want, right? and I looked into this a bit more and it seems like tools like TravisBuddy are our best bet but yes we'll need our own infrastructure for that, if we want to customise the comments that we post. |
It fixes issue #27
This will help in informing contributors about the problems in their add-ons.
I have tested it locally but haven't tested it on Travis-CI.