-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Support Actions concurrency
syntax
#32751
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
base: main
Are you sure you want to change the base?
Conversation
3551677
to
fcf4517
Compare
52833e7
to
130f2a2
Compare
461c7c1
to
d5168a2
Compare
e038ed2
to
f77f266
Compare
concurrency
for Actionsconcurrency
syntax
ad71599
to
8f5948b
Compare
This comment was marked as resolved.
This comment was marked as resolved.
) Move the main logic of `generateTaskContext` and `findTaskNeeds` to the `services` layer. This is a part of #32751, since we need the git context and `needs` to parse the concurrency expressions. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Sounds good. Feel free to ping / DM on discord if you want me to test something, or need something else. I've been running this for a while on my instance already. |
@ChristopherHX Sorry for the late reply, as I was busy with other work last month. Thank you for the improvements and bug fixes to this PR. Please feel free to update the code. I will also check if there are still issues with this PR. |
Hi, No problem, once we both agree this is finished and can be merged I approve. Good that you already looked at the cancellation problem. I still think about if my code removal is correct or not in sense of not only let existing tests pass. I had another behavior difference
Would we want to add a custom boolean to implement both behaviors? concurrency:
cancel-pending: true # default true for GitHub Actions Compat, false for current implementation Would we want to keep the behavior difference and document it? |
I think these changes look good. Thanks for simplifying the code.
Yes. I noticed the behavior difference between GitHub actions and my implementation. I think for now we can use GitHub's logic. And in the future, we can add the |
Signed-off-by: Zettat123 <zettat123@gmail.com>
Signed-off-by: Zettat123 <zettat123@gmail.com>
* the behavior looks good
…r the run is done
In d5f6c44 I have implemented my last TODO that does not require changes to gitea/act. This now works good for me My last open discussion point is this one, since this is related to our database structure. The functionality to allow the shorten syntax of concurrency is ok for me to defer. If we would see the following valid GitHub Action snipped concurrency: |-
${{ fromjson('{
"group": "somegroup",
"cancel-in-progress": true
}') }} concurrency: |-
${{ fromjson(vars.CONCURRENCY_GROUP_OBJ) }} How do we pass this to Gitea via RawConcurrency? My current idea would be adding some boilerplate expression so this is transparent for the current implementation e.g. store where
While this does feel a bit bad, we need to copy paste a lot to make this work without side effects On the other hand, Could we just store RawConcurrency as json/yaml? Instead of splitting it before evaluation. EDIT |
I would prefer the second solution:
In this way, we only need a
If you have completed the code, please feel free to push your changes. |
I will look into implementing the second solution.
Yes this is going to be required together with fixing parsing the workflow to support both formats. Change to act, seems like I can make this merge as soon as possible and this PR does not have to wait |
I am somewhat confused, after my first attempt 796d2c1 to use a single RawConcurrency entry gitea feels to be slow to queue... I didn't expected such a slowdown via yaml.Marshal and yaml.Unmarshal. I will revert and test again to check if this is unrelated... |
Fix #24769
Fix #32662
Fix #33260
Depends on https://gitea.com/gitea/act/pulls/124
This PR removes the auto-cancellation feature added by #25716. Users need to manually add
concurrency
to workflows to control concurrent workflows or jobs.