Support branchless trail creation#1492
Open
entire[bot] wants to merge 2 commits into
Open
Conversation
9ebc42c to
fc3274c
Compare
Entire-Checkpoint: 6604ab821878
fc3274c to
5921e40
Compare
Contributor
There was a problem hiding this comment.
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-branchflag and updatedtrail createflow to allow branchless creation, including interactive handling. - Refactored
trail createinto smaller helpers (field resolution, validation, branch preparation, API post, output, optional checkout). - Updated API request typing/serialization to omit
branch_namewhen 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) |
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/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.