Skip to content

Conversation

ChristopherHX
Copy link

@ChristopherHX ChristopherHX commented May 7, 2025

This verifies github_runner scaler compatbility with https://github.com/go-gitea/gitea (v1.25.0)

Cloned the github_runner e2e test to run against a local Gitea instance of nightly

  • Removed the cancel run
    • this e2e deploys a Gitea Server for testing into another namespace by default
  • Replaced the workflow id by file names, Gitea currently do not support numeric ids of these endpoints
  • Verifies GitHub Api Compatibility of Gitea
  • github_runner can be tested without github.com
  • added vendor/k8s.io/client-go/tools/portforward to allow the test controller to make Gitea Api calls
    • within kubernetes this is not used

Checklist

  • Tests have been added
  • A PR is opened to update the documentation on (repo) (if applicable)
    • Once Gitea side is merged and this test still passes
  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • Use official Gitea images for test

Further enhancements

  • add a gitea_runner scaler
  • allow gitea-global and gitea-user scope in github_runner
  • implement paging when rate limiting is not enforced like on Gitea
  • make Gitea Api calls within kubernetes instead of port forwarding
  • add PAT runner creation in official image
  • create more bigger act_runner images with more tools and ubuntu

Relates to #6488, go-gitea/gitea#33964

Signed-off-by: Christopher Homberger <[email protected]>
@ChristopherHX ChristopherHX force-pushed the gitea-github-runner-keda-test branch from 39fff4e to 5317bf5 Compare May 7, 2025 11:05
Signed-off-by: Christopher Homberger <[email protected]>
…topherHX/6765

Signed-off-by: Christopher Homberger <[email protected]>
Signed-off-by: Christopher Homberger <[email protected]>
@ChristopherHX ChristopherHX force-pushed the gitea-github-runner-keda-test branch from f3f08c5 to 2fae819 Compare June 20, 2025 21:58
Signed-off-by: Christopher Homberger <[email protected]>
@ChristopherHX ChristopherHX marked this pull request as ready for review June 20, 2025 22:12
@ChristopherHX ChristopherHX requested a review from a team as a code owner June 20, 2025 22:12
@ChristopherHX
Copy link
Author

The e2e test should not require any secret token to work in your environment.

While there might be the possibility that such a test is not wanted for an existing autoscaler designed for github and instead duplicating the scaler for gitea is demanded.

BTW keda works now with gitea/gitea:nightly, even without this PR being part of keda

Out of draft, no longer custom images used in this e2e test.

…topherHX/6765-1

Signed-off-by: Christopher Homberger <[email protected]>
@zroubalik
Copy link
Member

zroubalik commented Jul 7, 2025

/run-e2e gitea
Update: You can check the progress here

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, could you please rename the file with the test?

gitea_runner_test.go -> github_runner_on_gitea_test.go

We use regexes to run e2e tests, renaming this file would trigger this test everytime we want to test github

Thanks!

* merge portforward_test.go into test

Signed-off-by: Christopher Homberger <[email protected]>
…topherHX/6765-1

Signed-off-by: Christopher Homberger <[email protected]>
@ChristopherHX
Copy link
Author

Thank you for your feedback, I have renamed the test file to github_runner_on_gitea_test.go

After reading the e2e logs I noticed that I have to merge my two file intergation test into a single file.

Please retrigger the e2e test soon.

Signed-off-by: Christopher Homberger <[email protected]>
Signed-off-by: Christopher Homberger <[email protected]>
@rickbrouwer
Copy link
Member

rickbrouwer commented Jul 9, 2025

/run-e2e github*
Update: You can check the progress here

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice but I don't fully understand the case. I mean, is gitea compatible with GH API? From this PR I think so, so maybe we should include this information in the scaler docs to make users aware of it. WDYT?

Signed-off-by: Christopher Homberger <[email protected]>
Signed-off-by: Christopher Homberger <[email protected]>
@ChristopherHX
Copy link
Author

Thanks for your constructive review.

I mean, is gitea compatible with GH API?

Yes almost compatible for GH APIs in general 1, e.g. go-github can be used to some extend.

WDYT?

Yes documenting this is good a idea.
Currently Gitea 1.25 has not been released yet. I am going to try to write some useful documentation for keda and Gitea.

I wonder should Gitea get it's own docs page and just provide a link in the GitHub Article that a Gitea Version of the doc is available as well?

Footnotes

  1. GH API is large, small api incompatibilities/missing endpoints exist none of them is keda using right now.

@JorTurFer
Copy link
Member

I wonder should Gitea get it's own docs page and just provide a link in the GitHub Article that a Gitea Version of the doc is available as well?

More documentation is always better for end users, maybe you can document on your side or just a blogpost on keda.sh, as you prefer. Maybe we can just publish a blogpost explaining how to configure KEDA for scaling gitea runners and refer it on gitea docs (or just the opposite, document it on gitea page and link it in GH scaler)

@rickbrouwer
Copy link
Member

I wonder should Gitea get it's own docs page and just provide a link in the GitHub Article that a Gitea Version of the doc is available as well?

More documentation is always better for end users, maybe you can document on your side or just a blogpost on keda.sh, as you prefer. Maybe we can just publish a blogpost explaining how to configure KEDA for scaling gitea runners and refer it on gitea docs (or just the opposite, document it on gitea page and link it in GH scaler)

The search function on keda.sh also searches the description. Would it be a good idea to edit the description so that the word "Gitea" is also mentioned there and thus easier to find?
I also think it would be fine to add a line to the Github scaler regarding Gitea, something like:

"Gitea uses the same API structure as GitHub, so you can use the github trigger type for Gitea repositories."

Copy link

stale bot commented Oct 10, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale All issues that are marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants