chore: gitea-sync --ids, sync recent bugs (#264-#286), refresh STATUS.md

gitea-sync.py: --ids syncs named bugs regardless of dates (OR'd with
--since). Bulk triage bumped last_seen/status_updated across most of the
buglog, so --since 2026-09-01 matched ~1150 bugs while recently fixed older
bugs (bug-1798..1804, 1714, 1754, 1850, 1854) could never be reached.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-09-26 07:26:45 +00:00
parent e3f5a813c6
commit ff4e2cb84e
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
5 changed files with 90 additions and 20 deletions

View file

@ -788,7 +788,7 @@ def _resolve_label_ids(api, label_names):
# ── Bug Sync ─────────────────────────────────────────────────────────────────
def sync_bugs(api, dry_run=False, quiet=False, since=None):
def sync_bugs(api, dry_run=False, quiet=False, since=None, ids=None):
"""Sync buglog entries to Gitea issues.
Open/closed and the status label come from each entry's `status` (see
@ -801,6 +801,10 @@ def sync_bugs(api, dry_run=False, quiet=False, since=None):
since: ISO date (YYYY-MM-DD). Create issues only for bugs with
last_seen >= since; update already-synced ones whose
last_seen or status_updated >= since.
ids: set of bug ids to sync regardless of dates. Combined with
since, a bug is synced if it matches either -- bulk triage
has bumped last_seen/status_updated across most of the log,
so dates alone cannot pick out recently fixed older bugs.
"""
if not BUGLOG_PATH.exists():
warn(f"buglog not found: {BUGLOG_PATH}")
@ -827,10 +831,14 @@ def sync_bugs(api, dry_run=False, quiet=False, since=None):
# --since: new issues only for recently seen bugs; status changes
# (status_updated) are still mirrored for already-synced ones.
if since:
recent = (bug.get("last_seen") or "") >= since
if bug.get("gitea_issue"):
recent = recent or (bug.get("status_updated") or "") >= since
if since or ids:
recent = False
if since:
recent = (bug.get("last_seen") or "") >= since
if bug.get("gitea_issue"):
recent = recent or (bug.get("status_updated") or "") >= since
if ids and bid in ids:
recent = True
if not recent:
skipped += 1
continue
@ -972,6 +980,8 @@ def main():
help="Sync bugs only")
parser.add_argument("--since", metavar="DATE",
help="Create issues only for bugs last seen >= DATE; update synced ones changed since (YYYY-MM-DD)")
parser.add_argument("--ids", metavar="ID[,ID...]",
help="Also sync these bug ids regardless of --since (comma-separated, e.g. bug-1798,bug-1799)")
parser.add_argument("--quiet", action="store_true",
help="Suppress progress output, print only errors")
args = parser.parse_args()
@ -1007,7 +1017,10 @@ def main():
# Sync bugs
if not args.spec:
sync_bugs(api, dry_run=args.dry_run, quiet=args.quiet, since=args.since)
ids = ({i.strip() for i in args.ids.split(",") if i.strip()}
if args.ids else None)
sync_bugs(api, dry_run=args.dry_run, quiet=args.quiet,
since=args.since, ids=ids)
if not args.quiet:
if args.dry_run: