Skip to content

Commit 8daadbd

Browse files
jade-guiton-ddmx-psimowies
authored andcommitted
[chore] Add CI check to enforce merge freeze during release (open-telemetry#37097)
#### Description As stated in the [Release Procedure document](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/release.md#releasing-opentelemetry-collector-contrib), all merging in Contrib should be halted while the "Prepare release" PR is open. This PR adds a CI check which fails if such a release PR is currently open. This is the same as the CI check introduced in Core as part of [this issue](open-telemetry/opentelemetry-collector#11707) ([Initial PR](open-telemetry/opentelemetry-collector#11744), [bug](open-telemetry/opentelemetry-collector#11808), [fix](open-telemetry/opentelemetry-collector#11849), [bug 2](open-telemetry/opentelemetry-collector#11906), [fix 2](open-telemetry/opentelemetry-collector#11936), [fix 3](open-telemetry/opentelemetry-collector#12045), [fix 4](open-telemetry/opentelemetry-collector#12051)). Like its predecessor, this will only be fully effective once the merge queue is enabled on this repo (see open-telemetry#36788 for progress on that), enabling us to do proper last-minute checks instead of relying on the freeze status at the time of the latest PR update. Similarly, for proper enforcement, this check will need to be marked as required in the main branch protections (I will create an issue on the community repo to that effect once this PR is merged). #### Link to tracking issue Updates open-telemetry#36848 #### Testing Considering the multiple iterations this code went through on Core, it should now work properly without adaptation. However, considering the multiple iterations this code went through on Core, we should expect the unexpected, especially when it comes to the interaction with the merge queue, so release managers will need to be aware of this change, in case it breaks the release process. --------- Co-authored-by: Pablo Baeyens <[email protected]> Co-authored-by: Moritz Wiesinger <[email protected]>
1 parent 57bfcf6 commit 8daadbd

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Merge freeze
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- ready_for_review
8+
- synchronize
9+
- reopened
10+
- labeled
11+
- unlabeled
12+
- enqueued
13+
branches: [main]
14+
merge_group:
15+
types: [checks_requested]
16+
17+
permissions: read-all
18+
19+
jobs:
20+
check-merge-freeze:
21+
name: Check
22+
# This condition is to avoid blocking the PR causing the freeze in the first place.
23+
if: |
24+
(!startsWith(github.event.pull_request.title || github.event.merge_group.head_commit.message, '[chore] Prepare release')) ||
25+
(!(github.event.pull_request.user.login == 'opentelemetrybot' || github.event.merge_group.head_commit.author.name == 'OpenTelemetry Bot'))
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
sparse-checkout: .github/workflows/scripts
31+
- run: ./.github/workflows/scripts/check-merge-freeze.sh
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
REPO: open-telemetry/opentelemetry-collector-contrib
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -e
2+
#
3+
# Copyright The OpenTelemetry Authors
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
BLOCKERS=$( gh pr list -A opentelemetrybot -S "[chore] Prepare release" --json url -q '.[].url' -R "${REPO}" )
7+
if [ "${BLOCKERS}" != "" ]; then
8+
echo "Merging in main is frozen, as there are open \"Prepare release\" PRs: ${BLOCKERS}"
9+
echo "If you believe this is no longer true, re-run this job to unblock your PR."
10+
exit 1
11+
fi

0 commit comments

Comments
 (0)