feat(hogli): add devbox region support#60320
Conversation
There was a problem hiding this comment.
No showstoppers — this is a well-scoped developer tooling change adding region selection to the internal devbox CLI. The region input is safely constrained by click.Choice, defensive metadata parsing is thorough, and test coverage is comprehensive.
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
tools/hogli-commands/hogli_commands/tests/test_devbox.py:1538-1572
These two status tests are structurally identical — same stubs, same invocation, different workspace payload and assertion. Per the team's preference for parametrised tests, they should be a single `@pytest.mark.parametrize` case instead of two separate methods.
```suggestion
@pytest.mark.parametrize(
"workspace, expected_region",
[
(
{
"latest_build": {
"status": "running",
"resources": [{"metadata": [{"key": "region", "value": "eu-central-1"}]}],
}
},
"eu-central-1",
),
(
{"latest_build": {"status": "stopped", "resources": []}},
"unknown",
),
],
ids=["region-present", "region-absent"],
)
def test_devbox_status_shows_region(
self, monkeypatch: pytest.MonkeyPatch, workspace: dict, expected_region: str
) -> None:
monkeypatch.setattr(devbox_cli, "ensure_runtime_ready", lambda: None)
monkeypatch.setattr(devbox_cli, "resolve_workspace_name", lambda ws: ("devbox-test-user", []))
monkeypatch.setattr(devbox_cli, "get_workspace", lambda name, workspaces=None: workspace)
monkeypatch.setattr(devbox_cli, "extract_workspace_label", lambda name: None)
result = runner.invoke(cli, ["devbox:status"])
assert result.exit_code == 0
assert "Region:" in result.output
assert expected_region in result.output
```
Reviews (1): Last reviewed commit: "test(hogli): drop dead stubs in region r..." | Re-trigger Greptile |
|
Retaining stamphog approval — delta since last review classified as |
New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.
There was a problem hiding this comment.
The automated gates denied this PR solely because it exceeded the size threshold (757 lines). The change itself looks low-risk — it's internal devbox CLI tooling with comprehensive tests, authored by a member of the owning team. A human reviewer should give it a quick pass and approve.
There was a problem hiding this comment.
The automated gate denied this PR solely because it exceeded the size threshold. The change is internal devbox CLI tooling by a member of the owning team, with no production code, data model, or security impact. A quick human review from the team is sufficient to approve.
Problem
hogli devboxhad no concept of region — every box silently landed inus-east-1, with no way to launch in the neweu-central-1(Frankfurt) region, and the list/status views didn't show which region a box was in.Changes
devbox:startgains--region(us-east-1|eu-central-1, defaultus-east-1), forwarded to the template'sworkspace_regionparameter.devbox:listgains aREGIONcolumn;devbox:statusgains aRegion:line, both read from the workspaceregionmetadata.Safe to ship before/after the EU template is live: the default is dropped by the existing param-retry shim if the template lacks the parameter; an unavailable region is rejected by Coder as an invalid option rather than silently falling back.
How did you test this code?
I'm an agent. Added/updated automated tests in
test_devbox.py(region forwarding + retry,--regionvalidation,get_workspace_regionparsing, list/status rendering). Full devbox suite:211 passed. No manual testing against a live Coder deployment.Publish to changelog?
no
🤖 Agent context
Authored by Claude Code (Opus 4.7).