-
Notifications
You must be signed in to change notification settings - Fork 2
feat(xtest): DSPX-2971?? Adds variant specifiers to sdk selection #441
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
Draft
dmihalcik-virtru
wants to merge
6
commits into
main
Choose a base branch
from
DSPX-2791-run-matrix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a650a07
feat(otdf-local): auto-generate temp keys for platform variants
dmihalcik-virtru f348215
fix swapped config filenames
dmihalcik-virtru 75550cc
fix(otdf-local): route status output to stderr so eval $(otdf-local e…
dmihalcik-virtru e64a460
adds configure options to otdf-local
dmihalcik-virtru be139e4
feat(xtest): add PQC variant build and test infrastructure
dmihalcik-virtru f30a14f
fixup remove logs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| """User-specified feature overrides for platform config.""" | ||
|
|
||
| from pathlib import Path | ||
| from typing import Any | ||
|
|
||
| from otdf_local.utils.yaml import load_yaml, save_yaml, set_nested | ||
|
|
||
| # Maps CLI feature name -> (yaml_path, description) | ||
| FEATURES: dict[str, tuple[str, str]] = { | ||
| "ec-wrap": ( | ||
| "services.kas.preview.ec_tdf_enabled", | ||
| "EC-wrapped TDF support (ML-KEM / X-Wing hybrid)", | ||
| ), | ||
| "key-management": ( | ||
| "services.kas.preview.key_management", | ||
| "Key management service", | ||
| ), | ||
| } | ||
|
|
||
|
|
||
| def _overrides_path(xtest_root: Path) -> Path: | ||
| """Path to feature overrides file. Lives in tmp/ but outside config/ so it survives --clean.""" | ||
| return xtest_root / "tmp" / "feature-overrides.yaml" | ||
|
|
||
|
|
||
| def load_overrides(xtest_root: Path) -> dict[str, bool]: | ||
| """Load current feature overrides. Returns empty dict if none set.""" | ||
| path = _overrides_path(xtest_root) | ||
| if not path.exists(): | ||
| return {} | ||
| data = load_yaml(path) | ||
| return dict(data) if data else {} | ||
|
|
||
|
|
||
| def save_overrides(xtest_root: Path, overrides: dict[str, bool]) -> None: | ||
| """Persist feature overrides to disk.""" | ||
| path = _overrides_path(xtest_root) | ||
| path.parent.mkdir(parents=True, exist_ok=True) | ||
| save_yaml(path, overrides) | ||
|
|
||
|
|
||
| def apply_overrides(config_data: Any, overrides: dict[str, bool]) -> None: | ||
| """Apply feature overrides to a loaded YAML config object (in-place).""" | ||
| for feature, enabled in overrides.items(): | ||
| if feature in FEATURES: | ||
| yaml_path, _ = FEATURES[feature] | ||
| set_nested(config_data, yaml_path, enabled) |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catching a broad
Exceptioncan hide unexpected issues and make debugging harder. It's generally better to catch more specific exceptions (e.g.,subprocess.CalledProcessError,FileNotFoundError, etc.) that you anticipate might occur during key generation. If you must catchException, consider logging the full traceback for better diagnostics.