Repository navigation
feat(xtest): export benchmark manifest pins from otdf-local env - #642
Draft
dmihalcik-virtru wants to merge 1 commit into
Draft
dmihalcik-virtru wants to merge 1 commit into
dmihalcik-virtru wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 1
Please check the settings in the CodeRabbit UI or the
|
dmihalcik-virtru
force-pushed
the
DSPX-4372-s2-local-prep
branch
from
October 19, 2026 17:28
d2ba450 to
770efef
Compare
dmihalcik-virtru
force-pushed
the
DSPX-4372-s2-bench-env
branch
from
October 19, 2026 17:29
6b0ab3f to
7bf8fbd
Compare
dmihalcik-virtru
force-pushed
the
DSPX-4372-s2-local-prep
branch
2 times, most recently
from
October 21, 2026 12:33
089faec to
eb31790
Compare
dmihalcik-virtru
force-pushed
the
DSPX-4372-s2-bench-env
branch
from
October 21, 2026 12:33
7bf8fbd to
dd9d8de
Compare
X-Test Failure Report |
This was referenced Oct 21, 2026
dmihalcik-virtru
added a commit
that referenced
this pull request
Oct 23, 2026
…pted js installs (#667) Part 2a of the [DSPX-4372-t1 plan](#657), split out of #626: fixes the benchmark needs, which every `otdf-sdk-mgr` install benefits from. **Based on `main`.** ### What it does - **Bare repos refresh their branches.** `git clone --bare` records no fetch refspec, so the `fetch --all --tags` before every checkout refreshed tags only. Every branch stayed where the first clone found it, and `install tip main` or `--platform main` built that stale commit. `checkout.BARE_REFRESH` now fetches origin's branches into `refs/remotes/origin/*` with `--prune`, for the SDK and platform bare repos alike, and `checkout.upstream_ref` maps a branch name onto them. Fetching into the bare repo's own `refs/heads/*` instead would move branches that other worktrees have checked out, leaving their HEAD ahead of their files, and would fail for good once upstream replaced a branch `foo` with `foo/bar`. - **Worktrees are detached** and reset to the refreshed ref. A branch origin no longer has is refused rather than built from the clone's stale copy, and `HEAD` means origin's default branch as of the clone; a platform `HEAD` worktree used to reset to itself. - **Go source rebuilds work a second time.** `checkout_go_from_platform` reset an existing worktree to a `FETCH_HEAD` fetched into the bare repo, which no worktree can see, so every rebuild after the first failed with `pathspec 'FETCH_HEAD' did not match`. It now resets to the refreshed ref, like the SDK and platform paths. - **`install tip` reports checkout failures as errors.** A refused branch, or a failed git command with git's stderr, now prints `Error: …` and exits 1 for go, js and java, as the platform path already did, instead of a traceback. - **An interrupted js install leaves nothing behind.** #663 already removes a partial `dist/` when npm fails. A Ctrl-C mid-install still left a directory holding only `cli.sh`, which `install_release` then skipped as installed from then on. Both js install paths now remove it unless the install finished. - `AGENTS.md` claimed the bare clone mapped `refs/heads/*`, which is what hid the first bug. It and the code comments also said `git pull` fails in a worktree; it merges origin's default branch into whatever is checked out. ### Validation - `uv run pytest` in `otdf-sdk-mgr`: 207 passed, and 321 at the top of this track (#642). ruff, ruff format and pyright are clean. - `test_checkout.py` runs real git against a local origin. Every shared behaviour is parametrized over the SDK, go and platform entry points: new and existing worktrees follow their branch, `HEAD` (including beside a tag named `main`), a deleted branch is refused, tags and SHAs are checked out and then reused, and a force-pushed `refs/pull/N/head` is followed. This replaces the stubbed command-string test for platform PR refs. SDK-only tests guard other worktrees, force pushes and `x` → `x/y` renames; platform-only tests cover the helper-scripts worktree. A `CliRunner` test covers the `install tip` error path. - Mutation-checked: `symbolic-ref --short`, treating every non-origin name as a deleted branch, dropping go's explicit PR-ref fetch or its `+`, swallowing go's refusal, and dropping the `install tip` catch each fail a test. - Two new tests interrupt each js install path. - `isolated_git` keeps those tests off the developer's git config, any inherited `GIT_DIR`, and the network (`GIT_ALLOW_PROTOCOL=file`). ### Follow-ups Older problems found while reviewing this PR are fixed in a stack of drafts based on it: #673 (don't reset a directory that isn't a worktree) → #674 (branch names vs versions) → #675 (tags moved upstream) → #676 (`checkout go` / `--all`). ### Stack ([DSPX-4372-t1 plan](#657)) Two parallel tracks from `main`; they share no imports and meet in stage 5. | Part | PR | Base | |---|---|---| | 2a: bare-repo and js install fixes | **#667 (this PR)** | `main` | | 2b: manifest contract | #668 | 2a | | 2c: `install benchmark` | #626 | 2b | | 2d: `otdf-local env` exports | #642 | 2c | | 3a: arms as a tuple | #669 | `main` | | 3b: two to four arms | #658 | 3a | | 3c: pytest reads the manifest | #670 | 3b | | 4: candidate-to-candidate conclusions | #659 | 3c | | 5, 6: CI and report | #660, #661 | not yet moved onto these stacks | <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * SDK and platform worktrees now follow updated branches and pull request refs, including after force-pushes. Missing branches produce a clear error instead of a traceback. * Interrupted JavaScript installations no longer leave partial distribution files behind. * **Documentation** * Updated platform installation guidance for branch refreshes, detached worktrees, and pull request refs. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
dmihalcik-virtru
force-pushed
the
DSPX-4372-s2-bench-env
branch
from
October 23, 2026 14:03
dd9d8de to
cdc0d2e
Compare
dmihalcik-virtru
force-pushed
the
DSPX-4372-s2-local-prep
branch
from
October 23, 2026 14:03
eb31790 to
79df81d
Compare
X-Test Failure Report |
dmihalcik-virtru
force-pushed
the
DSPX-4372-s2-bench-env
branch
from
October 26, 2026 17:52
cdc0d2e to
ff4dfd1
Compare
dmihalcik-virtru
force-pushed
the
DSPX-4372-s2-local-prep
branch
from
October 26, 2026 17:52
79df81d to
77a66dc
Compare
X-Test Failure Report |
|
dmihalcik-virtru
marked this pull request as draft
October 28, 2026 13:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Part 2d of the DSPX-4372-t1 plan, split out of #626. Stacked on #626 (needs the manifest it writes).
otdf-local envnow exports, in addition to the platform settings:XT_TMP_DIR—xtest/tmpBENCH_INSTALLATION_MANIFEST— absolute path toxtest/sdk/benchmark.installed.json, when it existsOTDFCTL_HEADS— a JSON array naming the provisioning CLI'sdist/directory (from the manifest'sotdfctlpin, release or source).conftest.load_otdfctlreads it withjson.loads; a comma-joined value would be discarded and the run would fall back tosdk/go/dist/main/otdfctl.sh. Measured arms never supply it.Also adds section 3 of
xtest/perf/README.md: the local prepare → up → env → measure sequence, the manifest, and neutral preparation.Tests:
otdf-local/tests/test_bench_env.py(including the exactjson.loadsconftestperforms).Rebased onto
mainwith #668's and #626's review fixes; no change was needed here.otdf-local envreads only the manifest'sotdfctl.installed_tag, which is unchanged and which the writer now guarantees is non-empty. Manifests frominstall benchmarknow always carrymetadata.sdkand full commit SHAs.uv run pytest -m "not integration": 87 passed; ruff, ruff format and pyright are clean.Known issues from review (to fix before merge):
XT_TMP_DIRunconditionally overwrites a user's existing value (CLAUDE.md recommends pointing it at a large volume).failed/partialmanifest still exportsOTDFCTL_HEADS, pinning otdfctl for every later ordinary run.eval $(otdf-local env)executes; it should useerr_console.Stack (DSPX-4372-t1 plan)
Two parallel tracks from
main; they share no imports and meet in stage 5.mainmaininstall benchmarkotdf-local envexportsmain