Repository navigation
fix(xtest): make otdf-sdk-mgr check out source refs where make builds them - #681
Draft
dmihalcik-virtru wants to merge 2 commits into
Draft
dmihalcik-virtru wants to merge 2 commits into
dmihalcik-virtru wants to merge 2 commits into
Conversation
… them `install tip` passes make VERSIONS=<slug>, and the SDK Makefiles build src/$VERSIONS into dist/$VERSIONS. cmd_tip strips both the `sdk--` and `otdfctl--` prefixes from the flattened ref, but checkout_sdk_branch (js, java) stripped only `sdk--` and checkout_go_from_platform only `otdfctl--`. So go `sdk/v1.2.3` was checked out into src/sdk--v1.2.3 and js or java `otdfctl/<x>` into src/otdfctl--<x>, while make built src/v1.2.3 and src/<x>. With nothing there, make failed with an error that didn't mention the mismatch; with a tree an earlier checkout left there, it built that stale tree into the dist/ directory the caller expected. Both checkouts now name the worktree with _worktree_name, the same expression cmd_tip uses. dist/ names don't change, and src/ names change only for the two broken combinations. For go that moves the platform-src/ worktree too, and the src/ symlink follows it. The new test runs cmd_tip for go, java and js with git and make stubbed at the subprocess layer, for main, feature/x, sdk/v1.2.3, otdfctl/v0.24.0, refs/pull/123/head and a full SHA. It checks that src/ holds exactly src/$VERSIONS and, for go, that the link resolves into platform-src/$VERSIONS. Without the fix, go-sdk/v1.2.3, java-otdfctl/v0.24.0 and js-otdfctl/v0.24.0 fail. Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Oct 26, 2026
|
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.



What
otdf-sdk-mgr install tipchecks a ref out underxtest/sdk/<lang>/src/and then runsmakewithVERSIONS=<slug>; the SDK Makefiles buildsrc/$VERSIONSintodist/$VERSIONS.cmd_tipcomputes the slug by flattening/to--and stripping bothsdk--andotdfctl--, but the checkouts named the worktree differently:checkout_sdk_branch(js, java) stripped onlysdk--, sootdfctl/<x>went tosrc/otdfctl--<x>while make builtsrc/<x>;checkout_go_from_platformstripped onlyotdfctl--, sosdk/v1.2.3went toplatform-src/sdk--v1.2.3(andsrc/sdk--v1.2.3) while make builtsrc/v1.2.3.Both checkouts now name the worktree with one private helper,
checkout._worktree_name, using the same expression ascmd_tip.Why it matters
When
src/<slug>didn't exist, make failed with an error that never mentioned the mismatch. When an earlier checkout had left asrc/<slug>, make silently built that stale tree into thedist/directory the caller expected, so tests ran against the wrong source.User-visible effect
dist/names are unchanged.src/worktree names change only for the two combinations that were broken: go withsdk/...refs (nowsrc/<x>andplatform-src/<x>), and js/java withotdfctl/...refs (nowsrc/<x>). Existingsdk--*/otdfctl--*directories from earlier checkouts are no longer used;otdf-sdk-mgr clean --src-onlyremoves them.Validation
otdf-sdk-mgr/tests/test_tip_checkout.pyruns the realcmd_tipfor go, java and js with only git and make stubbed at the subprocess layer, overmain,feature/x,sdk/v1.2.3,otdfctl/v0.24.0,refs/pull/123/headand a 40-char SHA. It asserts thatsrc/holds exactlysrc/$VERSIONSand, for go, that the symlink resolves intoplatform-src/$VERSIONS/otdfctl. Without the fix,go-sdk/v1.2.3,java-otdfctl/v0.24.0andjs-otdfctl/v0.24.0fail.uv run ruff check .,uv run ruff format --check .,uv run pyrightanduv run pytest(225 passed) inotdf-sdk-mgr/.Follow-up
Found in review of #668, which adds
refs.dist_slugwith this same expression and switchescmd_tipto it. Once both land, both checkout call sites switch torefs.dist_slugand_worktree_namegoes away. This PR keeps the change local tocheckout.pyso the two don't conflict. Recorded in the DSPX-4372-t1 plan.