Skip to content

[Fleet Monitor] petry-projects/.github-private β€” .github/workflows/readme-refresh.ymlΒ #1265

Closed

Description

@don-petry

🟠 DEGRADED: petry-projects/.github-private / .github/workflows/readme-refresh.yml

Metric Value
Failure Rate 25% (1 / 4 runs)
Status DEGRADED
p50 Duration 614s
p95 Duration 636s
Successful Runs 3
Cancelled Runs 0

Workflow: .github/workflows/readme-refresh.yml

Last updated by Fleet Monitor run on 2026-07-15.
Threshold: failure rate > 10% over the monitored window.

Activity

  1. added
    health-checkAutomated health check report
    dev-leadFor dev-lead agent pickup
    fleet-trackerTracked by the Actions Fleet Monitor
    on Jul 15, 2026
  2. don-petry commented on Jul 15, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead Implementation Plan

    Issue: #1265 β€” [Fleet Monitor] petry-projects/.github-private β€” .github/workflows/readme-refresh.yml

    Root cause

    The one failing run in the monitored window (29386746375, 2026-07-15 03:31) failed on the
    final git push to the rolling chore/readme-refresh branch of .github-private with a
    --force-with-lease stale-info rejection: the branch moved/was deleted out from under the
    run (auto-merge of the previous refresh PR) during the ~5 min Claude generation window, staling
    the lease taken at clone time. That run used the pre-retry single-push code β€” main already
    carries a 3-attempt fetch --prune + retry loop, and its error text (... after 3 attempts / branch state) differs from the failing run's, confirming the failing run predates the fix.

    I verified locally (git 2.54, same as CI) that the current retry loop recovers from both
    the "branch moved" and "branch deleted" stale-info races (retry push exits 0 in both).

    Scope

    The reliability fix is already in main but has no regression test β€” the existing bats
    only covers pure string helpers. Extract the push-retry into a testable function and add a
    regression guard so the single-attempt bug cannot silently return.

    Implementation Checklist

    • scripts/aw-readme-refresh.sh: extract the inline push-retry loop into
      push_branch_with_retry() (behavior-preserving); make attempts/sleep env-configurable
      (PUSH_RETRY_ATTEMPTS, PUSH_RETRY_SLEEP_SEC) so tests run fast; call it from process_repo
    • .github/workflows/lint.yml: register the new bats file in the bats job list

    Tests to Write

    • tests/test_readme_refresh_push.bats: against a local bare remote β€”
      - clean first push succeeds
      - stale-info race (branch MOVED mid-run) β†’ recovers on retry
      - stale-info race (branch DELETED mid-run) β†’ recovers on retry
      - persistent unreachable remote β†’ returns non-zero after N attempts

    Test Command

    scripts/run-bats.sh tests/test_readme_refresh_push.bats tests/test_readme_refresh_helpers.bats and bash .dev-lead/scripts/dev-lead-lint.sh

  3. don-petry commented on Jul 15, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead: Implementation Complete

    Root cause (diagnosed from the failing run)

    The single failure in the monitored window β€” run 29386746375 β€” died on the final git push of the rolling chore/readme-refresh branch on .github-private with a --force-with-lease "stale info" rejection. The branch moved/was deleted out from under the run (auto-merge of the prior refresh PR) during the ~5 min Claude generation window, staling the lease taken at clone time.

    That run used the pre-retry single-push code; main already carries a 3-attempt fetch --prune + retry loop (error text differs: ... after 3 attempts / branch state), so the reported failure is already fixed in main. I confirmed locally on git 2.54 (same as CI) that the current retry recovers from both the branch-MOVED and branch-DELETED stale-info races.

    Gap closed here: the reliability fix had no regression test β€” the existing bats covered only pure string helpers. A future refactor could silently reintroduce the single-attempt bug. This change extracts the push-retry into a named, testable function and adds a regression guard.

    Plan Execution

    • Extracted the inline push-retry loop into push_branch_with_retry() (behavior-preserving; PUSH_RETRY_ATTEMPTS/PUSH_RETRY_SLEEP_SEC env-overridable for fast tests)
    • Rewired process_repo to call it
    • Added tests/test_readme_refresh_push.bats (git-backed regression tests)
    • Registered the new bats file in lint.yml
    • shellcheck (warning, -x) clean; .dev-lead/scripts/dev-lead-lint.sh passes; lint.yml YAML validates

    Test Results

    1..22
    ok 1 push_branch_with_retry: clean first push succeeds
    ok 2 push_branch_with_retry: recovers from stale lease when branch MOVED mid-run
    ok 3 push_branch_with_retry: recovers from stale lease when branch DELETED mid-run
    ok 4 push_branch_with_retry: returns non-zero after exhausting attempts on a persistent failure
    ok 5 extract_readme: captures body between markers
    ok 6 extract_readme: returns empty when markers are absent
    ok 7 extract_readme: ignores reasoning preamble and trailing commentary
    ok 8 extract_readme: markers with trailing whitespace are recognised
    ok 9 overlong_lines: returns empty when all lines fit within maxlen
    ok 10 overlong_lines: reports the line number of an overlong prose line
    ok 11 overlong_lines: reports multiple overlong line numbers as comma list
    ok 12 overlong_lines: skips table rows (lines starting with |)
    ok 13 overlong_lines: skips content inside fenced code blocks
    ok 14 overlong_lines: counts prose lines outside code fence after fence closes
    ok 15 valid_content: rejects empty content
    ok 16 valid_content: rejects the literal string SKIP
    ok 17 valid_content: accepts non-empty content for private-readme type (no H1 required)
    ok 18 valid_content: rejects org-profile-public with no top-level heading
    ok 19 valid_content: accepts org-profile-public with correct H1 first line
    ok 20 valid_content: rejects github-repo-readme missing top-level heading
    ok 21 valid_content: accepts github-repo-readme with H1 first line
    ok 22 valid_content: accepts org-profile-member with any non-empty content
    

    Files Changed

    • scripts/aw-readme-refresh.sh: extracted push_branch_with_retry(); added PUSH_RETRY_ATTEMPTS/PUSH_RETRY_SLEEP_SEC tunables; process_repo now calls the function
    • tests/test_readme_refresh_push.bats: new β€” clean-push, branch-MOVED recovery, branch-DELETED recovery, persistent-failure returns non-zero
    • .github/workflows/lint.yml: registered the new bats file in the bats job

    Notes

    Behavior-preserving apart from one strict improvement: no pointless sleep after the final (failed) attempt. The workflow file readme-refresh.yml itself was not modified (documented repo-specific workflow per AGENTS.md). No test was skipped or weakened.

  4. added a commit that references this issue on Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-leadFor dev-lead agent pickupfleet-trackerTracked by the Actions Fleet Monitorhealth-checkAutomated health check report

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions