makedeb / mprweb

Hosting platform for the makedeb Package Repository (MPR)
https://mpr.makedeb.org
GNU General Public License v2.0
15 stars 3 forks source link

Add package CI/button to add to PrebuiltMPR #6

Closed lpuv closed 2 years ago

lpuv commented 2 years ago

We talked in Matrix about adding a button when logged in and viewing your package, that triggers the Talus API (preferably authenticated). This API automatically adds a package to @PrebuiltMPR's build system (via /add endpoint) and pushes it to its repo. It also will have an endpoint that returns the ci badge, so that it can be displayed. This will act as a CI for packages as well as being an auto-build system. It can help maintainers by quickly informing them (runs every 24h) whether their packages have broken.

Thanks, Leo

lpuv commented 2 years ago

Some updates:

  1. The Talus API is now live at https://talus.craftcat.dev Endpoints:
    • /add (authenticated with key) adds package to prebuiltmpr, parameters: package
    • /list (unauthenticated) lists packages on prebuiltmpr
    • /badge (unauthenticated) returns the status badge for the package, parameters: package
  2. We can provide you an key to use for the API, but will have to find a way to provide it to the app without including it in the source code @hwittenborn ^^
hwittenborn commented 2 years ago

Looks simple enough, I like it! Would it be possible to add a /remove endpoint in case a package maintainer wants to remove a package from the API?

Setting a secret shouldn't be a problem, I can just set that dynamically when the CI deploys everything.

Besides that, the only other note I got is that this won't be able to get added until the Python port is actually used upstream, as it's mainly just being used for testing for them, and if makes it easier to debug upstream issues if little modifications are made (parts of which I believe we also discussed).

hwittenborn commented 2 years ago

If we add this to the MPR I'd like the PrebuildMPR to be an official makedeb project, and likewise have the following done:

You and whoever else would still assume all ownership for the PrebuildMPR if you'd like regardless though, it's just all so I can ensure nothing bad or sneaky is going on.

I'm also open for discussion on how y'all would like to do everything as well.

zocker-160 commented 2 years ago

@hwittenborn I cannot speak for @gamer4life1 but I personally do not have a problem with moving the stuff over to a different server, all the scripts you need to host it are available on our PrebuildMPR GitHub.

It basically is up to you to get it going on your infra ;).

hwittenborn commented 2 years ago

I'll wait for Leo to respond too, but as a starting point, would y'all be fine moving the PrebuildMPR stuff to the @makedeb organization?

lpuv commented 2 years ago

Yes! The repo itself might be a little challenging to move to a proget feed, but should be able to be done.

lpuv commented 2 years ago

As for ci, the GitHub scripts are pretty simple, I'm just afraid it will overload your instance.

hwittenborn commented 2 years ago

Yes! The repo itself might be a little challenging to move to a proget feed, but should be able to be done.

That shouldn't be a problem; I can create an API key and then Debs can just be uploaded.

As for ci, the GitHub scripts are pretty simple, I'm just afraid it will overload your instance.

That's what I was worried about too, so I'm fine sticking with GitHub actions for that.

Only other thing would be the Talus API, which I was wanting to host at talus.makedeb.org if that was fine with you. Depending on how hard it would be to transfer I'd also like to host it on my server if that would be possible.

lpuv commented 2 years ago

It's a simple python script at https://github.com/PrebuiltMPR/talus-api and just needs uvicorn and anything fastapi needs.

hwittenborn commented 2 years ago

I'm ready to get this going now that I'm more familiar with the MPR codebase. I'm gonna get some issues here closed up, then I'll be right on to getting the Talus API set up and have that all rolling.

hwittenborn commented 2 years ago

Sorry, not sure why I close this :P

zocker-160 commented 2 years ago

just to add to our conversation we had on Matrix. IMO the 100% solution would be:

hwittenborn commented 2 years ago

See /makedeb/prebuilt-mpr and https://docs.makedeb.org/prebuilt-mpr/adding-packages/ for the current implementation.