getsentry / getsentry/self-hosted
bin/react-to-product-owners-yml-changes.py cannot run: .github/labels.yml was deleted in #109140
- Dominant language
- Shell
- Stars
- 9.6k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 15
Description
### What happens
`bin/react-to-product-owners-yml-changes.py` cannot run from a checkout of `master`. It opens `.github/labels.yml` unconditionally, and that file no longer exists.
```
Traceback (most recent call last):
File "bin/react-to-product-owners-yml-changes.py", line 107, in
raise SystemExit(main())
File "bin/react-to-product-owners-yml-changes.py", line 19, in main
labels = open(LABELS_YAML)
FileNotFoundError: [Errno 2] No such file or directory: '.github/labels.yml'
```
### Cause
`.github/labels.yml` was deleted in `89d0cfab9d` — "ci: delete labels-sync (#109140)", merged 2026-03-17 — together with `.github/workflows/sync-labels.yml` (514 and 77 lines removed). That commit removed the label *file* and the workflow that consumed it, but left everything else that depends on it:
| Path | Reference |
| --- | --- |
| `bin/react-to-product-owners-yml-changes.py` | `LABELS_YAML = ".github/labels.yml"`, read at line 19, written at line 64 |
| `bin/react-to-product-owners-yml-changes.sh` | line 14, `git add .github/labels.yml` |
| `.github/workflows/react-to-product-owners-yml-changes.yml` | line 45, runs the shell script |
| `.github/CODEOWNERS` | line 140, `/.github/labels.yml @getsentry/dev-infra` |
The script is not a leftover of a never-finished feature: it needs the file as *input*. It reads the existing label list, fast-forwards past the `Product Area:` block, preserves the labels before and after it, and writes the file back with a regenerated `Product Area:` section. With the file gone there is nothing to preserve, so the failure is at the first read — before anything is written.
`.github/labels.yml` is not gitignored, so this is not a generated-file situation. It is present at tags `23.1.0`, `24.1.0`, `25.1.0` and `26.1.0`, and absent at `26.8.0` and at `22.1.0` and earlier.
### Reproduction
```
python bin/react-to-product-owners-yml-changes.py
```
fails with the traceback above.
### Impact
The `React to product-owners.yml changes` workflow (`.github/workflows/react-to-product-owners-yml-changes.yml`) dispatches this script, so it cannot reach its own logic. For what it is worth, that workflow was already failing before the deletion: 25 of the last 25 runs I sampled failed, spanning 2025-09-11 to 2026-06-05 (most recently https://github.com/getsentry/sentry/actions/runs/27046418171). The deleted file is therefore not the cause of those failures, but it does mean the workflow has one more reason not to work, and its logs have since expired so the original cause cannot be read back from them.
`/.github/labels.yml` in `.github/CODEOWNERS` also points at a path that no longer exists.
### The open question
Which direction is intended here?
1. **Complete the removal.** Delete the orphaned workflow, both `bin/react-to-product-owners-yml-changes.*` scripts, and the `CODEOWNERS` line. getsentry/sentry#109140's reasoning was that `sync-labels.yml` wanted to remove labels added manually since, and `don't want people to accidentally delete everything` — but `react-to-product-owners-yml-changes.yml` only opens a PR for review, so it does not carry that risk and may have been deliberately kept. PR getsentry/sentry#110606 ("Replace product-owners sync with Linear-based triaging workflow") was closed unmerged, which suggests the direction was not settled.
2. **Restore `.github/labels.yml`** so the script runs again. I can't reconstruct it faithfully myself: its non-`Product Area:` half is derived from `product-owners.yml` in `getsentry/security-as-code`, which is private.
I have not opened a PR for either, because both are CI/workflow changes and the choice between them is a maintainer call.
Contributor guide
Research direction
Start by reproducing the failure with `python bin/react-to-product-owners-yml-changes.py `, then read the referenced Python and shell scripts, workflows, and CODEOWNERS entry. The missing `.github/labels.yml` requires a maintainer decision between completing the removal and restoring the file; done should leave no workflow dependency on a missing path and should make the intended workflow behavior runnable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, python, shell
- Domain
- ci-cd
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100