Skip to content

feat(hogli): add devbox region support#60320

Merged
rnegron merged 6 commits into
masterfrom
worktree-devbox-region-support
May 28, 2026
Merged

feat(hogli): add devbox region support#60320
rnegron merged 6 commits into
masterfrom
worktree-devbox-region-support

Conversation

@rnegron
Copy link
Copy Markdown
Member

@rnegron rnegron commented May 27, 2026

Problem

hogli devbox had no concept of region — every box silently landed in us-east-1, with no way to launch in the new eu-central-1 (Frankfurt) region, and the list/status views didn't show which region a box was in.

Changes

  • devbox:start gains --region (us-east-1 | eu-central-1, default us-east-1), forwarded to the template's workspace_region parameter.
  • devbox:list gains a REGION column; devbox:status gains a Region: line, both read from the workspace region metadata.
  • Region is create-only (immutable after), so the update and parameter-sync paths are untouched.

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, --region validation, get_workspace_region parsing, 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).

@rnegron rnegron marked this pull request as ready for review May 27, 2026 20:14
@rnegron rnegron added the stamphog Request AI review from stamphog label May 27, 2026
@assign-reviewers-posthog assign-reviewers-posthog Bot requested a review from a team May 27, 2026 20:15
github-actions[bot]
github-actions Bot previously approved these changes May 27, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 27, 2026

Prompt To Fix All With AI
Fix 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

Comment thread tools/hogli-commands/hogli_commands/tests/test_devbox.py Outdated
@rnegron rnegron removed the request for review from a team May 27, 2026 20:18
@stamphog
Copy link
Copy Markdown

stamphog Bot commented May 27, 2026

Retaining stamphog approval — delta since last review classified as trivial_paths.

@github-actions github-actions Bot dismissed their stale review May 28, 2026 15:03

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

Copy link
Copy Markdown

@stamphog stamphog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@stamphog stamphog Bot removed the stamphog Request AI review from stamphog label May 28, 2026
Comment thread tools/hogli-commands/hogli_commands/devbox/cli.py
@rnegron rnegron added the stamphog Request AI review from stamphog label May 28, 2026
Copy link
Copy Markdown

@stamphog stamphog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@stamphog stamphog Bot removed the stamphog Request AI review from stamphog label May 28, 2026
@rnegron rnegron merged commit 81ef404 into master May 28, 2026
171 checks passed
@rnegron rnegron deleted the worktree-devbox-region-support branch May 28, 2026 16:02
@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented May 28, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-05-28 16:34 UTC Run
prod-us ✅ Deployed 2026-05-28 17:00 UTC Run
prod-eu ✅ Deployed 2026-05-28 17:02 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants