feat(cli): add HIPAA placement flag for beta endpoints - #568
Conversation
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Broly Security ScanNote ✅ Clean scan Note Re-scan this PR anytime with
|
|
|
||
|
|
||
| PlacementGroup = Group(validator=mutually_exclusive) | ||
| PlacementGroup = Group("Placement") |
There was a problem hiding this comment.
@cursoragent why did this line change? I think we need to revert this one line.
There was a problem hiding this comment.
Group(validator=mutually_exclusive) is why that line changed — and a literal revert is broken.
Cyclopts flattens PlacementModel into the same group, so mutually_exclusive treats every flag as exclusive:
--placement XOR --placement.regions XOR --placement.constraint XOR --placement.hipaa
That’s why HIPAA couldn’t ship with regions/constraint. I confirmed it: restoring that exact line makes test_deploy_sends_hipaa_compliance_policy fail with:
Error: Mutually exclusive arguments: {--placement, --placement.regions,
--placement.constraint, --placement.hipaa}
So I put a group validator back, but one that only exclusive-checks profile vs any inline:
def exclusive_profile_or_inline(arguments: ArgumentCollection) -> None:
leaves = [argument for argument in arguments.filter_by(value_set=True) if not argument.children]
has_profile = any(argument.field_info.name == "placement_id" for argument in leaves)
has_inline = any(argument.keys for argument in leaves)
if has_profile and has_inline:
raise ValueError("Use either --placement or inline placement options, not both.")
PlacementGroup = Group(validator=exclusive_profile_or_inline)--placement pp_1 --placement.hipaa still errors. --placement.regions + --placement.constraint + --placement.hipaa still combine. 20 tests green.
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Cyclopts flattens PlacementModel fields into PlacementGroup, so mutually_exclusive also rejects --placement.regions with --placement.hipaa. Restore a group validator that only exclusive-checks a profile against inline options. Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
|
@cursoragent fix lint |
|
Pyright was dying on Switched the preview path to walrus + if (compliance_policy := inline.get("compliance_policy")) and (
hipaa := compliance_policy.get("hipaa")
) is not None:
add_row("--placement.hipaa", "true" if hipaa else "false")
|
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>


Summary
--placement.hipaafor HIPAA placement compliance policyplacement.inline.compliancePolicy.hipaaTests
python3 -m pytest tests/cli/test_beta_endpoints.pypython3 -m ruff check src/together/lib/cli/api/beta/endpoints/_utils/_parameters.py src/together/lib/cli/api/beta/endpoints/deploy.py tests/cli/test_beta_endpoints.py