ci(awooop): verify source link refresh candidate
All checks were successful
Code Review / ai-code-review (push) Successful in 11s

This commit is contained in:
Your Name
2026-05-21 12:25:19 +08:00
parent 7f91159a1c
commit 4b6c9b9554
2 changed files with 26 additions and 0 deletions

View File

@@ -78,6 +78,7 @@ jobs:
--allow-existing-apply \
--refresh-if-stale-days 6 \
--refresh-work-item-id "${SOURCE_CANARY_WORK_ITEM_ID}" \
--verify-refresh-candidate \
--reviewer-id gitea_e2e_source_link_canary \
--operator-note "T122 rolling source-correlation canary refresh; append-only status-chain proof"

View File

@@ -290,6 +290,17 @@ def _select_refresh_work_item(
)
def _refresh_candidate_result(item: dict[str, Any]) -> dict[str, Any]:
return {
"refresh_candidate_status": "ready",
"refresh_candidate_work_item_id": _source_review_work_item_id(item),
"refresh_candidate_latest_provider_event_id": item.get(
"latest_provider_event_id"
),
"refresh_candidate_alertname": item.get("alertname"),
}
def _apply_source_correlation_item(
*,
args: argparse.Namespace,
@@ -453,6 +464,11 @@ def run(args: argparse.Namespace) -> dict[str, Any]:
refresh_if_stale_days=args.refresh_if_stale_days,
)
if not refresh_reason:
refresh_candidate: dict[str, Any] = {}
if args.verify_refresh_candidate:
refresh_candidate = _refresh_candidate_result(
_select_refresh_work_item(recurrence, args=args)
)
return {
**existing,
"apply_status": existing_apply.get("apply_status"),
@@ -461,6 +477,7 @@ def run(args: argparse.Namespace) -> dict[str, Any]:
),
"refresh_if_stale_days": args.refresh_if_stale_days,
"refresh_reason": None,
**refresh_candidate,
}
previous_latest_applied_link_at = str(
existing.get("latest_applied_link_at") or ""
@@ -539,6 +556,14 @@ def parse_args(argv: list[str]) -> argparse.Namespace:
action="store_true",
help="When refresh is needed, use the latest unapplied canary/smoke/codex work item.",
)
parser.add_argument(
"--verify-refresh-candidate",
action="store_true",
help=(
"Even when the existing applied link is still fresh, verify that "
"the configured refresh work item exists and is safe to apply later."
),
)
parser.add_argument("--dry-run", action="store_true")
return parser.parse_args(argv)