-
Notifications
You must be signed in to change notification settings - Fork 2
chore(xtest): adds otdf-sdk-mgr tool for otdf client binary mgmt #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dmihalcik-virtru
merged 24 commits into
opentdf:main
from
dmihalcik-virtru:feat/otdf-sdk-mgr
Feb 19, 2026
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
2ffcbd7
feat(otdf-sdk-mgr): add SDK version management CLI and refactor scripts
dmihalcik-virtru 20c4075
cleanups
dmihalcik-virtru 3baeb44
Update otdfctl.sh
dmihalcik-virtru e1e8afb
remove old scripts
dmihalcik-virtru c60a687
Update xtest.yml
dmihalcik-virtru 9faa0d6
Update xtest.yml
dmihalcik-virtru c5d2feb
Update xtest.yml
dmihalcik-virtru d8d0a88
cleanups
dmihalcik-virtru d40d84e
chore(xtest): Removes dead code and comments to it
dmihalcik-virtru dc32ae9
fix(otdf-sdk-mgr): address PR #410 review issues
dmihalcik-virtru a665d5e
chore(xtest): fmt
dmihalcik-virtru 5ef4548
chore(otdf-sdk-mgr): address PR #410 review issues (round 2)
dmihalcik-virtru f1e54db
fix(xtest): split space-separated ref aliases before spawnSync call
dmihalcik-virtru f8f8642
chore(xtest): restore ci lint check
dmihalcik-virtru d8a3b0b
chore(docs) update path
dmihalcik-virtru 205aa3d
Update checkout.py
dmihalcik-virtru f2d2127
fix(resolve): resolve JS refs via npm; support pre-release and dist-tags
dmihalcik-virtru 616b4e7
feat(ci): add Artifact column to Versions under Test summary table
dmihalcik-virtru 971c988
Update resolve.py
dmihalcik-virtru c0b665d
fix(setup-cli-tool): fix tag sanitization for pre-release version env…
dmihalcik-virtru 5db2709
test(otdf-sdk-mgr): add pytest coverage for semver and resolve modules
dmihalcik-virtru 085b329
fix(test): remove unused variable in test_resolve.py
dmihalcik-virtru 20562ea
chore(xtest) ruff format
dmihalcik-virtru 3426af7
fix(test): resolve pyright type errors in test_resolve.py
dmihalcik-virtru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # otdf-sdk-mgr | ||
|
|
||
| SDK artifact management CLI for OpenTDF cross-client tests. Installs SDK CLIs from **released artifacts** (fast, deterministic) or **source** (for branch/PR testing). Both modes produce the same `sdk/{go,java,js}/dist/{version}/` directory structure. | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| cd otdf-sdk-mgr && uv tool install --editable . | ||
| ``` | ||
|
|
||
| ## Commands | ||
|
|
||
| ### install | ||
|
|
||
| ```bash | ||
| # Install latest stable releases for all SDKs (recommended for local testing) | ||
| otdf-sdk-mgr install stable | ||
|
|
||
| # Install LTS versions | ||
| otdf-sdk-mgr install lts | ||
|
|
||
| # Install specific released versions | ||
| otdf-sdk-mgr install release go:v0.24.0 js:0.4.0 java:v0.9.0 | ||
|
|
||
| # Install from tip of main branch (source build) | ||
| otdf-sdk-mgr install tip | ||
| otdf-sdk-mgr install tip go # Single SDK | ||
|
|
||
| # Install a published version with optional dist name (defaults to version tag) | ||
| otdf-sdk-mgr install artifact --sdk go --version v0.24.0 | ||
| otdf-sdk-mgr install artifact --sdk go --version v0.24.0 --dist-name my-tag | ||
| ``` | ||
|
|
||
| ### versions | ||
|
|
||
| ```bash | ||
| # List available versions | ||
| otdf-sdk-mgr versions list go --stable --latest 3 --table | ||
|
|
||
| # Resolve version tags to SHAs | ||
| otdf-sdk-mgr versions resolve go main latest | ||
| ``` | ||
|
|
||
| ### Other commands | ||
|
|
||
| ```bash | ||
| # Checkout SDK source | ||
| otdf-sdk-mgr checkout go main | ||
|
|
||
| # Clean dist and source directories | ||
| otdf-sdk-mgr clean | ||
|
|
||
| # Fix Java pom.xml after source checkout | ||
| otdf-sdk-mgr java-fixup | ||
| ``` | ||
|
|
||
| ## How Release Installs Work | ||
|
|
||
| - **Go**: Writes a `.version` file; `cli.sh`/`otdfctl.sh` use `go run github.com/opentdf/otdfctl@{version}` (no local compilation needed, Go caches the binary) | ||
| - **JS**: Runs `npm install @opentdf/ctl@{version}` into the dist directory; `cli.sh` uses `npx` from local `node_modules/` | ||
| - **Java**: Downloads `cmdline.jar` from GitHub Releases; `cli.sh` uses `java -jar cmdline.jar` | ||
|
|
||
| ## Source Builds | ||
|
|
||
| Source builds (`tip` mode) check out source to `sdk/{lang}/src/` and compile via `make` to `sdk/{lang}/dist/`. | ||
|
|
||
| After changes to SDK source, rebuild: | ||
|
|
||
| ```bash | ||
| otdf-sdk-mgr install tip go # or java, js | ||
|
|
||
| # Or manually: checkout + make | ||
| cd sdk/go # or sdk/java, sdk/js | ||
| make | ||
|
|
||
| # Verify build worked | ||
| ls -la dist/main/cli.sh | ||
| ``` | ||
|
|
||
| ## Manual SDK Operations | ||
|
|
||
| ```bash | ||
| sdk/go/dist/main/cli.sh encrypt input.txt output.tdf --attr <fqn> | ||
| sdk/go/dist/main/cli.sh decrypt output.tdf decrypted.txt | ||
| ``` |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| [project] | ||
| name = "otdf-sdk-mgr" | ||
| version = "0.1.0" | ||
| description = "SDK artifact management CLI for OpenTDF cross-client tests" | ||
| requires-python = ">=3.11" | ||
| dependencies = [ | ||
| "gitpython>=3.1.46", | ||
| "rich>=13.7.0", | ||
| "typer>=0.12.0", | ||
| ] | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "pyright>=1.1.408", | ||
| "pytest>=8.0.0", | ||
| "ruff>=0.9.0", | ||
| ] | ||
|
|
||
| [project.scripts] | ||
| otdf-sdk-mgr = "otdf_sdk_mgr.cli:app" | ||
|
|
||
| [build-system] | ||
| requires = ["uv_build>=0.9.28"] | ||
| build-backend = "uv_build" | ||
|
|
||
| [tool.ruff] | ||
| target-version = "py311" | ||
| line-length = 100 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| """SDK artifact management CLI for OpenTDF cross-client tests.""" | ||
|
|
||
| __version__ = "0.1.0" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| """Allow running as `python -m otdf_sdk_mgr`.""" | ||
|
|
||
| from otdf_sdk_mgr.cli import app | ||
|
|
||
| app() |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.