Skip to content

feat(cli): warn when aube update --depth is set#473

Merged
jdx merged 4 commits intomainfrom
feat/update-depth-warn
May 2, 2026
Merged

feat(cli): warn when aube update --depth is set#473
jdx merged 4 commits intomainfrom
feat/update-depth-warn

Conversation

@jdx
Copy link
Copy Markdown
Contributor

@jdx jdx commented May 2, 2026

Summary

  • aube update --depth N was parsed for pnpm parity and silently ignored. Now it emits a one-line warning pointing at rm aube-lock.yaml && aube install for the only useful semantic case (--depth Infinity / refresh transitives).
  • Regression-guarded by a new bats case asserting both the warning's shape and that bare aube update stays silent.
  • Updates test/PNPM_TEST_IMPORT.md to mark the update.ts:599 row "won't-support — landed."

Why now

Triaged won't-support in #471: intermediate values (--depth 1, --depth 2) have semantics that even pnpm users get tripped up on. aube only ever refreshes direct deps (pnpm's --depth 0 default), so any other value is a no-op the user has no way to discover. The warning closes that loop.

Test plan

  • cargo build --workspace — green
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo fmt --check — clean
  • mise run test:bats test/pnpm_update.bats — 23/23 pass (+1 new aube update --depth: parsed-but-warn)

Note

Low Risk
Low risk: behavior is unchanged except when --depth is provided, where an extra stderr warning could affect scripts that assert on exact output.

Overview
aube update now prints a one-line warning when --depth is provided, clarifying that the flag is ignored and pointing users to rm aube-lock.yaml && aube install for a full transitive refresh.

The warning is emitted only once even under recursive workspace fanout, and CLI/help text + generated docs are updated accordingly; new bats tests assert the warning behavior and that plain aube update stays silent.

Reviewed by Cursor Bugbot for commit 90bbef6. Bugbot is set up for automated code reviews on this repo. Configure here.

`--depth` was parsed for pnpm parity and silently swallowed. aube only
refreshes direct deps (pnpm's `--depth 0` default), so any other value
is a no-op the user has no way to discover. Emit a one-line warning
pointing at `rm aube-lock.yaml && aube install` for the genuine
refresh-transitives case.

Triaged won't-support in test/PNPM_TEST_IMPORT.md (update.ts:599):
intermediate values (`--depth 1`, `--depth 2`) have semantics that
even pnpm users get tripped up on; the only useful value is
`--depth Infinity`, served by the workaround above.

Regression-guarded by a new bats case asserting both the warning's
shape and that bare `aube update` stays silent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 2, 2026

Greptile Summary

Adds a one-line eprintln! warning when aube update --depth <N> is supplied, documenting the no-op and pointing users to rm aube-lock.yaml && aube install for the transitive-refresh case. The recursion footgun (warning firing once per matched workspace package) is correctly closed by clearing per_pkg.depth = None before each recursive run call in run_filtered, and both behaviors are regression-guarded by new bats tests.

Confidence Score: 5/5

Safe to merge — change is limited to emitting a warning on an already-ignored flag; no resolution, lockfile, or manifest write logic is altered.

All changes are additive: a single eprintln! guarded by an Option check, a targeted None-clear on the per-package clone, and documentation/test updates. No existing code paths are modified beyond the ignored-flag suppression block.

No files require special attention.

Important Files Changed

Filename Overview
crates/aube/src/commands/update.rs Adds depth warning on first call to run(), clears depth on per-pkg clone in run_filtered() to prevent N+1 warnings during workspace fanout — logic is correct
test/pnpm_update.bats Two new bats tests: one for basic warning shape and silent bare-update, one for workspace fanout asserting exactly one warning emission
aube.usage.kdl Splits --latest help into short/long_help and updates --depth long_help to document the no-op/warn semantics
docs/cli/commands.json Mirrors aube.usage.kdl split of --latest help and updated --depth long_help; also adds the missing help_long field for --latest
docs/cli/update.md Reformats --latest description and updates --depth description to document the ignored + warn behavior
test/PNPM_TEST_IMPORT.md Updates update.ts:599 triage row from pending won't-support to landed, with pointer to the new bats test

Reviews (4): Last reviewed commit: "fix(cli): emit --depth warning once acro..." | Re-trigger Greptile

autofix-ci Bot and others added 2 commits May 2, 2026 19:36
clap merges multi-line `///` doc comments into one paragraph for
short help (`-h`), and only splits on the first blank `///` line to
produce a separate first-line summary. The `--latest` doc was
written as one continuous paragraph, so `aube update -h` rendered
it as a 200+ char line that wrapped awkwardly.

Move the qualifier into a second paragraph so the short-help line
stays at "Update past the manifest range" — same shape every other
multi-paragraph flag in this file already uses (`--exact`,
`--global`, `--interactive`, `--depth`, …).

Regenerated `aube.usage.kdl` and `docs/cli/*` via `mise run render`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 530fdee. Configure here.

Comment thread crates/aube/src/commands/update.rs
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Benchmark changes

Public ratios: warm installs vs Bun 4x -> 6x; warm installs vs pnpm 9x -> 9x.

Benchmark aube bun pnpm
Fresh install (warm cache) 246ms -> 301ms (+22%) 1011ms -> 1846ms (+83%) 2227ms -> 2770ms (+24%)
CI install (warm cache, GVS disabled) 1174ms -> 894ms (-24%) 1530ms -> 1847ms (+21%) 2049ms -> 2463ms (+20%)
CI install (cold cache, GVS disabled) 4273ms -> 3981ms (-7%) 4034ms -> 3999ms (-1%) 4940ms -> 4943ms (+0%)

90bbef6 vs 7d7ded0 | aube/bun/pnpm | 3 scenarios | 3 runs | 500mbit/50ms | generated by Codex.

`run_filtered` clones the args for each matched workspace package and
re-invokes `run`, which would emit the `--depth ignored` warning once
per project on top of the top-level emission (1 + N). Clear `depth`
on the per-pkg clone so only the outermost call warns.

Regression-guarded by a new bats case that runs `aube -r update
--depth Infinity` across a 3-project workspace and asserts exactly
one occurrence of the warning in stderr.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jdx
Copy link
Copy Markdown
Contributor Author

jdx commented May 2, 2026

Addressed Cursor Bugbot's low-severity finding: `--depth` warning was firing 1 + N times in workspace mode (`aube -r update --depth Infinity` against an N-project workspace) because `run_filtered` re-invokes `run` with the same `args` per project. Cleared `per_pkg.depth = None` on the cloned args before each recursive call so only the outermost `run` emits the warning.

Regression-guarded by a new bats case that fans out across a 3-project workspace and asserts exactly one occurrence of the warning in stderr.

PR #478 (the codebase-wide doc-comment audit) had no inline review issues — only Greptile's summary.

Written with Claude.

@jdx jdx merged commit 6e00055 into main May 2, 2026
18 checks passed
@jdx jdx deleted the feat/update-depth-warn branch May 2, 2026 20:36
jdx added a commit that referenced this pull request May 2, 2026
## Summary

clap merges multi-line `///` doc comments into one paragraph for short
help (`-h`) and only splits on the first blank `///` line to produce a
separate first-line summary. Several flags across the CLI were written
as one continuous paragraph, so `aube <cmd> -h` rendered them as 120+
char lines that wrapped awkwardly on standard terminals.

This PR splits each offender's doc comment into a short summary line +
blank `///` separator + the longer prose — same shape `update --latest`
already uses (precedent: #473).

## Flags fixed

- `add -g, --global`, `--no-save`, `--save-catalog`,
`--save-catalog-name`, `-w, --workspace`
- `approve-builds [PKG]...` (positional doc), plus the subcommand
summary on `aube --help`
- `audit --ignore-unfixable`
- `check` subcommand summary on `aube --help`
- `clean -l, --lockfile` (also reflects to `purge`)
- `config list --all`, `--json`
- `dlx -c, --shell-mode`
- `find-hash --json`
- `init --init-package-manager`
- `install --fix-lockfile`, `--force`, `--lockfile-dir`,
`--merge-git-branch-lockfiles`, `--resolution-mode`,
`--verify-store-integrity`
- `link -g, --global`
- `list --long`
- `patch --ignore-existing`
- `patch-remove [PACKAGES]...`
- `publish --force`, `--ignore-scripts`, `--json`
- `query <SELECTOR>`
- `remove -w, --workspace`
- `run --parallel`
- `store status` subcommand summary
- `update -L, --latest` (same fix as #473, included here since that PR
is still open)
- `version [NEW_VERSION]`
- `view <PACKAGE>`, `[FIELD]`

## Validation

- `cargo build --workspace` — clean
- `cargo clippy --all-targets -- -D warnings` — clean
- `cargo fmt --check` — clean
- Audit before/after: lines >120 chars went from 6 to 0; lines >115 from
1 to 0
- Sample audit script: `for cmd in $(aube --help | grep -E '^ [a-z]' |
awk '{print $1}'); do aube "$cmd" -h 2>&1 | awk 'length > 120'; done |
grep -vE '\[possible values:|\[aliases:'`

CLI docs regenerated via `mise run render` (`aube.usage.kdl`,
`docs/cli/commands.json`, `docs/cli/*.md`).

## Test plan

- [x] `cargo build --workspace`
- [x] `cargo clippy --all-targets -- -D warnings`
- [x] `cargo fmt --check`
- [x] Re-ran `aube <cmd> -h` for every fixed subcommand to confirm short
help is now one clean summary line and `aube <cmd> --help` still shows
the full prose

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Pure CLI help-text/doc updates plus regenerated docs/command metadata;
no behavior or parsing logic changes, so risk is low aside from
potential wording/regeneration drift.
> 
> **Overview**
> Tightens CLI `-h` output by splitting many commands/flags’
descriptions into a short first-line summary plus separate long help,
avoiding overly long wrapped lines in terminal help.
> 
> Updates the usage spec (`aube.usage.kdl`), clap doc comments across
multiple command arg structs, and regenerates the derived CLI docs
(`docs/cli/*.md`) and `docs/cli/commands.json` to reflect the new
short/long help text (including `approve-builds`, `check`, `publish`,
`install`, `run`, etc.).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3e243a3. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jdx jdx mentioned this pull request May 2, 2026
7 tasks
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.

1 participant