Skip to content

refactor(scripts): simplify check-upstream-drift, check-vendor-version-bump and check-view-medium-lists - #14608

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-14364-42613365218-1
Nov 9, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-14364-42613365218-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #14364

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Simplified three of the five listed scripts. Their outputs, exit codes, messages, flags and exported names stay the same. In check-upstream-drift.sh, a bad_usage helper replaces three copies of the usage-and-exit block, the blob-path branch reuses filter_under instead of its own awk filter, EXPLICIT is computed in one line, and the three report-ordering loops are now one nested loop over the kinds. check-vendor-version-bump.sh uses shorter guard forms for the base-manifest skip and the Dependabot check. check-view-medium-lists.mjs appends findings in place instead of copying the array for each hit, and works out the evals.json test once per file instead of once per line. check-vocabulary.py and compute-max-in-flight.py are left as they were: a review against the four /simplify checks found nothing that would make them shorter or clearer without moving code between files, which is out of scope.

Not verified

  • Did not run the test suites for these scripts (e.g. scripts/check-upstream-drift.test.sh); this lane can run only the named wrappers, so the suites are left to the PR's CI
  • tidy skipped: every changed file is under scripts/, a listed shared path
  • ci-status green is a PR check, left to the PR's CI

Fix

  • scripts/check-upstream-drift.sh: added bad_usage for the three usage-error exits; the blob-path branch of tree_list calls filter_under (a one-level listing has no entries under the blob path, so the result is the same exact match); EXPLICIT is computed from the page count before discovery; the…
  • scripts/check-vendor-version-bump.sh: \[\[ -n ... \]\] || continue replaces an if/continue block; the Dependabot check is set with && under the existing SC2310 directive
  • scripts/check-view-medium-lists.mjs: collect() pushes onto the lane's findings array instead of copying it for each hit; listings() works out the evals.json test once per file

Verification

The runner ran each check from the base copy against 98c5070:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

Left out: the items under Not verified.

Related

#14364

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 98c507069801ab5b4e1979dd77e3a5a262ec7d97: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14608 at 98c50706

I found no security issues. I read every hunk of all 3 changed files. None of them matches a trusted path, and none is a trust control, a merge hold, a manifest or an instruction surface.

All three changes are refactors. For each one I checked the code that decides pass or fail, and none changes what the script does:

  • scripts/check-vendor-version-bump.sh
    • The script runs with set -uo pipefail and no -e (line 42). So the new changelog_fragments::dependabot_only "$base" && dependabot=yes (line 202) cannot abort the script.
    • It sets yes only on exit status 0, and anything else leaves no, exactly as the old if did. The gate still fails closed in the same way.
    • The new [[ -n "$base_manifest_entry" ]] || continue (line 174) skips in exactly the same cases as the old block.
  • scripts/check-upstream-drift.sh
    • Blob-path branch: this branch now calls filter_under (lines 225–231), which adds an index(q, p "/") == 1 match to the old exact-match filter.
      • The listing comes from a one-level gh_tree ... 0 read, and gh_tree keeps only blob entries (line 264).
      • p here is a blob path, so no entry can sit under p/ and the extra match never fires.
      • p is never empty in this branch: a 422 reply needs a path.
    • bad_usage: it keeps exit code 2 and the output to stderr.
    • EXPLICIT: $((n > 0)) gives 1 or 0, the same as before.
    • Report loop: the nested loop keeps the order row, new-unit, removed-unit.
  • scripts/check-view-medium-lists.mjs: the code now appends to the array in place and works out the evals.json test once per file. The findings are the same.

The PR description and the closing issue contain no embedded instructions to this lane.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 98c507069801ab5b4e1979dd77e3a5a262ec7d97: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

I read every hunk of all 3 changed files and compared each refactor against the code it replaces. None of them changes behaviour.

scripts/check-upstream-drift.sh

  • bad_usage helper: it is defined before the argument loop and does the same thing as the three blocks it replaces (usage >&2; exit 2).
  • Blob-path branch of tree_list: it now calls filter_under (line 303) instead of an exact-match awk. filter_under also keeps lines that start with <p>/. That extra case can't match here: the branch lists the parent directory one level deep, so every entry is <dir>/<name> and none can sit under <p>. The output is the same, and the new comment says so.
  • EXPLICIT: it is now set as $((${#PAGES[@]} > 0)) before page discovery (line 333). On both paths it ends up 0 or 1 exactly as before, including when docs/upstream is missing.
  • Report ordering: the nested loop over row new-unit removed-unit, using "$kind "*, matches the old row\ * patterns and keeps the same order.

scripts/check-vendor-version-bump.sh

  • The script runs under set -uo pipefail without -e. So [[ -n ... ]] || continue and changelog_fragments::dependabot_only "$base" && dependabot=yes give the same control flow as the old if blocks. A non-zero return, including an error code, still leaves dependabot=no.

scripts/check-view-medium-lists.mjs

  • isEvals is now worked out once per file instead of once per line, which gives the same value for every line.
  • collect() now creates each lane's array fresh and appends to it in place. Nothing else holds a reference to that array, so the returned flagged map has the same contents and order.

Closing issue #14364 acceptance criteria

  • Behaviour unchanged: met, by my reading (above).
  • Only listed files edited: met. The 3 changed files are all on the issue's list.
  • Within 400 lines and 15 files: met. The diff is small.
  • ci-status green: left to CI. I did not see the check results.

The PR body's test and gate runs were done by its author and I have not verified them. I ran nothing myself: this lane has no shell.

No embedded instructions in the PR context. No settled threads were supplied, and the prior-findings file lists no earlier posts (blocking only: no). This change spends no API credit or billing.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit c85633e Nov 9, 2026
49 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-14364-42613365218-1 branch November 9, 2026 13:24
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.

Simplify the check-upstream-drift.sh, check-vendor-version-bump.sh, check-view-medium-lists.mjs and 2 more repository scripts

1 participant