gitea
gitea copied to clipboard
Support actions syntax tokens
TODO:
- [ ] Make folding work, default to folded state
- [ ] Recalculate rendered line numbers to exclude always-hidden lines
- [ ] Figure out whether
::add-matcherand::remove-matcherhave any meaning to us - [ ] Implement all documented tokens
- [ ] Error annotations
##[error] - [ ] Add tests
Also there seems to be some strange emoji-prefixed stuff which I think comes from either act_runner or act, I wonder what to do with it because I think these are invalid with that 💬 prefix.
💬 ::debug::clean = true
💬 ::debug::filter = undefined
💬 ::debug::fetch depth = 1
💬 ::debug::fetch tags = false
full commands list is here: https://github.com/actions/toolkit/blob/main/docs/commands.md#problem-matchers
Also there seems to be some strange emoji-prefixed stuff which I think comes from either
act_runneroract, I wonder what to do with it because I think these are invalid with that💬prefix.
I can help remove the emoji prefix if it's really bothering. I noticed that too, but I didn't have the motivation to resolve it.
Also there seems to be some strange emoji-prefixed stuff which I think comes from either
act_runneroract, I wonder what to do with it because I think these are invalid with that💬prefix.I can help remove the emoji prefix if it's really bothering. I noticed that too, but I didn't have the motivation to resolve it.
Please do. I would code this matcher to only work when :: or [command] is at the beginning of the line, and I think such tokens in the middle of the line would also not work on GitHub, but I will check this as well what their renderer does in that case.
Also there seems to be some strange emoji-prefixed stuff which I think comes from either
act_runneroract, I wonder what to do with it because I think these are invalid with that💬prefix.I can help remove the emoji prefix if it's really bothering. I noticed that too, but I didn't have the motivation to resolve it.
Please do. I would code this matcher to only work when
::or[command]is at the beginning of the line, and I think such tokens in the middle of the line would also not work on GitHub, but I will check this as well what their renderer does in that case.
https://gitea.com/gitea/act/pulls/97
And I'll update act_runner later.
https://gitea.com/gitea/act_runner/pulls/515
act_runner has now received the updates
Figure out whether ::add-matcher and ::remove-matcher have any meaning to us
Those commands needs to be interpreted by act_runner/act.
I would like that ##[group] and ##[endgroup] would work as well
The actions/runner converts them into the alternative (aka azure devops notation) command syntax
https://gitea.com/ChristopherHX/actions_runner/actions/runs/97
##[group]Run actions/checkout@v3
with:
fetch-depth: 0
repository: ChristopherHX/actions_runner
token: ***
ssh-strict: true
persist-credentials: true
clean: true
sparse-checkout-cone-mode: true
fetch-tags: false
lfs: false
submodules: false
set-safe-directory: true
##[endgroup]
Both act and actions/runner supports the two different command syntaxes.
Obviously I could tell my third party runner adapter to convert it back, not a big deal after all.
Figure out whether ::add-matcher and ::remove-matcher have any meaning to us
Those commands needs to be interpreted by act_runner/act.
Ok then we hide those completely on the UI.
Adding a note for another thing I discovered in the renderer:
Lines that match a certain regex with filename at the start are highlighted as error, but as seen below that regex of GitHub has a bug where it does not highlight column ranges.
No idea how those error annotations look in the raw format, but I expect there to be some token that can be matched.
The bug with line ranges is probably in this file https://github.com/actions/setup-go/blob/main/matchers.json
- setup-go prints ::add-matcher:: with a container file path
- runner reads it from the host by reverse mapping the container path (act could use docker cp like api)
- runner scans log output for all problem matchers / rewrites the log file and sends annotations for them as well
I'm not shure how it is possible to avoid replicating the line range bug without implementing builtin problem matchers on either UI or runner side.
E.g. the Gitea Workflow could register it's own problem matcher, which matches for line ranges
Interesting, I wouldn't have thought that it was setup-go that holds this regex. I do agree we should not try to fix this bug on our end, but fix in setup-go instead.
BTW, I think the format <linenum>:<colnum>-<colnum> that gopls uses is not ideal because it would not allow to make a multi-line annotation. A format like <linenum>-<colnum>:<linenum>-<colnum> would arguably be better, but I'm not sure whether the LSP protocol would allows it.
I would like that
##[group]and##[endgroup]would work as well
Now GitHub-like syntax ::group:: support has been added by https://github.com/go-gitea/gitea/pull/32713, it won't be difficult to support ##[group] syntax
We should probably compile a list of syntax tokens and which of them we support and which don't.
-> Make RepoActionView.vue support ##[group] #32770
-> Make RepoActionView.vue support ##[group] #32770
Thank you for picking this up.
Something unrelated, but funny from GitHub Actions about parsing Action commands in webconsole
The official GitHub Actions log viewer behaves sometimes very weird, good that Gitea does it much better.
e.g. they matched at some point of time just the [group] part regardless where in the line it has been located and ignored that workflow command require ##[group] at the start of line. (They did this for other commands as well)
For example my actions emu logged the following in ci tests
| ##[group]Test
and I believe their outcome was. (or still is, I inject non breaking spaces since then into the console if GITHUB_ACTIONS is defined)
> p]Test
We should probably compile a list of syntax tokens and which of them we support and which don't.
I think that I can help creating such a list from the act side of view.
except
- [x] group
- [x] endgroup
- [ ] debug, not sure about the encoding act_runner uses here. Eventually already implemented.
- [ ] command, I think only logged as
[command]docker run...in actions, but need to check again (no semantic meaning) - [ ] error, removed file information in log view, those is sent separately on GitHub Actions as annotations. Not sure what act_runner does
- [ ] warning, removed file information in log view, those is sent separately on GitHub Actions as annotations. Not sure what act_runner does
- [ ] notice
are commands not reaching the console log in actions/runner at least, act_runner might sent more to the ui
- [ ] step summary (file command), did't design an api yet
- [ ] add-matcher, didn't design an api yet to map to
::error:: - [ ] ≈
$ACTIONS_ID_TOKENurl of oidc token, saw a pr about this once, not sure about the outcome - [x] add-mask, doubled implementation as the log is grabbed too early from act to be masked by act
- [x] set-output + GITHUB_OUTPUT
- [x] set-env + GITHUB_ENV
- [x] add-path + GITHUB_PATH
I'm possible not up to date here for Gitea Actions.