chore(version-pins): concurrent fetches with a live in-place TUI - #563
chore(version-pins): concurrent fetches with a live in-place TUI#563lroolle wants to merge 1 commit into
Conversation
Sequential fetches made versions-up crawl one registry at a time. Pins now live in a declarative table; a dispatcher runs up to 8 background fetch jobs writing per-tool files (done-marker last), and the TUI redraws the whole grouped block in place. Non-TTY (CI) prints finished lines in table order; NO_COLOR honored. Counters, UPDATED_VARS, and pin variables merge deterministically in table order after all jobs land, so versions.env output is byte-stable regardless of completion order. Soft-fail contract unchanged: a dead registry degrades to a warning and keeps the old pin. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 019d3e7863
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| head1:*|head2:*) | ||
| local corner="├─" group=${item#head?:} dashes | ||
| [[ $item == head1:* ]] && corner="┌─" | ||
| dashes=${DASH_RULE:0:48 - ${#group}} |
There was a problem hiding this comment.
Avoid byte-slicing the UTF-8 rule
When the script runs with LC_ALL=C or LC_ALL=POSIX, Bash applies this substring length in bytes rather than characters. Since each rule glyph occupies three bytes and the calculated lengths are not multiples of three, every heading ends with a truncated UTF-8 sequence, producing malformed non-TTY/CI output. Generate the rule without slicing a multibyte string, or force character-aware handling.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR refactors scripts/update-version-pins.sh to fetch version pins concurrently (with a capped number of background jobs) while providing a live in-place TUI for TTY runs and deterministic, ordered output/merge behavior for non-TTY runs.
Changes:
- Introduces a declarative
PIN_TABLEto define pin sources and preserve stable display/merge order. - Adds a concurrent dispatcher that runs up to 8 background fetch jobs writing results into a scratch directory with done-markers.
- Implements TTY in-place redraw rendering and a non-TTY ordered “flush as complete” output mode, followed by a deterministic merge/tally phase.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| local corner="├─" group=${item#head?:} dashes | ||
| [[ $item == head1:* ]] && corner="┌─" | ||
| dashes=${DASH_RULE:0:48 - ${#group}} | ||
| echo -e " ${CYAN}${corner}${BOLD} ${group} ${RESET}${CYAN}${dashes}${RESET}${eol}" | ||
| ;; |
| local old_disp=$old new_disp=$new | ||
| if [[ ${T_TYPE[$i]} == "git-commit" ]]; then | ||
| old_disp="${old:0:7}" | ||
| new_disp="${new:0:7}" | ||
| fi | ||
|
|
Why
versions-upfetched 17 registries one at a time; the sweep crawled.What
GROUP|NAME|VAR|TYPE|ARGS); order is display and merge order..valis never read).NO_COLORhonored.UPDATED_VARS, and pin variables apply in table order after all jobs land —versions.envoutput is byte-stable regardless of completion order.Verify
bash scripts/update-version-pins.sh --dry-run(non-TTY): correct grouped output, 2 bumps detected, 1 soft-fail (cursor.com unreachable from the test container — environmental),versions.envround-trip intact including entries not in the pin table (TMUX/RUST/PYTHON).shellcheckclean (no new findings).tests/test_release_utils.sh73/73,tests/version-upgrade.shgreen.🤖 Generated with Claude Code