Skip to content

Custom/Synthetic action event logs API #33709

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

Open
3 tasks
AdamMajer opened this issue Feb 24, 2025 · 3 comments
Open
3 tasks

Custom/Synthetic action event logs API #33709

AdamMajer opened this issue Feb 24, 2025 · 3 comments
Labels
topic/gitea-actions related to the actions of Gitea type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@AdamMajer
Copy link
Contributor

AdamMajer commented Feb 24, 2025

Feature Description

This is a combination of what is already proposed.

Additional API for action runners:
#31416

Global actions:
#32374

I believe the main motivation for the global actions is ability of defining some organizational business logic while retaining the integrations that actions give us. For example, a build result can be stored in an action result and does not require external service.

It would be sufficient to have ability to define "external" actions that are run externally to a repository via current webhook mechanic but can integrate with the Action API. More specifically, have some way of storing external "action" runs and making it visible to users.

These events would be listed as normal action text logs in the UI. No need here to handle runners, etc, just ability to store custom logs and make them available to reviewers.

Why not have these as comments? Let's say there's 100kB of build logs -- these are not easy to consume as comments 😉

Screenshots

No response

@AdamMajer AdamMajer added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Feb 24, 2025
@AdamMajer
Copy link
Contributor Author

AdamMajer commented Feb 24, 2025

For example, let's say we have repo org/repo

  • Pull Request Creation event is detected (webhook/polling) -- org/repo#1
  • Some external jobs is started and is appended as action to org/repo#1 as org/repo/action/run/12344 -- synthetic action run.
  • The action log is updated externally as API calls

Which actions are appended to what item is then out-of-scope for gitea. Gitea is then just as store of information to the externally managed business logic.

@kemzeb kemzeb added the topic/gitea-actions related to the actions of Gitea label Feb 25, 2025
@ChristopherHX
Copy link
Contributor

Including the ability to disable the Gitea Actions Trigger and keep using the UI, workflow_dispatch just needs to sent a webhook then external tools can handle it and report back

This matches with the original Gitea Actions Issue (#13539, before the original post has been updated) and would allow me to choose my own actions runtime runner.server instead of Gitea Actions to manage jobs 👍

I would amend the following to be more like

API to create external action run events to an Issue/PR and maybe also Commit/Tag/Release`

API to create external/synthetic action run entries with jobs, steps and logs

webhook is enough as a trigger, so I would not call it create run events. Or did I miss something?

For just uploading jobs on an action event, you could just implement the following protocol, add a custom label, add all steps for the UI in the dummy yaml file and done

A standard protocol to get tasks and get logs back https://gitea.com/gitea/actions-proto-def

@AdamMajer
Copy link
Contributor Author

Mostly "create run events" should be read as "create run event logs". The importance here is ability to create synthetic, externally created "action run event entries/logs" and to query them externally.

I'm not interested in scheduling or running any real actions/workflows by Gitea here. That is already covered elsewhere.

@AdamMajer AdamMajer changed the title Custom action logs integration API Custom/Synthetic action event logs API Feb 26, 2025
lunny added a commit that referenced this issue Mar 26, 2025
Related to #33709, #31416

It's similar with
https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#download-job-logs-for-a-workflow-run--code-samples.

This use `job_id` as path parameter which is consistent with Github's
APIs.

---------

Co-authored-by: ChristopherHX <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/gitea-actions related to the actions of Gitea type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

3 participants