Skip to content

Fix github:repo accepting missing explicit commands#40

Open
cgraf78 wants to merge 1 commit into
mainfrom
require-repo-command
Open

Fix github:repo accepting missing explicit commands#40
cgraf78 wants to merge 1 commit into
mainfrom
require-repo-command

Conversation

@cgraf78

@cgraf78 cgraf78 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Fix bare github / github:repo fallback behavior so metadata failures cannot leave an explicit-command dependency looking installed when the repo checkout does not provide bin/<cmd>.

  • track explicit command intent from config, including package-manager-qualified command overrides
  • require repo checkouts to provide bin/<cmd> only for explicit commands, preserving asset-only/default-command repo installs
  • make bare-github method caches command-aware and prevent stale cache/manifest seeding from masking command changes
  • preserve existing release installs during GitHub metadata failures without refreshing the remote-resolution TTL as if compatibility had been proven
  • avoid refreshing repo TTL or revision stamps on MissingBinary failures
  • share explicit-command repo status/update policy through repo::missing_explicit_command

A missing explicit command intentionally leaves any previous manifest/bin-link state intact during the failed update. status reports the dependency as missing while the previous state remains available for recovery.

Testing

  • cargo fmt --check
  • git diff --check
  • cargo test --locked
  • cargo clippy --locked --all-targets -- -D warnings
  • RUSTDOCFLAGS='-D missing-docs' cargo doc --locked --no-deps
  • cargo build --locked
  • tests/shell/install-sh-test
  • tests/shell/completion-test
  • tests/shell/installer-flow-test
  • tests/shell/lua-api-test
  • tests/shell/lua-bootstrap-test
  • tests/shell/release-scripts-test
  • SHDEPS_RUST_CLI=target/debug/shdeps tests/shell/shdeps-wrapper-test
  • fresh-eyes subagent review: no blocking findings after final changes
  • Claude tmux review: no blocking findings after final changes

Summary

Make bare `github` method resolution and repo fallback robust when GitHub
metadata cannot be fetched. The `smallstep/cli github step` failure mode was
that a metadata outage could fall back to `github:repo`, accept a source
checkout without `bin/step`, and leave the dependency looking installed even
though no runnable command was available.

- track whether `cmd` was explicitly resolved from config, including matched
  package-manager-qualified overrides like `apt:tool`
- require `github:repo` checkouts to provide `bin/<cmd>` only when the command
  was explicit, preserving asset-only repo installs that use the default short
  name
- make bare-`github` resolver caches command-aware so stale release/repo cache
  entries cannot mask command changes
- preserve installed release-backed commands during GitHub metadata failures
  via manifest executable paths without refreshing the resolver TTL as though
  remote compatibility had been proven
- avoid refreshing repo TTL or revision stamps on `MissingBinary` failures
- share the explicit-command repo predicate between update and status so the
  two paths stay aligned

A missing explicit command leaves any previous manifest/bin-link state intact
rather than cleaning it during a failed update. Status reports the dependency
as missing, and the old state is preserved for recovery instead of being
partially torn down.

Testing

- `cargo fmt --check`
- `git diff --check`
- `cargo test --locked`
- `cargo clippy --locked --all-targets -- -D warnings`
- `RUSTDOCFLAGS='-D missing-docs' cargo doc --locked --no-deps`
- `cargo build --locked`
- `tests/shell/install-sh-test`
- `tests/shell/completion-test`
- `tests/shell/installer-flow-test`
- `tests/shell/lua-api-test`
- `tests/shell/lua-bootstrap-test`
- `tests/shell/release-scripts-test`
- `SHDEPS_RUST_CLI=target/debug/shdeps tests/shell/shdeps-wrapper-test`
- fresh-eyes subagent review: no blocking findings after final changes
- Claude tmux review: no blocking findings after final changes
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