Repository navigation
fix(checkouts): validate repository URLs and refs before calling git - #3451
minimal-backporter[bot] wants to merge 2 commits into
Conversation
…3378) * fix(checkouts): validate repository URLs and refs before calling git A repository URL or ref from minimal.toml now has to be non-empty and must not start with `-` before it reaches git, and the clone passes `--` ahead of the URL so the value is always read as a value. Git calls on a project's repository also turn the `ext` transport off, whatever the host's git config says. A malformed value is refused with the value named and a pointer to minimal.toml. Fixes gominimal/inbox#1247 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(checkouts): refuse an option-like url or ref early, and redact it Manager::checkout_of now refuses an option-like remote or ref first, before the lock, the bare directory and any clone or fetch. A refused URL left an empty directory under git/db, and a refused ref cost a clone or fetch first (or surfaced as the clone's failure). Repo keeps its own check for direct callers. The refusal stores a URL as scrubbed_remote gives it, so userinfo and a query never reach the error's Display or Debug. The option-like test moves above make_local_repo's doc comment, checks that no bare directory is left and no clone or fetch ran, and a new test covers the redaction. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(checkouts): a refused url or ref names its one failed condition; the git guards go on every call An empty repository URL or ref is now `EmptyValue`, and one starting with `-` stays `OptionLike`. Each message states its own condition in short sentences, names the value, and points at minimal.toml or --upstream, since `mip run --upstream` sends the same values with no minimal.toml. `GIT_SEC_ARGS` is prepended inside `run_git_bare` and `run_git_checkout`, and on the config read in `Repo::new`, so every git command this crate runs carries it. The doc comment now says so. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 9396210)
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Approved: no findings at Nothing to do. Clobber: none seen. |
The backported refusal of an option-like repository URL names the URL through `scrubbed_remote`, so that a credential in a malformed URL reaches neither the error's Display nor its Debug. On main that function came with the tracing work, which this branch does not have, so the backport did not compile. This adds the function as it is on main, with its test. Nothing else on this branch calls it. Co-Authored-By: Claude <noreply@anthropic.com>
|
The backport did not compile on Checked on Linux at 3c03dbc: fmt and clippy pass, the native daemon e2e passes, and the workspace tests pass but one. That one is |
|
/revise The backport did not compile on release/0.7.x: the new refusal names the URL through scrubbed_remote, which main got with the tracing work (#1995) and this branch does not have. 3c03dbc adds that one function with its test, as it is on main. Nothing else on this branch calls it. Checked on Linux at 3c03dbc: fmt and clippy pass, the native daemon e2e passes, and the workspace tests pass but one. That one is package_version_is_the_declared_next_release, which fails on this branch whatever this PR does: package.version is still 0.7.3 beside the tag v0.7.3. #3369 is the bump that fixes it, so that one has to land first for this PR's tests to go green. |
|
Round 1 of 10 changed nothing: noop on purpose. The only failing test is package_version_is_the_declared_next_release in crates/common/tests/package_version.rs. It fails because Cargo.toml declares 0.7.3 beside the tag v0.7.3. That is not caused by this backport. The fix is the version bump in PR #3369, which must land on release/0.7.x first. A bump here duplicates #3369 and is outside this pull request, so I made no change. After #3369 merges, merge release/0.7.x into this branch and the tests check can go green. I did not run the checkouts doctests: rustdoc is not installed on this box (cargo test -p checkouts stopped at 'could not execute process rustdoc'). I did not run just ci or the workspace suite.. This pull request is still open. branch
Updated 2026-11-16T16:44:24.693Z. |
|
Round 1 of 10 on a /revise note: the coder changed nothing. noop on purpose. The only failing test is package_version_is_the_declared_next_release in crates/common/tests/package_version.rs. It fails because Cargo.toml declares 0.7.3 beside the tag v0.7.3. That is not caused by this backport. The fix is the version bump in PR #3369, which must land on release/0.7.x first. A bump here duplicates #3369 and is outside this pull request, so I made no change. After #3369 merges, merge release/0.7.x into this branch and the tests check can go green. I did not run the checkouts doctests: rustdoc is not installed on this box (cargo test -p checkouts stopped at 'could not execute process rustdoc'). I did not run just ci or the workspace suite. |
Backport of #3378 to
release/0.7.x.Squash-merge this PR and keep the PR title as the subject. The cherry-picked commit keeps the source subject.