-
Notifications
You must be signed in to change notification settings - Fork 132
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
How to Gitea integration? #375
Comments
Hello |
Contributions are always welcome, feel free to submit a pull request for gitea integration. |
I currently work on it based on the GitHub Plugin. Its not finished yet but basically working. Code cleanup is needed. Still have some questions and a few unclear points. I hope I can create a repository for it soon. I still need to implement the webhook creation through button clich from the repo configuraton page. |
Great news, thanks ! Looking forward to it.
Can't help with the Gitea side of things, but if your questions are related to MantisBT or the Source Integration framework, I'll be glad to assist if I can. Just ask !
Rather than having it as a standalone repository, I would suggest to bundle your plugin with this one, whenever you're ready. |
|
Oh great! On which channel should I contact you? Basically first big question is: Is it normal that the Mantis repository $t_repo->id changes when a "Import Everything" is done? If yes, how to handle this with respect to oauth refresh token usage? The redirect_uri seems to need the repository id as a parameter for the Reply with the code. When the repo id changes the token refresh via oauth fails due to a now wrong redirect_uri. |
Here is fine, or if you prefer https://gitter.im/mantisbt-plugins/source-integration (if I'm on-line you may get faster turnaround)
That's just the way the plugin was originally written (long before I took over the project's maintenance). Not sure I would call that normal, though. I agree that changing repo id is confusing at best, and may cause issues. AFAIK, the idea was to perform the full import into a new, empty repository so the original could be kept and restored in case of errors during the import operation, but I do not think there was any actual intention to change the id; that's probably just a side effect.
I was not aware of any issues with changing repo id until now, but TBH the full import is a feature I rarely use. |
Making a full import like that makes totally sense to me, but keeping the id would be probably nice?
I think this/my question can be seen best in oauth_authorize.php where the id and the code is required as a parameter to process the further authentication procedure after the initial request. This involves then later on to assign also the authentication token and refresh token to a repository. At the moment I dont see, how this would work with one authentication for all repositories configured in Mantis. Probably something like iterating through all repositories and checking for the application id and populate all repos with the same application id with the same authentication token and refresh token once the oauth procedure is finished? Am I missing smth. here? Basically its not a problem to do the oauth procedure for every repo, it works. |
I believe this is by design, it was never meant to be a global authentication |
I never would have had the idea that this could work, if it wouldnt be mentioned in the Github plugin documentation
|
I found out that this works for github, because github allows redirect_uris to be more felxible than gitea (see last two sentences). So that means for github your could define in github settings redirect_uri = https://mydomain/mantisbt/ and at the same time pass https://mydomain/mantisbt/+SUBDIRECTORY+PARAMS in the authentication request, which makes no issues. This is why a single OAuth app is sufficient for all github repos... |
I could not work on this for a couple of weeks now. I made a push to my repository https://github.com/fokkersim/SourceGitea |
https://gitea.io/en-us/
How to Gitea integration?
The text was updated successfully, but these errors were encountered: