Scope sync failure alerts to owned issues
Fixes #280
The reusable sync alert selected issues by title. The extracted shell reproduced three unintended writes against synthetic issue data. It closed a person's issue after recovery, edited the open issue on failure, and reopened and edited the closed issue on failure.
The job now prefers an alert authored by github-actions[bot] with a hidden body marker, even if the title has changed. It recognizes legacy alerts by bot author and exact title and marks them when it refreshes their body. On failure without an owned issue, it creates a marked alert. Recovery closes open owned alerts. The job summary counts same-title issues from other authors that it left untouched.
The caller template, README and recovery guide explain the ownership rule. The closeout and other reusable workflows have no sibling issue alert.
All 933 targeted Node tests passed across 22 files with zero skips. The linked Node alert suite and direct Bun alert suite each passed 10 of 10. Typecheck, lint, source and test builds, ownership inventory, privacy and changelog checks passed.
Reverting the workflow in a disposable copy failed seven tests. Independent controls failed when the author check, marker matching, legacy fallback, summary, marker write or create action was removed. Reverting each of the three documentation files independently failed the documentation test. The restored version passed all ten alert tests.
Summary by Sourcery
Restrict sync failure alert reconciliation to workflow-owned issues while preserving legacy alerts and leaving similarly titled issues from other authors untouched.
New Features:
- Scope sync failure alerts to issues owned by github-actions[bot] through a hidden ownership marker, with legacy bot alerts supported by exact-title fallback.
- Report same-title issues authored by others without modifying them.
Bug Fixes:
- Prevent recovery and failure handling from closing or editing same-title issues owned by other authors.
- Prevent duplicate alerts by failing closed when issue lookup fails and creating alerts only when no owned alert exists.
Enhancements:
- Prefer marked owned alerts, mark legacy alerts during refresh, and consistently reopen, update, or close only owned alerts.
- Document the alert ownership and legacy compatibility rules in the caller template, README, and recovery guide.
Documentation:
- Update sync documentation to describe bot-authored, marker-based alert ownership and handling of legacy alerts.
Tests:
- Expand alert coverage for ownership filtering, legacy fallback, marker creation, recovery behavior, untouched foreign issues, summaries, and lookup failures.
Chores:
- Add project-management tracking metadata for the alert ownership change.
Summary by cubic
Stops the reusable sync alert from closing, editing, or reopening same-title issues opened by other authors.
- The alert now targets issues authored by
github-actions[bot]that carry the hidden marker<!-- pm-github-sync-status -->, even after a title change. - Legacy bot alerts with the exact title are still recognized and gain the marker on the next refresh.
- On failure, it creates a marked alert when no owned issue exists; recovery closes open owned alerts.
- Same-title issues from other authors are left untouched and counted in the job summary.
- Caller docs, README, and the recovery guide now explain the ownership rule.
Bug Fixes
- Prevents three unintended writes: closing a person's issue on recovery, editing an open person's issue on failure, and reopening plus editing a closed person's issue on failure.