Skip to content

Fix: Improve scanner report quality and PR hygiene - #9

Merged
rubambiza merged 3 commits into
rossoctl:mainfrom
rubambiza:fix/report-quality-pr-hygiene
Jun 10, 2026
Merged

rubambiza merged 3 commits into
rossoctl:mainfrom
rubambiza:fix/report-quality-pr-hygiene

Conversation

@rubambiza

@rubambiza rubambiza commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Promote gh_with_backoff from dep-bump-fixer into program-lib.sh (shared across all programs)
  • Populate the empty "Issues" column in the link-health repo table with open scanner issue counts
  • Deduplicate same-day rows in the trend table (keeps last entry per calendar date)
  • Replace static PR body with dynamic ## Summary section; update existing PRs via gh pr edit

Related issue(s)

Testing Instructions

  • Verified via --dry-run on remote: Issues column shows accurate counts (validated against gh issue list), trend table collapses May 18 duplicate to single row
  • shellcheck passes on all modified scripts
  • The dashboard PR body fix is intentionally excluded here — it ships with PR feat: Add automation health dashboard (Story 5, epic #1260) #7 which adds the dashboard script

- Add gh_with_backoff to program-lib.sh (promoted from dep-bump-fixer)
- Populate Issues column in Broken Links by Repo table via title search
- Deduplicate same-day rows in trend table (group_by date, keep last)
- Replace static PR body with dynamic Summary section and gh pr edit
- Remove local gh_with_backoff from dep-bump-fixer (now shared)

Addresses rossoctl/rossoctl#1816.

Assisted-By: Claude Opus 4.6 <[email protected]>

Signed-off-by: Gloire Rubambiza <[email protected]>
Assisted-By: Claude Opus 4.6 <[email protected]>

Signed-off-by: Gloire Rubambiza <[email protected]>

@esnible esnible left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Four focused fixes: promotes gh_with_backoff into program-lib.sh (shared across programs), adds 502 to the link-checker accept-list + excludes console.cloud.google.com, deduplicates same-day trend rows and populates the link-health "Issues" column, and replaces the static fork-PR body with a dynamic metrics summary.

Verified:

  • The gh_with_backoff move is safe — dep-bump-fixer.sh sources program-lib.sh (line 18) before its first call (line 261+), and RATE_LIMIT_BACKOFF=${RATE_LIMIT_BACKOFF:-0} keeps set -u happy.
  • The new issue-count search (in:title "Broken link in") substring-matches the scanner's actual issue title (:bug: Broken link in <file>: <url>).
  • --repo "$repo" receives a full kagenti/<repo> slug (broken[].repo is "kagenti/" + $repo); cut -d/ -f2 correctly derives the short name.
  • The dedup jq ([group_by(.date|split("T")[0]) | .[] | last]) correctly collapses same-day rows to the latest entry while preserving chronological order.

Areas reviewed: Shell, cross-script data contract, GitHub API usage
Commits: 2, both signed-off
CI: DCO passing

No must-fix issues — both inline comments are non-blocking efficiency notes. Approving.

Comment thread scripts/link-health-scanner.sh Resolved
Comment thread scripts/link-health-scanner.sh Resolved
Assisted-By: Claude Opus 4.6 <[email protected]>

Signed-off-by: Gloire Rubambiza <[email protected]>
@rubambiza

Copy link
Copy Markdown
Contributor Author

Addressed Ed's review feedback:

  1. N+1 API pattern — Fixed in 0f75e3a. Replaced per-repo gh issue list loop with single gh search issues 'org:kagenti in:title "Broken link in" state:open' query + client-side count via associative array.
  2. Per-repo jq inefficiency — Also fixed in 0f75e3a. Collapsed the 2x per-repo jq -rs passes into a single group_by(.repo) expression that yields both internal and external counts in one pass.

@rubambiza
rubambiza merged commit fa31999 into rossoctl:main Jun 10, 2026
1 check passed
@rubambiza
rubambiza deleted the fix/report-quality-pr-hygiene branch June 10, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants