From dfe55fa1e8c16e6d8b3ffd94837c877b24542db2 Mon Sep 17 00:00:00 2001 From: Gloire Rubambiza Date: Fri, 31 Jul 2026 16:59:48 -0400 Subject: [PATCH 01/15] refactor: Wire dep-bump-scanner to org profile Assisted-By: Claude Code (Anthropic AI) Signed-off-by: Gloire Rubambiza --- scripts/dep-bump-scanner.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/dep-bump-scanner.sh b/scripts/dep-bump-scanner.sh index f8e878e..b659c23 100644 --- a/scripts/dep-bump-scanner.sh +++ b/scripts/dep-bump-scanner.sh @@ -2,7 +2,7 @@ set -euo pipefail # ============================================================================= -# Dependency Bump Scanner — rossoctl org +# Dependency Bump Scanner # Monitors Dependabot PRs, classifies by severity, flags SLA breaches, # creates/closes GitHub issues, writes reports. # @@ -21,14 +21,13 @@ source "$SCRIPT_DIR/program-lib.sh" # --- CLI args --- DRY_RUN=false ISSUE_LIMIT=0 # 0 = unlimited -ORG="rossoctl" # display/report-tag only; repo reads use canonical rossoctl/ (see get_core_repos) SHOW_HELP=false while [[ $# -gt 0 ]]; do case $1 in --dry-run) DRY_RUN=true; shift ;; --issue-limit) ISSUE_LIMIT="$2"; shift 2 ;; - --org) ORG="$2"; shift 2 ;; + --org) ORG_FLAG="$2"; shift 2 ;; --help|-h) SHOW_HELP=true; shift ;; *) echo "Unknown option: $1"; exit 1 ;; esac @@ -44,7 +43,7 @@ USAGE: OPTIONS: --dry-run Scan and report only; do not create/close issues --issue-limit N Create at most N issues per run (0 = unlimited) - --org NAME GitHub org to scan (default: rossoctl) + --org NAME GitHub org to scan (default: from profile, config/org.env) --help, -h Show this help ENVIRONMENT: @@ -64,6 +63,10 @@ USAGE exit 0 fi +# Resolve org identity (--org > env > profile > default). Sets ORG, FORK_OWNER, +# MAIN_REPO, REPOS_DIR, REMAP. Repo reads use canonical $ORG/. +load_org_profile + # --- Configuration --- validate_repos_dir "${REPOS_DIR:-}" @@ -159,7 +162,7 @@ for repo_dir in "$REPOS_DIR"/*/ "$REPOS_DIR"/.github/; do # Strip trailing comma ecosystems="${ecosystems%,}" - # Store the canonical repo name so Step 2 builds correct rossoctl/ refs. + # Store the canonical repo name so Step 2 builds correct $ORG/ refs. jq -nc --arg repo "$canon" --arg eco "$ecosystems" \ '{repo: $repo, ecosystems: ($eco | split(",") | map(select(. != "")))}' \ >> "$TMPDIR/ecosystems.jsonl" @@ -177,7 +180,7 @@ TOTAL_OPEN_PRS=0 while IFS= read -r eco_record; do repo_name=$(echo "$eco_record" | jq -r '.repo') # canonical name from Step 1 - full_repo="rossoctl/$repo_name" + full_repo="$ORG/$repo_name" echo " Checking $repo_name..." @@ -434,7 +437,7 @@ while IFS='|' read -r issue_repo issue_pr_number; do overdue=$((age_days - sla_days)) # Record repos are canonical names (see Step 1); build canonical refs. - full_repo="rossoctl/$issue_repo" + full_repo="$ORG/$issue_repo" # Deduplication search_term="[dep-bump] Stale $severity bump: $package in $issue_repo" @@ -513,7 +516,7 @@ ISSUES_CLOSED=0 while IFS='|' read -r fix_repo fix_pr_number; do [ -z "$fix_repo" ] && continue - full_repo="rossoctl/$fix_repo" + full_repo="$ORG/$fix_repo" # Find matching open issue by searching for the PR number in title/body issue_number=$(gh issue list --repo "$full_repo" \ From f486d1cda51314b4dc0bbd611862256af1251b2a Mon Sep 17 00:00:00 2001 From: Gloire Rubambiza Date: Mon, 3 Aug 2026 10:11:07 -0400 Subject: [PATCH 02/15] refactor: Wire pr-review scanner and impact to profile Assisted-By: Claude Code (Anthropic AI) Signed-off-by: Gloire Rubambiza --- scripts/pr-review-impact.sh | 4 +++ scripts/pr-review-scanner.sh | 52 ++++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/scripts/pr-review-impact.sh b/scripts/pr-review-impact.sh index 4c4c873..88a1a4b 100755 --- a/scripts/pr-review-impact.sh +++ b/scripts/pr-review-impact.sh @@ -90,6 +90,10 @@ USAGE exit 0 fi +# Resolve org identity (env > profile > default) before reading the allowlist; +# get_core_repos() prepends $ORG and fails loud if it is unset. +load_org_profile + # --- Workspace and reports setup --- setup_workspace "pr-review-impact" WORK_DIR="$PROGRAM_TMPDIR" diff --git a/scripts/pr-review-scanner.sh b/scripts/pr-review-scanner.sh index b68a39f..46400db 100755 --- a/scripts/pr-review-scanner.sh +++ b/scripts/pr-review-scanner.sh @@ -11,29 +11,6 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # shellcheck disable=SC1091 source "$SCRIPT_DIR/program-lib.sh" -# --- Configuration --- -BOT_USER="clawgenti" - -# Repo coverage comes from the shared allowlist (config/core-repos.txt) via -# get_core_repos(). Build the array with a portable while-read loop (mapfile is -# bash 4+, unavailable on macOS's bash 3.2). Fail loud rather than silently -# scanning an empty set. -REPOS=() -while IFS= read -r repo_line; do - [ -n "$repo_line" ] && REPOS+=("$repo_line") -done < <(get_core_repos) - -if [ "${#REPOS[@]}" -eq 0 ]; then - echo "ERROR: core repos allowlist is empty or could not be loaded" >&2 - exit 1 -fi - -LABEL="ready-for-ai-review" -REVIEW_MARKER="