headroom/.github/scripts
Parideboy 738f984d33 ci(pr-health): keep a failed base-file comparison from clearing the rebase label
The base-file comparison fell back to `[]` when the API call failed, so
`drift_state()` saw a positive `behind_by` with no moved files, found no
overlap and returned `current`. The label step then removed
`status: needs rebase` from a pull request that was genuinely stale, which
contradicts the fail-safe behaviour the first comparison already has. The
same hole existed when the first comparison answered without a merge base.

The workflow now sets an empty-string sentinel before the call and resets to
it when the call fails, so partial output from a call that died midway is
discarded too. `parse_base_files()` maps that sentinel (and any unusable
payload) to `None`, and `drift_state()` returns `unknown` when the branch is
behind but the comparison never answered, which neither adds nor removes the
label. A successful comparison that returns no files still classifies as
`current`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-27 17:29:49 +02:00
..
pr-health-labels.py ci(pr-health): keep a failed base-file comparison from clearing the rebase label 2026-08-27 17:29:49 +02:00