Skip to content

Commit bb6a09a

Browse files
authored
Revert "Change gh runners concurrency rules (#18281)"
This reverts commit 0bb6aaa.
1 parent ba59f2e commit bb6a09a

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

.github/pull_request_template.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ gitpod:summary
7474
If enabled this will create the environment on GCE infra
7575
- [ ] with-integration-tests=all
7676
Valid options are `all`, `workspace`, `webapp`, `ide`, `jetbrains`, `vscode`, `ssh`
77-
- [ ] with-monitoring
7877
</details>
7978

8079
/hold

.github/workflows/build.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@ jobs:
1515
create-runner:
1616
uses: ./.github/workflows/create_runner.yml
1717
secrets: inherit
18-
concurrency:
19-
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-create-runner
20-
cancel-in-progress: false
2118

2219
configuration:
2320
name: Configure job parameters
2421
runs-on: ${{ needs.create-runner.outputs.label }}
2522
needs: [create-runner]
2623
concurrency:
27-
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-configuration
28-
cancel-in-progress: true
24+
# github.head_ref is set by a pull_request event - contains the name of the source branch of the PR
25+
# github.ref_name is set if the event is NOT a pull_request - it contains only the branch name.
26+
group: ${{ github.head_ref || github.ref_name }}-configuration
2927
outputs:
3028
is_main_branch: ${{ (github.head_ref || github.ref) == 'refs/heads/main' }}
3129
version: ${{ steps.branches.outputs.sanitized-branch-name }}-gha.${{github.run_number}}
@@ -42,7 +40,6 @@ jobs:
4240
pr_no_diff_skip: ${{ steps.pr-diff.outputs.pr_no_diff_skip }}
4341
with_werft: ${{ steps.output.outputs.with-werft }}
4442
with_integration_tests: ${{ steps.output.outputs.with_integration_tests }}
45-
with_monitoring: ${{ contains( steps.pr-details.outputs.pr_body, '[x] with-monitoring') }}
4643
latest_ide_version: ${{ contains( steps.pr-details.outputs.pr_body, '[x] latest-ide-version=true') }}
4744
leeway_cache_bucket: ${{ steps.output.outputs.leeway_cache_bucket }}
4845
pr_number: ${{ steps.pr-details.outputs.number }}
@@ -90,7 +87,7 @@ jobs:
9087
(needs.configuration.outputs.preview_enable == 'true')
9188
needs: [configuration, create-runner]
9289
concurrency:
93-
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-build-previewctl
90+
group: ${{ github.workflow }}-${{ github.ref }}-build-previewctl
9491
cancel-in-progress: ${{ needs.configuration.outputs.is_main_branch == 'false' }}
9592
runs-on: ${{ needs.create-runner.outputs.label }}
9693
container:
@@ -118,7 +115,7 @@ jobs:
118115
(needs.configuration.outputs.is_main_branch != 'true')
119116
runs-on: ${{ needs.create-runner.outputs.label }}
120117
concurrency:
121-
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-infrastructure
118+
group: ${{ github.head_ref || github.ref_name }}-infrastructure
122119
cancel-in-progress: true
123120
steps:
124121
- uses: actions/checkout@v3
@@ -138,7 +135,9 @@ jobs:
138135
needs: [configuration, create-runner]
139136
runs-on: ${{ needs.create-runner.outputs.label }}
140137
concurrency:
141-
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-build-gitpod
138+
group: ${{ github.head_ref || github.ref_name }}-build-gitpod
139+
# For the main branch we always want the build job to run to completion
140+
# For other branches we only care about the "latest" version, so it is fine to cancel in-progress builds
142141
cancel-in-progress: ${{ needs.configuration.outputs.is_main_branch == 'false' }}
143142
services:
144143
mysql:
@@ -330,8 +329,8 @@ jobs:
330329
- create-runner
331330
runs-on: ${{ needs.create-runner.outputs.label }}
332331
concurrency:
333-
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-install
334-
cancel-in-progress: ${{ needs.configuration.outputs.is_main_branch == 'false' }}
332+
group: ${{ github.workflow }}-${{ github.ref }}-install
333+
cancel-in-progress: true
335334
steps:
336335
- uses: actions/checkout@v3
337336
- name: Deploy Gitpod to the preview environment
@@ -373,9 +372,8 @@ jobs:
373372
name: "Install Monitoring Satellite"
374373
needs: [infrastructure, build-previewctl, create-runner]
375374
runs-on: ${{ needs.create-runner.outputs.label }}
376-
if: needs.configuration.outputs.with_monitoring == 'true'
377375
concurrency:
378-
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-monitoring
376+
group: ${{ github.workflow }}-${{ github.ref }}-monitoring
379377
cancel-in-progress: true
380378
steps:
381379
- uses: actions/checkout@v3
@@ -400,7 +398,7 @@ jobs:
400398
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aledbf-new-dev-image-gha.13182
401399
if: needs.configuration.outputs.with_integration_tests != ''
402400
concurrency:
403-
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-integration-test
401+
group: ${{ github.workflow }}-${{ github.ref }}-integration-test
404402
cancel-in-progress: true
405403
steps:
406404
- uses: actions/checkout@v3
@@ -446,6 +444,3 @@ jobs:
446444
secrets: inherit
447445
with:
448446
runner-label: ${{ needs.create-runner.outputs.label }}
449-
concurrency:
450-
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-delete-runner
451-
cancel-in-progress: false

0 commit comments

Comments
 (0)