发布

  • [OPIK-7374] [INFRA] fix: order size-labeler after PR labeler to stop size-label clobber (#7502)

    frostbyte_neo 发布于 2026-07-20 11:19:12 +00:00

    actions/labeler runs with sync-labels, which writes an authoritative label
    set computed from a snapshot taken when the action started. The size labeler
    lived in a separate workflow with its own concurrency group, so the two ran
    in parallel: labeler read the label set before the size label was applied,
    then its sync write dropped it. On PR #7498 the size step added 🟢 size/S at
    14:23:15 while labeler (started 14:23:14, finished 14:23:17) synced it away,
    leaving the PR with no size label.

    Merge the size labeler into the Auto Label PR workflow as a second job that
    needs the labeler job, so it runs strictly after the sync completes and can
    no longer be clobbered. size-labeler uses if: !cancelled() so a labeler
    failure (e.g. a flaky action download) does not skip size labeling, while a
    superseded run is still skipped. Both jobs share the workflow's single
    concurrency group and stay independently re-runnable. Keep sync-labels: true —
    ordering, not disabling it, removes the race, so stale path labels still get
    cleaned up.

    Reconcile the size bucket with an incremental delta (remove non-target managed
    buckets, add the target if missing) rather than a whole-set setLabels write:
    now that ordering serializes the writers, atomicity is unnecessary, and a delta
    only ever touches size labels so it can't clobber a label added by anyone else.
    Read live labels rather than the stale event payload, and log each mutation so
    a run's output shows what it actually did. Bump actions/labeler v5 -> v6 to
    clear the Node 20 deprecation warning.

    Co-authored-by: Claude Opus 4.8 (1M context) noreply@anthropic.com

    下载附件