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.

Revert "chore(ci): merge jobs in issue-labels.yml in one workflow" (#6178)

This is a clean revert of the commits that led to grouping all jobs related to issue labeling into one workflow. The assumption that it would be more efficient was incorrect because it assumed the conditions for running each job would be evaluated statically Forgejo side. In reality the conditions are evaluated by the runner and multiplies the number of runs required instead of decreasing them. In turn, this clutters the status line of each pull request with numerous skipped runs. Finally it is more complex to maintain multiple jobs into a single workflow because the conditions for it to run have to be duplicated.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6178
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>

authored by

Earl Warren
Earl Warren
and committed by
Earl Warren
87fd4eea e801d53e

+218 -206
+59
.forgejo/workflows/backport.yml
··· 1 + # Copyright 2024 The Forgejo Authors 2 + # SPDX-License-Identifier: MIT 3 + # 4 + # To modify this workflow: 5 + # 6 + # - change pull_request_target: to pull_request: 7 + # so that it runs from a pull request instead of the default branch 8 + # 9 + # - push it to the wip-ci-backport branch on the forgejo repository 10 + # otherwise it will not have access to the secrets required to push 11 + # the PR 12 + # 13 + # - open a pull request targetting wip-ci-backport that includes a change 14 + # that can be backported without conflict in v1.21 and set the 15 + # `backport/v1.21` label. 16 + # 17 + # - once it works, open a pull request for the sake of keeping track 18 + # of the change even if the PR won't run it because it will use 19 + # whatever is in the default branch instead 20 + # 21 + # - after it is merged, double check it works by setting a 22 + # `backport/v1.21` label on a merged pull request that can be backported 23 + # without conflict. 24 + # 25 + on: 26 + pull_request_target: 27 + types: 28 + - closed 29 + - labeled 30 + 31 + jobs: 32 + backporting: 33 + if: > 34 + ( vars.ROLE == 'forgejo-coding' ) && ( 35 + github.event.pull_request.merged 36 + && 37 + contains(toJSON(github.event.pull_request.labels), 'backport/v') 38 + ) 39 + runs-on: docker 40 + container: 41 + image: 'code.forgejo.org/oci/node:20-bookworm' 42 + steps: 43 + - name: event info 44 + run: | 45 + cat <<'EOF' 46 + ${{ toJSON(github) }} 47 + EOF 48 + - uses: https://code.forgejo.org/actions/git-backporting@v4.8.4 49 + with: 50 + target-branch-pattern: "^backport/(?<target>(v.*))$" 51 + strategy: ort 52 + strategy-option: find-renames 53 + cherry-pick-options: -x 54 + auth: ${{ secrets.BACKPORT_TOKEN }} 55 + pull-request: ${{ github.event.pull_request.url }} 56 + auto-no-squash: true 57 + enable-err-notification: true 58 + git-user: forgejo-backport-action 59 + git-email: forgejo-backport-action@noreply.codeberg.org
+75
.forgejo/workflows/cascade-setup-end-to-end.yml
··· 1 + # Copyright 2024 The Forgejo Authors 2 + # SPDX-License-Identifier: MIT 3 + # 4 + # To modify this workflow: 5 + # 6 + # - push it to the wip-ci-end-to-end branch on the forgejo repository 7 + # otherwise it will not have access to the secrets required to push 8 + # the cascading PR 9 + # 10 + # - once it works, open a pull request for the sake of keeping track 11 + # of the change even if the PR won't run it because it will use 12 + # whatever is in the default branch instead 13 + # 14 + # - after it is merged, double check it works by setting the 15 + # run-end-to-end-test on a pull request (any pull request will do) 16 + # 17 + name: end-to-end 18 + 19 + on: 20 + push: 21 + branches: 22 + - 'wip-ci-end-to-end' 23 + pull_request_target: 24 + types: 25 + - labeled 26 + 27 + jobs: 28 + info: 29 + if: vars.ROLE == 'forgejo-coding' 30 + runs-on: docker 31 + container: 32 + image: code.forgejo.org/oci/node:20-bookworm 33 + steps: 34 + - name: event 35 + run: | 36 + echo github.event.pull_request.head.repo.fork = ${{ github.event.pull_request.head.repo.fork }} 37 + echo github.event.action = ${{ github.event.action }} 38 + echo github.event.label 39 + cat <<'EOF' 40 + ${{ toJSON(github.event.label) }} 41 + EOF 42 + cat <<'EOF' 43 + ${{ toJSON(github.event) }} 44 + EOF 45 + 46 + cascade: 47 + if: > 48 + vars.ROLE == 'forgejo-coding' && ( 49 + github.event_name == 'push' || 50 + ( 51 + github.event.action == 'label_updated' && github.event.label.name == 'run-end-to-end-tests' 52 + ) 53 + ) 54 + runs-on: docker 55 + container: 56 + image: code.forgejo.org/oci/node:20-bookworm 57 + steps: 58 + - uses: actions/checkout@v4 59 + with: 60 + fetch-depth: '0' 61 + show-progress: 'false' 62 + - uses: actions/cascading-pr@v2 63 + with: 64 + origin-url: ${{ env.GITHUB_SERVER_URL }} 65 + origin-repo: ${{ github.repository }} 66 + origin-token: ${{ secrets.END_TO_END_CASCADING_PR_ORIGIN }} 67 + origin-pr: ${{ github.event.pull_request.number }} 68 + origin-ref: ${{ github.event_name == 'push' && github.event.ref || '' }} 69 + destination-url: https://code.forgejo.org 70 + destination-fork-repo: cascading-pr/end-to-end 71 + destination-repo: forgejo/end-to-end 72 + destination-branch: main 73 + destination-token: ${{ secrets.END_TO_END_CASCADING_PR_DESTINATION }} 74 + close-merge: true 75 + update: .forgejo/cascading-pr-end-to-end
-206
.forgejo/workflows/issue-labels.yml
··· 1 - # Copyright 2024 The Forgejo Authors 2 - # SPDX-License-Identifier: MIT 3 - # 4 - # To modify the pull_request_target jobs: 5 - # 6 - # - push it to the wip-ci-issue-labels branch on the forgejo repository 7 - # otherwise it will not have access to the required secrets. 8 - # 9 - # - once it works, open a pull request for the sake of keeping track 10 - # of the change even if the PR won't run it because it will use 11 - # whatever is in the default branch instead 12 - # 13 - # - after it is merged, double check it works by changing the labels 14 - # to trigger the job. 15 - # 16 - name: issue-labels 17 - 18 - on: 19 - push: 20 - branches: 21 - - 'wip-ci-issue-labels' 22 - 23 - pull_request_target: 24 - types: 25 - - closed 26 - - edited 27 - - labeled 28 - - synchronize 29 - 30 - pull_request: 31 - types: 32 - - edited 33 - - labeled 34 - - opened 35 - - synchronize 36 - 37 - jobs: 38 - info: 39 - if: vars.ROLE == 'forgejo-coding' 40 - runs-on: docker 41 - container: 42 - image: code.forgejo.org/oci/node:20-bookworm 43 - steps: 44 - - name: Debug info 45 - run: | 46 - cat <<'EOF' 47 - ${{ toJSON(github) }} 48 - EOF 49 - 50 - end-to-end: 51 - if: > 52 - vars.ROLE == 'forgejo-coding' && 53 - 54 - secrets.END_TO_END_CASCADING_PR_DESTINATION != '' && 55 - secrets.END_TO_END_CASCADING_PR_ORIGIN != '' && 56 - 57 - ( 58 - github.event_name == 'push' || 59 - ( 60 - github.event_name == 'pull_request_target' && 61 - github.event.action == 'label_updated' && 62 - github.event.label.name == 'run-end-to-end-tests' 63 - ) 64 - ) 65 - runs-on: docker 66 - container: 67 - image: code.forgejo.org/oci/node:20-bookworm 68 - steps: 69 - - name: Debug info 70 - run: | 71 - cat <<'EOF' 72 - ${{ toJSON(github) }} 73 - EOF 74 - - uses: actions/checkout@v4 75 - with: 76 - fetch-depth: '0' 77 - show-progress: 'false' 78 - - uses: actions/cascading-pr@v2 79 - with: 80 - origin-url: ${{ env.GITHUB_SERVER_URL }} 81 - origin-repo: ${{ github.repository }} 82 - origin-token: ${{ secrets.END_TO_END_CASCADING_PR_ORIGIN }} 83 - origin-pr: ${{ github.event.pull_request.number }} 84 - origin-ref: ${{ github.event_name == 'push' && github.event.ref || '' }} 85 - destination-url: https://code.forgejo.org 86 - destination-fork-repo: cascading-pr/end-to-end 87 - destination-repo: forgejo/end-to-end 88 - destination-branch: main 89 - destination-token: ${{ secrets.END_TO_END_CASCADING_PR_DESTINATION }} 90 - close-merge: true 91 - update: .forgejo/cascading-pr-end-to-end 92 - 93 - backporting: 94 - if: > 95 - vars.ROLE == 'forgejo-coding' && 96 - 97 - secrets.BACKPORT_TOKEN != '' && 98 - 99 - github.event_name == 'pull_request_target' && 100 - ( 101 - github.event.pull_request.merged && 102 - contains(toJSON(github.event.pull_request.labels), 'backport/v') 103 - ) 104 - runs-on: docker 105 - container: 106 - image: 'code.forgejo.org/oci/node:20-bookworm' 107 - steps: 108 - - name: Debug info 109 - run: | 110 - cat <<'EOF' 111 - ${{ toJSON(github) }} 112 - EOF 113 - - uses: https://code.forgejo.org/actions/git-backporting@v4.8.4 114 - with: 115 - target-branch-pattern: "^backport/(?<target>(v.*))$" 116 - strategy: ort 117 - strategy-option: find-renames 118 - cherry-pick-options: -x 119 - auth: ${{ secrets.BACKPORT_TOKEN }} 120 - pull-request: ${{ github.event.pull_request.url }} 121 - auto-no-squash: true 122 - enable-err-notification: true 123 - git-user: forgejo-backport-action 124 - git-email: forgejo-backport-action@noreply.codeberg.org 125 - 126 - merge-conditions: 127 - if: > 128 - vars.ROLE == 'forgejo-coding' && 129 - 130 - github.event_name == 'pull_request' && 131 - ( 132 - github.event.action == 'label_updated' || 133 - github.event.action == 'edited' || 134 - github.event.action == 'synchronized' || 135 - github.event.action == 'opened' 136 - ) 137 - runs-on: docker 138 - container: 139 - image: 'code.forgejo.org/oci/node:20-bookworm' 140 - steps: 141 - - name: Debug info 142 - run: | 143 - cat <<'EOF' 144 - ${{ toJSON(github) }} 145 - EOF 146 - - name: Missing test label 147 - if: > 148 - !( 149 - contains(toJSON(github.event.pull_request.labels), 'test/present') 150 - || contains(toJSON(github.event.pull_request.labels), 'test/not-needed') 151 - || contains(toJSON(github.event.pull_request.labels), 'test/manual') 152 - ) 153 - run: | 154 - echo "Test label must be set to either 'present', 'not-needed' or 'manual'." 155 - exit 1 156 - - name: Missing manual test instructions 157 - if: > 158 - ( 159 - contains(toJSON(github.event.pull_request.labels), 'test/manual') 160 - && !contains(toJSON(github.event.pull_request.body), '# Test') 161 - ) 162 - run: | 163 - echo "Manual test label is set. The PR description needs to contain test steps introduced by a heading like:" 164 - echo "# Testing" 165 - exit 1 166 - 167 - release-notes: 168 - if: > 169 - vars.ROLE == 'forgejo-coding' && 170 - 171 - secrets.RELEASE_NOTES_ASSISTANT_TOKEN != '' && 172 - 173 - github.event_name == 'pull_request_target' && 174 - contains(github.event.pull_request.labels.*.name, 'worth a release-note') && 175 - ( 176 - github.event.action == 'label_updated' || 177 - github.event.action == 'edited' || 178 - github.event.action == 'synchronized' 179 - ) 180 - 181 - runs-on: docker 182 - container: 183 - image: 'code.forgejo.org/oci/node:20-bookworm' 184 - steps: 185 - - name: Debug info 186 - run: | 187 - cat <<'EOF' 188 - ${{ toJSON(github) }} 189 - EOF 190 - 191 - - uses: https://code.forgejo.org/actions/checkout@v4 192 - 193 - - uses: https://code.forgejo.org/actions/setup-go@v5 194 - with: 195 - go-version-file: "go.mod" 196 - cache: false 197 - 198 - - name: apt install jq 199 - run: | 200 - export DEBIAN_FRONTEND=noninteractive 201 - apt-get update -qq 202 - apt-get -q install -y -qq jq 203 - 204 - - name: release-notes-assistant preview 205 - run: | 206 - go run code.forgejo.org/forgejo/release-notes-assistant@v1.1.1 --config .release-notes-assistant.yaml --storage pr --storage-location ${{ github.event.pull_request.number }} --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} preview ${{ github.event.pull_request.number }}
+45
.forgejo/workflows/merge-requirements.yml
··· 1 + # Copyright 2024 The Forgejo Authors 2 + # SPDX-License-Identifier: MIT 3 + 4 + name: requirements 5 + 6 + on: 7 + pull_request: 8 + types: 9 + - labeled 10 + - edited 11 + - opened 12 + - synchronize 13 + 14 + jobs: 15 + merge-conditions: 16 + if: vars.ROLE == 'forgejo-coding' 17 + runs-on: docker 18 + container: 19 + image: 'code.forgejo.org/oci/node:20-bookworm' 20 + steps: 21 + - name: Debug output 22 + run: | 23 + cat <<'EOF' 24 + ${{ toJSON(github.event) }} 25 + EOF 26 + - name: Missing test label 27 + if: > 28 + !( 29 + contains(toJSON(github.event.pull_request.labels), 'test/present') 30 + || contains(toJSON(github.event.pull_request.labels), 'test/not-needed') 31 + || contains(toJSON(github.event.pull_request.labels), 'test/manual') 32 + ) 33 + run: | 34 + echo "Test label must be set to either 'present', 'not-needed' or 'manual'." 35 + exit 1 36 + - name: Missing manual test instructions 37 + if: > 38 + ( 39 + contains(toJSON(github.event.pull_request.labels), 'test/manual') 40 + && !contains(toJSON(github.event.pull_request.body), '# Test') 41 + ) 42 + run: | 43 + echo "Manual test label is set. The PR description needs to contain test steps introduced by a heading like:" 44 + echo "# Testing" 45 + exit 1
+39
.forgejo/workflows/release-notes-assistant.yml
··· 1 + on: 2 + pull_request_target: 3 + types: 4 + - edited 5 + - synchronize 6 + - labeled 7 + 8 + jobs: 9 + release-notes: 10 + if: ( vars.ROLE == 'forgejo-coding' ) && contains(github.event.pull_request.labels.*.name, 'worth a release-note') 11 + runs-on: docker 12 + container: 13 + image: 'code.forgejo.org/oci/node:20-bookworm' 14 + steps: 15 + - uses: https://code.forgejo.org/actions/checkout@v4 16 + 17 + - name: event 18 + run: | 19 + cat <<'EOF' 20 + ${{ toJSON(github.event.pull_request.labels.*.name) }} 21 + EOF 22 + cat <<'EOF' 23 + ${{ toJSON(github.event) }} 24 + EOF 25 + 26 + - uses: https://code.forgejo.org/actions/setup-go@v5 27 + with: 28 + go-version-file: "go.mod" 29 + cache: false 30 + 31 + - name: apt install jq 32 + run: | 33 + export DEBIAN_FRONTEND=noninteractive 34 + apt-get update -qq 35 + apt-get -q install -y -qq jq 36 + 37 + - name: release-notes-assistant preview 38 + run: | 39 + go run code.forgejo.org/forgejo/release-notes-assistant@v1.1.1 --config .release-notes-assistant.yaml --storage pr --storage-location ${{ github.event.pull_request.number }} --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} preview ${{ github.event.pull_request.number }}