-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add support for Forgejo/Gitea remote repos #271
Conversation
How to create an api token (on codeberg):
|
On side-effect of the API differences is that with the HTTP API I can't fetch issue details and issue comments in one go like GraphQL can. For now I have implemented that a bit clunkily by first filling the issue details, and then fetching comments and adding them: This probably has issues with async callbacks but it works AFAICS. Please review and suggest improvement. One solution I can see is to split the issue list and issue comments into separate models, but that would mean rework of the gitlab and github implementations. |
Thank you very much for this addition. I have to admit that it took me a bit of research to fully understand, why you treated All three are written in Go, and @nephros, is there a specific reason why you did not mention Gogs? E.g. does it not still share the same token format and APIs? Or was it just due to not being aware of the common, original basis these three We also should document that
I think that is fine, because For Gogs you may try running Unfortunately, there does not seem to be a proper API documentation on the web (this is the best I found), but maybe something is accessible on a running instance (as with P.S.: WRT code review I kindly ask @piggz and/or @rinigus, if one or both of you can spare the time; but actually one should first review and react to the latest comments for the much older PR #266, because it has been stalled since December 2023. |
I indeed wasn't aware of gogs. I found API docs here: https://github.com/gogs/docs-api Haven't looked into it, but I'll to a test sometime later. Could be it just works. The thing with all the self-hosted things is that they're hard to detect. Right now we just 'brute-force' try to access the URL/Repo/PackagingRepo metadata urls (all three, in that order). The first that doesn't error out is picked. |
Scratch that, try.gogs.io is not working ATM. I might revisit but that is lowest possible prio as I don't think anyone in the SFOS/chum world is likely to use it. |
Cool, I somehow missed this.
IMO basically the whole Gogs story is only for these cases: "Just works" or "works with minimal adaptions". Any other case would put it outside of having a common denominator with Forgejo and Gitea, any way.
IMO that is fine; how else would one address that easily?
As stated (I later expanded that statement to clarify it):
|
That's the first issue. The second one is that the server literally sends nothing once you force-ignore the certificate problem. (And a quick googling indicates that is possibly a Docker misconfiguration - so maybe the admins of that site should read that guide! :D ) And nope I will not set up a containered instance of a rather fringe service to test three api calls to have the number of "stars" displayed in (maybe!) one or so Chum packages (no offense!). And as this seems to be self-hosted only with no widely-used public service we can't create API tokens anyway. Still, thanks for your research and pointers! |
Because the code allows for accessing many GitLab, ForgeJo or Gitea instances: - For GitLab see https://github.com/sailfishos-chum/sailfishos-chum-gui/blob/main/src/projectgitlab.cpp#L64-L72 - For ForgeJo / Gitea see https://github.com/sailfishos-chum/sailfishos-chum-gui/pull/271/files#diff-c1ed8f7621ef2d19139f5e7bd018710270a0ad8e2850aa4090198af527ed51c8R64-R72
I was just about to walk through your nice step-by-step guide how to create a token for Forgejo / Gitea using
TL;DRA secret |
[CMakeLists.txt] Improve wording in emitted strings
Fine, I think we are all set; as my call for a proper code review (which I cannot provide) by the other co-maintainers was unsuccessful, do you @nephros want to look over it again, before I merge this PR? |
I've been running a build of this for a bit, it appears to be working as it should. So go ahead, if something breaks I'll pick up any pieces I find. |
This adds support for remote SCM hosts running gitea or forgejo software, similar to the gitlab and github integration we already have (except this is not using GraphQL).
Tested only with codeberg.org (forgejo), and by running curl against https://try.gitea.io.
API docs can be accessed by browsing to
<instance host>/api/swagger
for both gitea and forgejo, e.g:A new API key will have to be generated for at least codeberg.org so Github can use it in the build Action.
The format of the
TOKEN_FORGEJO
for github actions follows that of the Gitlab implementation:Quoting being essential here! (The github workflow breaks otherwise because of pipes in a shell script!)
s.a. #44