Skip to content

Support branchless trail creation#1492

Open
entire[bot] wants to merge 2 commits into
mainfrom
support-branchless-trail-creation
Open

Support branchless trail creation#1492
entire[bot] wants to merge 2 commits into
mainfrom
support-branchless-trail-creation

Conversation

@entire

@entire entire Bot commented Jun 22, 2026

Copy link
Copy Markdown

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

This draft pull request was opened by Entire after CI was requested for the linked trail. Feel free to edit the title or body — the link above is what keeps the trail and PR connected.

@dipree dipree force-pushed the support-branchless-trail-creation branch from 9ebc42c to fc3274c Compare June 22, 2026 14:10
Entire-Checkpoint: 6604ab821878
@dipree dipree force-pushed the support-branchless-trail-creation branch from fc3274c to 5921e40 Compare June 22, 2026 14:18
@dipree dipree marked this pull request as ready for review June 22, 2026 16:10
@dipree dipree requested a review from a team as a code owner June 22, 2026 16:10
Copilot AI review requested due to automatic review settings June 22, 2026 16:10

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.

Pull request overview

This PR adds support for creating branchless trails (i.e., trails not tied to a Git branch) in the entire trail create command, expanding the trail model beyond branch-backed workflows.

Changes:

  • Added --no-branch flag and updated trail create flow to allow branchless creation, including interactive handling.
  • Refactored trail create into smaller helpers (field resolution, validation, branch preparation, API post, output, optional checkout).
  • Updated API request typing/serialization to omit branch_name when creating branchless trails, and added focused unit tests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
cmd/entire/cli/trail_cmd.go Adds --no-branch support and refactors the create flow to optionally skip branch creation/push/checkout while still creating the trail.
cmd/entire/cli/trail_cmd_test.go Adds unit tests ensuring branchless create requests omit branch fields and that branch preparation is skipped for branchless trails.
cmd/entire/cli/api/trail_types.go Makes branch_name optional (omitempty) and documents how to create a branchless trail via the API payload.

Comment on lines +50 to +51
func TestNewTrailCreateRequestCanBeBranchless(t *testing.T) {
req := newTrailCreateRequest("title", "body", "", "main", "open")
Comment on lines +66 to +67
func TestPrepareTrailCreateBranchSkipsBranchlessTrail(t *testing.T) {
state, err := prepareTrailCreateBranch(io.Discard, io.Discard, nil, "", "main", true)
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.

2 participants