fix(trail): add support for native repos - #2245
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The routing change is narrowly scoped, keeps the GitHub path intact, and is covered by targeted regression tests validating both route selection and repo-ID propagation.
Pull request overview
This PR fixes entire trail list (and related “tune” gathering) for Entire-native (et) repositories by routing trail list requests through the repo-ID-addressed entire-api route, while keeping the existing host-addressed route for GitHub (gh) repositories. It also updates the trail API client seam to return the processing placement’s repo ID so callers can select the correct list route.
Changes:
- Extend
newTrailAPIClientto return(client, repoID)and plumb that through a newrunAuthenticatedTrailAPIWithRepoIDhelper. - Add
trailListBasePathand update trail listing/gathering to use/api/v1/repos/{repoID}/trailsforetrepos and/api/v1/trails/{forge}/{owner}/{repo}for non-native repos. - Add/adjust regression tests to cover repo-ID propagation and route selection.
File summaries
| File | Description |
|---|---|
| cmd/entire/cli/api_client.go | Updates newTrailAPIClient to resolve placement once, dial the correct cell, and return the processing placement repo ID alongside the client. |
| cmd/entire/cli/cell_target.go | Factors resolveRepoCellPlacementByFullName so both “cell-only” and “cell+repoID” callers share the same placement resolution boundary. |
| cmd/entire/cli/trail_context_cache.go | Introduces runAuthenticatedTrailAPIWithRepoID and adapts existing seams to the new newTrailAPIClient return shape. |
| cmd/entire/cli/trail_cmd.go | Switches trail listing to compute a base path via trailListBasePath and uses the repo-ID route for et repos. |
| cmd/entire/cli/runner_gather.go | Updates trail gathering to use repo-ID-aware trail listing base paths. |
| cmd/entire/cli/trail_cmd_test.go | Adds tests for trailListBasePath and verifies native listing uses the repo-ID route; updates existing tests for the new seam signature. |
| cmd/entire/cli/trail_repo_flag_test.go | Extends routing test coverage to assert repo ID propagation through the authenticated trail API seam. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
computermode
marked this pull request as ready for review
September 2, 2026 22:13
computermode
force-pushed
the
fix-native-trail-list
branch
from
September 3, 2026 18:12
52e0f8e to
9595709
Compare
Soph
approved these changes
Sep 3, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
https://entire.io/gh/entireio/cli/trails/1224
Problem
Entire-native remotes use
/et/<project>/<repo>, but trail API client resolution discarded the forge and looked up only<owner>/<repo>. When a legacy GitHub mirror has the same name—as withentirehq/marvin—the CLI can select the/gh/repository's placement and trails instead.Native repositories also cannot be resolved reliably through the name-addressed cell route. They need to be resolved through their project-scoped repository identity and queried by repository ID.
Changes
ghversusetforge namespace throughout trail repository resolution/api/v1/repos/{repo_id}/trailsas the base route for native repositories/api/v1/trails/gh/{owner}/{repo}for GitHub-backed repositories/et/and/gh/repositoriesCommand coverage
This change migrates the affected paths for:
entire trail listentire trail show, including number, selector, and default/current-branch lookupentire trail update, including metadata and body updatesentire trail delete, including number and branch lookupTest plan
mise run checkmise run linttrail listsmoke test againstentire://aws-us-east-2.entire.io/et/entirehq/marvinreturned exactly its 3 native trailstrail show 3 --jsonsmoke test returned Marvin native trail 3 with an/et/entirehq/marvinURLTracking