-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[Proposal] Don’t parse Actions steps on Gitea side; instead, let the runner report them #24604
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
Comments
this is also related to this issue on the runner side: |
Instead of tackling this by taking the long route of refactoring gitea and act runner interactions, which might take a very long time or never happen, maybe we can just handle this in the frontend with the same logs? The UI could be a list of steps within another list of steps, generated using these recurring separators already present in the logs: Even if we don't know the number of steps before hand, and get to see only those steps which have already run, it is still a huge improvement over the current situation. |
@sahil87, it's possible to make some improvements from the frontend. In our instance, we added a script to the footer in You can try it out on a job of your own by simply pasting the contents of the <script>
window.addEventListener('load', function () {
const right = document.getElementsByClassName('job-info-header-right')[0];
let interval = null
if (right) {
const div = document.createElement('div')
div.classList.add('ui', 'top', 'right', 'dropdown', 'custom', 'jump', 'item')
div.innerText = "🧹"
const cleanUp = () => {
window.scrollTo(0, document.body.scrollHeight);
[...document.getElementsByClassName("log-msg")].forEach((el) => {
for (let prefix of [
"evaluating",
"expression",
"Writing",
"Extracting",
"Merged container",
"Custom container",
"[command]",
"Exec command '[",
"Working directory '/workspace",
" 🐳 docker",
"executing remote job container",
"type=remote-action ",
"Stripping prefix:",
"run post step for",
"::set-output::",
"::add-matcher::",
"/var/run/act/actions",
]) {
if (el.innerText.startsWith(prefix)) {
el.parentElement.remove();
return;
}
}
const match = el.innerText.split('\\n\\n');
if (match.length === 3) {
el.innerText = match[1]
}
if (el.innerText.startsWith(" ❌")) {
if (interval) {
clearInterval(interval)
}
el.scrollIntoView(false);
}
if (el.innerText === "🏁 Job succeeded" && interval) {
clearInterval(interval)
}
});
}
div.onclick = () => {
if (interval) {
clearInterval(interval)
interval = null
return
}
cleanUp()
interval = setInterval(cleanUp, 100)
}
right.prepend(div)
}
})
</script> |
@maantje this is really cool! |
Background
Gitea will parse the steps of a job from the workflow file even before running the job. It works like:
I have to admit, it is a design mistake. The point is that it's impossible to know the real steps based on the static content of the file.
For example:
At present, the problem is not really serious. You can find the logs of the missing steps in
Set up job
andComplete job
. It's just a little inconvenient, Gitea doesn't lose the logs.Solution
The right way could be let the runner report the steps when running them.
I have to say, it will be a huge job that requires refactoring both Gitea and act runner. Many details need to be worked out. For example, the runner should report all steps before executing them, so users can see steps waiting to be executed:
The text was updated successfully, but these errors were encountered: