From ad90bb4b68c062afeb62089c79b3d3c4b3e3d9f6 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 8 Sep 2025 00:14:44 +0000 Subject: [PATCH] Revert "fix: also cascade if run-*-test is set when the PR is open (#948)" (#950) This reverts commit 1178cf6d247afe88d47fe63d0e776893ae610dda. This was an incorrect fix to a different problem. The `labeled` event is run when a pull request is opened. Adding an `opened` event will just needlessly duplicate the runs. The actual problem was me assuming too quickly that a short runtime (15s) indicated that the cascade was not run. This is what happened at https://code.forgejo.org/forgejo/runner/pulls/935 - the cascade is run https://code.forgejo.org/forgejo/runner/pulls/935#issuecomment-57986 - the duration is very short because the commit status is set [by the last event (closed)](https://code.forgejo.org/forgejo/runner/actions/runs/9344/jobs/0#jobstep-1-12) ![image](/attachments/2aecc2f6-8fc0-4778-91c3-de689808a30e) - other - [PR](https://code.forgejo.org/forgejo/runner/pulls/950): Revert "fix: also cascade if run-*-test is set when the PR is open (#948)" Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/950 Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- .forgejo/workflows/cascade-forgejo.yml | 5 ++--- .forgejo/workflows/cascade-setup-forgejo.yml | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/cascade-forgejo.yml b/.forgejo/workflows/cascade-forgejo.yml index ad422aa7..c1c09565 100644 --- a/.forgejo/workflows/cascade-forgejo.yml +++ b/.forgejo/workflows/cascade-forgejo.yml @@ -28,7 +28,6 @@ on: - 'wip-cascade' pull_request_target: types: - - opened - synchronize - labeled - closed @@ -64,7 +63,7 @@ jobs: # Always run when a commit is pushed to the main or wip-cascade branch # If this is a pull request, run # - when the `run-forgejo-tests` label is set (label_updated) (but not if another label is set or if a label is removed) - # - when a new commit is pushed to the pull request (synchronized or opened) if the `run-forgejo-tests` is already present + # - when a new commit is pushed to the pull request (synchronized) if the `run-forgejo-tests` is already present # - when the pull request is closed, which also happens when it is merged, so that the Forgejo pull request is closed # if: > @@ -74,7 +73,7 @@ jobs: ) || ( forge.event_name == 'pull_request_target' && ( forge.event.action == 'closed' || - ( ( forge.event.action == 'synchronized' || forge.event.action == 'opened' ) && contains(forge.event.pull_request.labels.*.name, 'run-forgejo-tests') ) || + ( forge.event.action == 'synchronized' && contains(forge.event.pull_request.labels.*.name, 'run-forgejo-tests') ) || ( forge.event.action == 'label_updated' && forge.event.label.name == 'run-forgejo-tests' ) ) ) diff --git a/.forgejo/workflows/cascade-setup-forgejo.yml b/.forgejo/workflows/cascade-setup-forgejo.yml index 968ecffc..fff2309f 100644 --- a/.forgejo/workflows/cascade-setup-forgejo.yml +++ b/.forgejo/workflows/cascade-setup-forgejo.yml @@ -27,7 +27,6 @@ on: - 'wip-cascade' pull_request_target: types: - - opened - synchronize - labeled - closed @@ -63,7 +62,7 @@ jobs: # Always run when a commit is pushed to the wip-cascade branch # If this is a pull request, run # - when the `run-end-to-end-tests` label is set (label_updated) (but not if another label is set or if a label is removed) - # - when a new commit is pushed to the pull request (synchronized or opened) if the `run-end-to-end-tests` is already present + # - when a new commit is pushed to the pull request (synchronized) if the `run-end-to-end-tests` is already present # - when the pull request is closed, which also happens when it is merged, so that the setup-forgejo & end-to-end pull requests are closed # if: > @@ -73,7 +72,7 @@ jobs: ) || ( forge.event_name == 'pull_request_target' && ( forge.event.action == 'closed' || - ( ( forge.event.action == 'synchronized' || forge.event.action == 'opened' ) && contains(forge.event.pull_request.labels.*.name, 'run-end-to-end-tests') ) || + ( forge.event.action == 'synchronized' && contains(forge.event.pull_request.labels.*.name, 'run-end-to-end-tests') ) || ( forge.event.action == 'label_updated' && forge.event.label.name == 'run-end-to-end-tests' ) ) )