mantisbt-plugins / source-integration

Source control integration plugin framework for MantisBT, including support for Github, Gitlab, Bitbucket, Gitea, Gitweb, Cgit, Subversion, Mercurial and more
http://noswap.com/projects/source-integration/
MIT License
181 stars 130 forks source link

[SourceGithub] Retrieving master ... failed (Not Found). #252

Closed TomLewis closed 6 years ago

TomLewis commented 7 years ago

Installed everything, went through that insane setup process https://github.com/mantisbt-plugins/source-integration/blob/master/docs/CONFIGURING.SourceGithub.md Very last section "Import Everything" Retrieving master ... failed (Not Found).

Typical.

How do I fix this?

Why cant you just use webhooks?

dregad commented 7 years ago

Another obnoxious and useless bug report.

Typical.

Why can't you just be polite and respectful when asking for help ?

TomLewis commented 7 years ago

Another? this is my first bug report here, this is the first time installing and it doesn't work. Mate if anyone is obnoxious its you with your disgusting reply, I asked for help and your reply was just you being an asshole. Good help! Really great developers! Such a pleasure. Well I guess from your snarky "obnoxious" god-almighty attitude I wont ever be able to be told why your plugin doesn't work, how am I suppose to get help if thats the reply to a help ticket?

morgant commented 7 years ago

@FrozenBeard Please remember that this is free, open source software that has been developed & maintained by the community. This is not a support forum, though we do our best to try to assist in such areas. This is not @dregad's plug-in and he was merely replying in the same manner that you posted your bug report. @dregad handles the vast majority of the support and maintenance these days and deserves much thanks for doing so, you could cut him a little slack for replying with mimicry.

Please provide further details as to what environment you're installing the plugins in, how you exactly you installed & configured them, etc. That will help give you some pointers and actually debug if there's an issue in the code.

As for the installation instructions, I wrote that up and am happy to make improvements if there are specific areas that you feel need it. I believe you may be able to use WebHooks instead, however I have not tested it as I use GitHub with private repos which necessitates jumping through the hoops to use the API.

luzpaz commented 7 years ago

Another reason for the necessity of https://github.com/mantisbt-plugins/source-integration/issues/92

TomLewis commented 7 years ago

As stated from the first post, I installed and configured via the tutorial https://github.com/mantisbt-plugins/source-integration/blob/master/docs/CONFIGURING.SourceGithub.md

Environment is shared hosting with SiteGround, so latest PHP etc.

I just followed the instructions, it all seems to install perfectly fine until I press that last button, and then it shows the error message that I posted in the initial ticket.

morgant commented 7 years ago

@luzpaz Agreed on the need for logging.

@FrozenBeard What versions of MantiBT, SourceIngration & SourceGithub plugins? Does the Repository in Mantis show it's authorized? Any difference if you click "Import Latest" instead of "Import All" (I'd expect not, but have to ask)? Does your GitHub repo have a "master" branch?

dregad commented 7 years ago

@FrozenBeard True, I probably shouldn't have snapped at you like as I did. That being said, as @morgant explained, I do this in my spare time, and I do resent people coming in out of the blue as you did, with statements such as insane setup process and the implications of your saying Typical or Why can't you just... simply because something does not work for you on the first try - quite possibly due to something that has nothing to do with the plugin's code.

My point is that if you're coming to someone asking for help, then you should

  1. do so in a nice and respectful manner
  2. provide information that can help in diagnosing the problem

Neither your opening post, nor the second does help in this respect. I have successfully setup several repos using these instructions, so it is likely something with your settings, or possibly your system setup / network connectivity that is causing the issue. You could start by providing details about your config.

And for the record, the plugin does support webhooks with Github, this is how MantisBT's integration is done. It's just not documented.

As for the error you encountered, it is the result of a Github API request that did not return the expected results (there is no sha key in the JSON) https://api.github.com/repos/{username}/{reponame}/commits/{id} e.g. https://api.github.com/repos/mantisbt-plugins/source-integration/commits/master Based on your input, we know that {id} is master, but we have no idea about the rest. So it could either be, as Morgan said, that you don't have a master branch, or that you did not configure the repository properly (username, reponame).

TomLewis commented 7 years ago

@morgant Im using the latest MantisBT 2.6.0, fresh install. SourceIngration & SourceGithub were fresh pulls from the day of this initial ticket. Source Control Integration 2.1.0 Source GitHub Integration 2.0.1

I did authorise it, yes. I cant see any conformation showing its been authorized on the MantisBT web UI, but I did it, and I can see it under "Authorized OAuth Apps" on github.

When I click "Import Latest" it gives me "Retrieving master ... failed (Not Found)."

Yes my github repo has a master branch.

@dregad

Based on your input, we know that {id} is master, but we have no idea about the rest. So it could either be, as Morgan said, that you don't have a master branch, or that you did not configure the repository properly (username, reponame).

I do have a master branch, I did configure the repository properly in mantis.

What I have figured out from you posting that API URL, is that all the pubic & private repos I try from me and my friend both show "Not Found" from that URL. I assume there is a step missing from the tutorial that we have to somehow authenticate a specific repo to allow API calls. Maybe I have to setup a webhook as well? if you mentioned it uses webhooks. Or do I have to do something with Integrations & services?

Edit: very strangely I refreshed the API page a few times for one of my repos from that URL and it went from Not found to showing up....

The Repo I have setup isn't owned by me, its a private repo I have full access to from my account, the API for it is still showing "Not Found" via github. I guess this has something to do with github permissions.

morgant commented 7 years ago

@FrozenBeard Thank you for the additional details. I'd suggest repeating Step 4 (authorizing the repository via the GitHub API) from the instructions. You may be correct that it's a GitHub permissions issue, but worth ensuring that Mantis has the correct OAuth keys saved.

dregad commented 6 years ago

@FrozenBeard without any update from you since September, I assume you either fixed the problem or gave up trying. I'm closing the issue, feel free to reopen with additional information if needed.

TomLewis commented 6 years ago

No I gave up, as a fix was not pushed.