Skip to content

Commit b3b6b69

Browse files
authored
tag contrib on merge (#2178)
* Say contrib's release PR is tagged on merge Contrib's gitsplit workflow now has the same plan and tag jobs as core's, so its release pull request can say the release is tagged once it merges, and RELEASING.md no longer needs to treat contrib as tagged by hand. Contrib's tag job can't reach this repository, so it doesn't refresh the dashboard. RELEASING.md says to tick Refresh now instead. Assisted-By: Claude Code * Say both monorepos have a release environment
1 parent 356380c commit b3b6b69

2 files changed

Lines changed: 16 additions & 17 deletions

File tree

‎.github/workflows/release-pr.yml‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,11 @@ jobs:
115115
MONOREPO: open-telemetry/${{ matrix.monorepo }}
116116
SENDER: ${{ github.event.sender.login }}
117117
run: |
118-
args=("--repository=$MONOREPO")
118+
# Each monorepo's gitsplit workflow tags the release once it merges
119+
args=("--repository=$MONOREPO" --tags-on-merge)
119120
if [ "$GITHUB_EVENT_NAME" = pull_request ]; then
120121
args+=(--rebuild-only)
121122
fi
122-
# Core's gitsplit workflow tags the release once it merges. Contrib's doesn't yet.
123-
if [ "$MONOREPO" = open-telemetry/opentelemetry-php ]; then
124-
args+=(--tags-on-merge)
125-
fi
126123
# Dispatch already needs write access
127124
if [ "$GITHUB_EVENT_NAME" != workflow_dispatch ]; then
128125
args+=("--sender=$SENDER")

‎RELEASING.md‎

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,16 @@ entries, and the Release approval check fails on it.
156156
Merge the release pull request once it is approved and its checks pass. gitsplit then pushes each
157157
package to its split repository.
158158

159-
In core, two more jobs in the same
160-
[gitsplit](https://github.com/open-telemetry/opentelemetry-php/actions/workflows/split-monorepo.yaml)
161-
run then tag the release:
159+
Two more jobs in the same gitsplit run then tag the release. The run is in the monorepo the release
160+
is for: [core](https://github.com/open-telemetry/opentelemetry-php/actions/workflows/split-monorepo.yaml)
161+
or [contrib](https://github.com/open-telemetry/opentelemetry-php-contrib/actions/workflows/split_monorepo.yaml).
162162

163163
1. Plan the release runs `release:run --dry-run` on the merge commit, and comments on the pull
164164
request with the versions it would tag.
165165
2. Tag the release waits for approval. Check the comment, open the run from its link, and approve
166-
the job under Review deployments. It runs `release:run`, comments with a link to each release,
167-
and refreshes the dashboard.
166+
the job under Review deployments. It runs `release:run` and comments with a link to each
167+
release. In core it also refreshes the dashboard. Contrib's job can't reach this repository, so
168+
tick Refresh now on contrib's dashboard, or wait for the daily rewrite.
168169

169170
If the dry run finds a problem, such as a split that gitsplit hasn't pushed, the comment lists it and
170171
nothing is tagged. Fix it, then [tag by hand](#tag-by-hand).
@@ -174,7 +175,7 @@ including any tagged by hand since the comment.
174175

175176
### Tag by hand
176177

177-
Contrib isn't tagged on merge yet, and core may need tagging by hand if the job can't run. Run
178+
If the tag job can't run, tag by hand. Run
178179
[release:run](https://github.com/opentelemetry-php/dev-tools#tag-a-release) from a full checkout of
179180
the monorepo at the release's merge commit. It needs a token that can create releases in the
180181
opentelemetry-php organization, which only its administrators have. See
@@ -206,7 +207,7 @@ follow
206207
| `release-dashboard.yml` | Rewrites the dashboard issues |
207208
| `release-pr.yml` | Opens and rebuilds the release pull requests, and adds the note when `main` moves |
208209
| `release-approval.yml` | The Release approval check on core's release pull request |
209-
| `split-monorepo.yaml` | Pushes each package to its split repository, and tags core's releases |
210+
| `split-monorepo.yaml`, and `split_monorepo.yaml` in contrib | Pushes each package to its split repository, and tags the monorepo's releases |
210211

211212
The dashboard workflow fails unless exactly one open issue has the dashboard's label. To replace
212213
one that was closed or deleted, open an issue titled `Release dashboard: core` or
@@ -221,15 +222,16 @@ The Release approval check blocks a merge only once it is a required status chec
221222
repository administrator sets. It is skipped on other pull requests, which counts as passing.
222223
Contrib has no copy of the check yet, as a workflow here can't see contrib's pull requests.
223224

224-
The tag job runs in the `release` environment. A repository administrator creates it under
225-
Settings, Environments, with:
225+
The tag job runs in the monorepo's `release` environment. Core and contrib each have one, which a
226+
repository administrator set up under Settings, Environments, with:
226227

227228
- Required reviewers: the maintainers who may approve a tag. Leave Prevent self-review off, so the
228229
maintainer who merged can approve.
229230
- Deployment branches and tags: `main` only.
230-
- The `OPENTELEMETRY_PHP_CLIENT_ID` variable and `OPENTELEMETRY_PHP_PRIVATE_KEY` secret of the
231-
`opentelemetry-php` GitHub App, which an administrator of the opentelemetry-php organization can
232-
create a key for.
231+
- In core, the `OPENTELEMETRY_PHP_CLIENT_ID` variable and `OPENTELEMETRY_PHP_PRIVATE_KEY` secret of
232+
the `opentelemetry-php` GitHub App, which an administrator of the opentelemetry-php organization
233+
can create a key for. Contrib has them as repository settings already, for gitsplit, and the tag
234+
job reads those.
233235

234236
The tag job waits for approval only while the environment has required reviewers. So the plan job
235237
checks for them first, and without them it fails and tags nothing.

0 commit comments

Comments
 (0)