Skip to content

trail: print the server's url for a project trail - #2793

Merged
toothbrush merged 4 commits into
mainfrom
paul/trail-url
Oct 17, 2026
Merged

toothbrush merged 4 commits into
mainfrom
paul/trail-url

Conversation

@toothbrush

@toothbrush toothbrush commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

https://entire.io/gh/entireio/cli/trails/1590

Why

entire trail show --project … prints a project trail's number with no page link, so agents compose one from the number and the repository shape and land on a 404 (gh/entirehq/entiredb/trails/20289). entire-api now answers url on project Trails, parent references and repository code work (https://entire.io/et/entirehq/entire-api/trails/392, deployed).

What

  • api.ProjectTrail.URL and api.TrailParentReference.URL decode the new fields.
  • entire trail show --project … prints URL: … right after the Trail #N: line when the server sent one; JSON output carries it as-is. A whitespace-only value counts as absent, as trailDisplayURL already treats it.
  • Repository trail show and trail list carry the parent's page: trail.Metadata.ProjectTrailURL (project_trail_url in JSON), printed as Project trail: … in the human view (Project: already names the project ID in the project view). That is the link agents guessed and 404'd on.
  • Repository trails already preferred a server url (trailDisplayURL); no change there.

Verification

go build, go vet, mise run lint:go clean; go test on cmd/entire/cli, api and trail passes with ENTIRE_PROJECT_TRAILS unset (set, the trail merge tests fail on main too, since that mode has no merge). Tests: TestProjectTrailShowPrintsServerURL, TestProjectTrailShowOmitsURLWithoutOne (absent and whitespace), and printTrailDetails prints Project trail: with a parent page and omits it without; both link lines are sanitized before printing. mise run lint:shellcheck fails on scripts/check-pr-binaries.sh (SC2312) on origin/main as well; untouched here.


Note

Low Risk
Display and JSON deserialization only; behavior is unchanged when url is omitted.

Overview
Adds optional url on project trail API models (ProjectTrail and TrailParentReference) so the server can return a canonical web link.

trail show (and any command that uses human-readable printProjectTrail) now prints a URL: line when the response includes it; JSON output picks up the field automatically. A test asserts the CLI shows the server-provided URL.

Reviewed by Cursor Bugbot for commit f43851f. Configure here.

entire-api now answers url on project Trails and parent references.
Decode it and show it under the header, so nothing has to compose a
project Trail's page from its number.

Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 07:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are narrowly scoped, preserve behavior when URLs are absent, and have no identified blocking issues.

0 open findings

What changed in this PR

Adds server-provided URLs to project trail output, preserving existing behavior when no URL is returned.

Changes:

  • Adds optional URL fields to project trail API models.
  • Prints the URL in human-readable output and tests its display.
File Description
cmd/​entire/​cli/​project_trail_cmd.go Prints the sanitized URL when present.
cmd/​entire/​cli/​project_trail_cmd_test.go Verifies display of the server-provided URL.
cmd/​entire/​cli/​api/​project_trails.go Adds optional URL fields to both API models.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@toothbrush
toothbrush marked this pull request as ready for review October 16, 2026 08:03
@toothbrush
toothbrush requested a review from a team as a code owner October 16, 2026 08:03
MuskanPaliwal
MuskanPaliwal previously approved these changes Oct 16, 2026
The parent reference's url now reaches the reader: trail.Metadata
carries project_trail_url and the human view prints it as Project.
A whitespace-only url is no url, matching trailDisplayURL.

Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
toothbrush and others added 2 commits October 17, 2026 13:39
Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
"Project:" already names the project ID in the project view. The
project view prints URL right after the title, where the repo view
keeps its link.

Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
@toothbrush
toothbrush merged commit 9c3b86e into main Oct 17, 2026
19 checks passed
@toothbrush
toothbrush deleted the paul/trail-url branch October 17, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants