feature request: workflow calls should allow omitting the runs-on item #937
Labels
No labels
FreeBSD
Kind/Breaking
Kind/Bug
Kind/Chore
Kind/DependencyUpdate
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Windows
linux-powerpc64le
linux-riscv64
linux-s390x
run-end-to-end-tests
run-forgejo-tests
run-multi-platform-tests
No milestone
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
forgejo/runner#937
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
"runs-on": {"type": "runs-on","required": true},GitHub Actions, for instance, forbids the presence of this item. Making it required increases porting effort (and confusion for my part).
Related comments:
The problem with not having a
runs-onexplicitly set is that there really is no way to figure out what the appropriate value is in the case of a migration.In other words, I do not see a solution that would make things less confusing. Or maybe with a better documentation.
Any ideas?
Perhaps setting the default runner in the forgejo-runner's config would make sense?
Maybe. But I'm struggling to imagine what such a default might be so that it avoids any confusion. To every user. 🤔
@earl-warren I understand your point.
I seriously believe the only option is to force the user to configure it, or have the Forgejo server give us a default value for all runners.
In my case, I have a default set of runner with a the tag 'docker', which is what I'd like to use for workflow calls.
WAIT.
The problem might be different still: we already specify the
runs-onin the callee. Why would we need to set it in the caller too? How are conflicting values handled?Exactly. That was my point in #7828. And that's why I'm so confused that it got closed 😞 The callee should run on the same runner as the caller, always.
Not sure what "a migration" is in this context.
@2franix "a migration" is meant as "when migrating a workflow from GitHub Actions to Forgejo Actions"
@aviallon wrote in #937 (comment):
The "runs-on" of a workflow is evaluated by Forgejo which is not aware of the caller callee relationship that is interpreted and acted upon by the runner.
Note that a given workflow can be called from another workflow (in which case it will be run according to the runs-on of the caller) or it can be run standalone using the specified runs-on.
If the runs-on of the caller and the callee are different, the runs-on of the caller will be used. If they are not compatible, breakage will happen.
Although I don't quite see the benefit or the implementation details, I don't need to. It should be discussed based on merits and concrete use cases in the context of a new feature request. Could you please open one?
So it looks to me that the runs-on should not be mandatory when workflows only have a
workflow_calltrigger, but no trigger such aspull_requestorpushthat would make it run standalone.That was the problem I described in #7828. From what you explained, I added dummy runs-on properties in workflows to make them pass the new validation checks but those are meaningless in my use case. Isn't there a possibility to make runs-on optional, then ?
I agree that in this particular case it would make sense to have them optional and to document that. Whether or not it is worth having is best discussed in a feature request. Unless you think this should be considered a bug?
To me this is clearly a bug, as it is merely a matter of false positive when checking the workflow's validity. It does run successfully without runs-on if we bypass the check.
But I'm fine either way, as long it goes in the direction of fixing it 🙂
And thank you for the discussion and all the work with forgejo. I don't want my complaint to sound like I'm not grateful for the dedication of people like you towards the community! ❤️
@earl-warren what @2franix says is exactly my point, and also my use-case. When patching the runner to make runs-on optional in the particular situation I am in (which might or might not be common), it works perfectly, and has the added bonus of being compatible with Github's syntax.
In your use case, it does. But not in all cases. When the check is enforced, it works in all cases, including yours as long as you add the runs-on.
I can understand you perceive the static check as being too picky and advocate for a change to relax its requirements in your specific use cases. But I disagree that it is a bug because the runner works as intended.
@earl-warren if it is not a bug, perhaps it should be rephrased as a feature request then?
bug:to feature request: workflow calls should allow omitting theworkflow-jobshould not have aruns-onitemruns-onitemThis issue is on my short list of open issues which are expected to be fixed by https://codeberg.org/forgejo/forgejo/pulls/10448.
With the completion of all the work listed in this comment, it's now possible to omit
runs-onand have it be defined by the jobs within the reusable workflow. Closing this issue. 🎉