loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix checks for `needs` in Actions (#23789)

Fix:
- https://gitea.com/gitea/act_runner/issues/77
- https://gitea.com/gitea/act_runner/issues/81

Before:
<img width="1489" alt="image"
src="https://user-images.githubusercontent.com/9418365/228501567-f752cf87-a7ed-42c6-8f3d-ba741795c1fe.png">

Highlights:
- Upgrade act to make things doable, related to
- https://gitea.com/gitea/act/pulls/32
- https://gitea.com/gitea/act/pulls/33
- https://gitea.com/gitea/act/pulls/35
- Make `needs` works
- Sort jobs in the original order in the workflow files

authored by

Jason Song and committed by
GitHub
964a057a aa4d1d94

+22 -21
+1 -1
go.mod
··· 289 289 290 290 replace github.com/blevesearch/zapx/v15 v15.3.6 => github.com/zeripath/zapx/v15 v15.3.6-alignment-fix 291 291 292 - replace github.com/nektos/act => gitea.com/gitea/act v0.243.1 292 + replace github.com/nektos/act => gitea.com/gitea/act v0.243.2-0.20230329055922-5e76853b55ab 293 293 294 294 exclude github.com/gofrs/uuid v3.2.0+incompatible 295 295
+2 -2
go.sum
··· 52 52 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 53 53 git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 h1:cliQ4HHsCo6xi2oWZYKWW4bly/Ory9FuTpFPRxj/mAg= 54 54 git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078/go.mod h1:g/V2Hjas6Z1UHUp4yIx6bATpNzJ7DYtD0FG3+xARWxs= 55 - gitea.com/gitea/act v0.243.1 h1:zIVlhGOLE4SHFPW++u3+5Y/jX5mub3QIhB13oNf6rtA= 56 - gitea.com/gitea/act v0.243.1/go.mod h1:iLHCXqOPUElA2nSyHo4wtxSmvdkym3WU7CkP3AxF39Q= 55 + gitea.com/gitea/act v0.243.2-0.20230329055922-5e76853b55ab h1:HDImhO/XpMJrw2PJcADI/wgur9Gro/pegLFaRt8Wpg0= 56 + gitea.com/gitea/act v0.243.2-0.20230329055922-5e76853b55ab/go.mod h1:mabw6AZAiDgxGlK83orWLrNERSPvgBJzEUS3S7u2bHI= 57 57 gitea.com/go-chi/binding v0.0.0-20221013104517-b29891619681 h1:MMSPgnVULVwV9kEBgvyEUhC9v/uviZ55hPJEMjpbNR4= 58 58 gitea.com/go-chi/binding v0.0.0-20221013104517-b29891619681/go.mod h1:77TZu701zMXWJFvB8gvTbQ92zQ3DQq/H7l5wAEjQRKc= 59 59 gitea.com/go-chi/cache v0.0.0-20210110083709-82c4c9ce2d5e/go.mod h1:k2V/gPDEtXGjjMGuBJiapffAXTv76H4snSmlJRLUhH0=
+3 -1
models/actions/run.go
··· 197 197 for _, v := range jobs { 198 198 id, job := v.Job() 199 199 needs := job.Needs() 200 - job.EraseNeeds() 200 + if err := v.SetJob(id, job.EraseNeeds()); err != nil { 201 + return err 202 + } 201 203 payload, _ := v.Marshal() 202 204 status := StatusWaiting 203 205 if len(needs) > 0 || run.NeedApproval {
+14 -14
modules/actions/workflows.go
··· 122 122 webhook_module.HookEventRepository, 123 123 webhook_module.HookEventRelease, 124 124 webhook_module.HookEventPackage: 125 - if len(evt.Acts) != 0 { 126 - log.Warn("Ignore unsupported %s event arguments %q", triggedEvent, evt.Acts) 125 + if len(evt.Acts()) != 0 { 126 + log.Warn("Ignore unsupported %s event arguments %v", triggedEvent, evt.Acts()) 127 127 } 128 128 // no special filter parameters for these events, just return true if name matched 129 129 return true ··· 148 148 149 149 func matchPushEvent(commit *git.Commit, pushPayload *api.PushPayload, evt *jobparser.Event) bool { 150 150 // with no special filter parameters 151 - if len(evt.Acts) == 0 { 151 + if len(evt.Acts()) == 0 { 152 152 return true 153 153 } 154 154 ··· 157 157 hasTagFilter := false 158 158 refName := git.RefName(pushPayload.Ref) 159 159 // all acts conditions should be satisfied 160 - for cond, vals := range evt.Acts { 160 + for cond, vals := range evt.Acts() { 161 161 switch cond { 162 162 case "branches": 163 163 hasBranchFilter = true ··· 241 241 if hasBranchFilter && hasTagFilter { 242 242 matchTimes++ 243 243 } 244 - return matchTimes == len(evt.Acts) 244 + return matchTimes == len(evt.Acts()) 245 245 } 246 246 247 247 func matchIssuesEvent(commit *git.Commit, issuePayload *api.IssuePayload, evt *jobparser.Event) bool { 248 248 // with no special filter parameters 249 - if len(evt.Acts) == 0 { 249 + if len(evt.Acts()) == 0 { 250 250 return true 251 251 } 252 252 253 253 matchTimes := 0 254 254 // all acts conditions should be satisfied 255 - for cond, vals := range evt.Acts { 255 + for cond, vals := range evt.Acts() { 256 256 switch cond { 257 257 case "types": 258 258 for _, val := range vals { ··· 265 265 log.Warn("issue event unsupported condition %q", cond) 266 266 } 267 267 } 268 - return matchTimes == len(evt.Acts) 268 + return matchTimes == len(evt.Acts()) 269 269 } 270 270 271 271 func matchPullRequestEvent(commit *git.Commit, prPayload *api.PullRequestPayload, evt *jobparser.Event) bool { 272 272 // with no special filter parameters 273 - if len(evt.Acts) == 0 { 273 + if len(evt.Acts()) == 0 { 274 274 // defaultly, only pull request opened and synchronized will trigger workflow 275 275 return prPayload.Action == api.HookIssueSynchronized || prPayload.Action == api.HookIssueOpened 276 276 } 277 277 278 278 matchTimes := 0 279 279 // all acts conditions should be satisfied 280 - for cond, vals := range evt.Acts { 280 + for cond, vals := range evt.Acts() { 281 281 switch cond { 282 282 case "types": 283 283 action := prPayload.Action ··· 339 339 log.Warn("pull request event unsupported condition %q", cond) 340 340 } 341 341 } 342 - return matchTimes == len(evt.Acts) 342 + return matchTimes == len(evt.Acts()) 343 343 } 344 344 345 345 func matchIssueCommentEvent(commit *git.Commit, issueCommentPayload *api.IssueCommentPayload, evt *jobparser.Event) bool { 346 346 // with no special filter parameters 347 - if len(evt.Acts) == 0 { 347 + if len(evt.Acts()) == 0 { 348 348 return true 349 349 } 350 350 351 351 matchTimes := 0 352 352 // all acts conditions should be satisfied 353 - for cond, vals := range evt.Acts { 353 + for cond, vals := range evt.Acts() { 354 354 switch cond { 355 355 case "types": 356 356 for _, val := range vals { ··· 363 363 log.Warn("issue comment unsupported condition %q", cond) 364 364 } 365 365 } 366 - return matchTimes == len(evt.Acts) 366 + return matchTimes == len(evt.Acts()) 367 367 }
+2 -3
web_src/js/components/RepoActionView.vue
··· 1 1 <template> 2 2 <div class="action-view-container"> 3 3 <div class="action-view-header"> 4 - <div class="action-info-summary"> 4 + <div class="action-info-summary gt-ac"> 5 5 <ActionRunStatus :status="run.status" :size="20"/> 6 6 <div class="action-title"> 7 7 {{ run.title }} ··· 30 30 <div class="job-brief-item" v-for="(job, index) in run.jobs" :key="job.id"> 31 31 <a class="job-brief-link" :href="run.link+'/jobs/'+index"> 32 32 <ActionRunStatus :status="job.status"/> 33 - <span class="ui text">{{ job.name }}</span> 33 + <span class="ui text gt-mx-3">{{ job.name }}</span> 34 34 </a> 35 35 <button class="job-brief-rerun" @click="rerunJob(index)" v-if="job.canRerun"> 36 36 <SvgIcon name="octicon-sync" class="ui text black"/> ··· 404 404 } 405 405 406 406 .job-group-section .job-brief-list .job-brief-item .job-brief-link span { 407 - margin-right: 8px; 408 407 display: flex; 409 408 align-items: center; 410 409 }