Skip to content

feat(browse): open Depot web destinations#543

Open
WitoDelnat wants to merge 8 commits into
mainfrom
wito/dep-5420-add-depot-browse
Open

feat(browse): open Depot web destinations#543
WitoDelnat wants to merge 8 commits into
mainfrom
wito/dep-5420-add-depot-browse

Conversation

@WitoDelnat

@WitoDelnat WitoDelnat commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This PR adds a very simple command to go from CLI to browser:

A bit gimmick, but might be useful when you've started with downloading the CLI through brew or have been using stripe projects, etc.


Summary

Users and agents can now open any organization-scoped Depot destination from the CLI while relying on the app's existing information architecture. The help leads with Depot CI and Container Builds, then GitHub Action Runners, and includes commands for discovering workflow, build, and job IDs.

Container Builds get two conveniences: builds aliases to projects, and builds/<build-id> resolves the canonical project build URL through the API. Complete URLs and API-returned build URLs are constrained to https://depot.dev; --no-browser makes resolution inspectable and script-friendly.

An unrecognized single-segment path is treated as an entity ID. Numeric IDs open GitHub Actions jobs directly; other IDs are checked concurrently against builds, Depot CI workflows, and Depot CI jobs. A unique match opens its canonical page, while ambiguity fails with explicit paths rather than guessing.

Fixes DEP-5420.

Validation

  • go test ./...
  • golangci-lint run --timeout 5m --new-from-rev origin/main — 0 issues
  • Rendered depot browse --help and smoke-tested workflows, builds, a complete URL, and a bare GitHub Actions job ID with --no-browser

Post-deploy monitoring & validation

This is a local CLI-only change with no server rollout. After release, watch CLI/support reports for systematic browser-open or build-lookup failures; revert the release change if generated Depot URLs do not resolve correctly.


Compound Engineering


Note

Medium Risk
New API-backed URL resolution and a shared Windows browser-launch change affect login and browse; mitigations include depot.dev-only URL checks and explicit ambiguity handling.

Overview
Adds depot browse to resolve Depot web URLs and open them in the default browser (or print them with --no-browser / --org). Relative paths map under the current org; full URLs must be https://depot.dev; builds aliases to projects; builds/<id> resolves the canonical build page via the API.

Bare single-segment IDs trigger concurrent lookups (build, Depot CI workflow/job, numeric GitHub Actions job), with ambiguity and not-found errors instead of guessing. API-returned build URLs are restricted to depot.dev, and relative paths reject .. segments.

OpenURL is exported from pkg/api with a testable browserCommand helper; Windows opening switches from cmd /c start to rundll32 url.dll,FileProtocolHandler (also used during device login). The root command registers browse; tests cover resolution, lookups, and registration.

Reviewed by Cursor Bugbot for commit 6d7034c. Bugbot is set up for automated code reviews on this repo. Configure here.

@linear-code

linear-code Bot commented Jul 16, 2026

Copy link
Copy Markdown

DEP-5420

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Did not approve: Cursor Bugbot did not reach a terminal state within the 8-minute polling window. Cursor Security Agent passed with no findings. Assigned reviewers for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor
cursor Bot requested review from goller and jacobwgillespie July 16, 2026 08:43
Comment thread pkg/api/auth.go
Comment thread pkg/cmd/browse/browse.go
Comment thread pkg/cmd/browse/browse.go
Comment thread pkg/cmd/browse/browse_test.go
Comment thread pkg/cmd/browse/browse.go

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Did not approve: Cursor Bugbot did not reach a terminal state within the 8-minute polling window. Cursor Security Agent passed with no findings. Human reviewers are already assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Comment thread pkg/cmd/browse/browse.go
Comment thread pkg/cmd/browse/browse.go Outdated
Comment thread pkg/cmd/browse/browse.go Outdated
Comment thread pkg/cmd/browse/browse.go Outdated
Comment thread pkg/cmd/browse/browse.go
Comment thread pkg/cmd/browse/browse.go Outdated
Preserve confirmed entity matches when an unrelated lookup fails and recover queued CI job workflow IDs from job metrics.
Use Depot-native discovery guidance and stop promoting secondary raw-path examples.
Comment thread pkg/cmd/browse/browse_test.go
Comment thread pkg/cmd/browse/browse.go Outdated
Comment thread pkg/cmd/browse/browse.go

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Did not approve: Cursor Bugbot finished with status skipping and reported 3 unresolved findings on the latest commit. Cursor Security Agent passed with no findings. Human reviewers are already assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Did not approve: Cursor Bugbot did not reach a terminal state within the 8-minute polling window. Cursor Security Agent passed with no findings. Human reviewers are already assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Comment thread pkg/cmd/browse/browse.go Outdated
- cover bare-ID fallback through the resolver orchestration
- use product-appropriate tokens for build and CI lookups
- accept a trailing slash on build shorthand paths
- decode percent-encoded bare IDs before entity lookup

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6d7034c. Configure here.

Comment thread pkg/api/auth_test.go

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Did not approve: Cursor Bugbot finished with status skipping and reported 1 unresolved finding on the latest commit. Cursor Security Agent passed with no findings. Human reviewers are already assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

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.

1 participant