Skip to content

fix: point install one-liner at HEAD instead of main - #2

Open
Bradenream wants to merge 2 commits into
masterfrom
braden/fix-install-url-branch/COR-0
Open

fix: point install one-liner at HEAD instead of main#2
Bradenream wants to merge 2 commits into
masterfrom
braden/fix-install-url-branch/COR-0

Conversation

@Bradenream

@Bradenream Bradenream commented Aug 11, 2026

Copy link
Copy Markdown

Problem

The published install commands fetch raw.githubusercontent.com/voiceflow/cli/main/scripts/install.sh. This repository's default branch is master, so that URL 404s and both quick-install paths are broken for every user.

main   -> 404
master -> 200
HEAD   -> 200   (byte-identical to master)

Six occurrences across three files: comment headers in scripts/install.sh (2) and scripts/install.ps1 (2), plus the two commands actually published in README.md.

Why HEAD and not master

The defect is a hardcoded branch name. Fixing it with a different hardcoded branch name leaves the same bug latent — it fires the day anyone renames master to main, because raw.githubusercontent.com does not redirect renamed branches. HEAD resolves to whatever the default branch currently is. Confirmed branch-name agnostic by resolving it against a repository whose default is main.

This does not make the URL immutable — see the follow-up below. It removes one failure mode, not the class.

Why the README needed more than a find-and-replace

The README occurrences sat inside <!-- Start CLI Installation [installation] --><!-- End … -->, which Speakeasy owns. Editing in place would be reverted by the next yarn codegen.

  • Speakeasy hardcodes main. Not derived from the repo's default branch — this repo is the proof, since it is master yet emits main. No gen.yaml or workflow.yaml key overrides it, and the published docs template prints the branch as a literal while substituting only org and repo.
  • persistentEdits would not have saved it. README.md does not appear in .speakeasy/gen.lock's trackedFiles, so it gets no three-way merge. (scripts/install.sh and install.ps1 are tracked, so their edits do merge — a different survival mechanism, also untested here.)
  • The fix is the No marker, applied in Speakeasy's documented position: the Start comment is removed and the matching End comment becomes <!-- No CLI Installation [installation] -->.

What the evidence actually shows

An earlier revision of this PR claimed three production repos all place the marker in the Start slot with content following. That was wrong, and only one of the three matched. Corrected:

Repo Form
launchdarkly/mcp-server marker in Start slot, content follows, no End — survived 3 regen commits
open-policy-agent/opa-java marker 70 lines below the content it suppresses
Kong/terraform-provider-konnect bare untagged No markers, no associated content, zero Start markers in the file

The right conclusion is stronger than the original claim: the marker is a file-level suppression flag whose position does not matter. Since position appears not to matter and the documented form costs nothing, this PR uses the documented form.

Caveat worth weighing: no Speakeasy cli-target repo on GitHub uses a No marker at all — every datapoint above is from a different generator (typescript/mcp, java, terraform). The mechanism is unvalidated on this generator.

Verification

Both published URLs return 200; the fetched installer passes bash -n. Markers balance at 11 Start / 11 End / 1 No, with [installation] absent from every Start/End pair. The ## CLI Installation heading and its #cli-installation TOC anchor are byte-identical to master.

Speakeasy's generated TOC is heading-derived, not managed-section-derived, so an unmanaged section keeps its TOC entry — verified on launchdarkly/mcp-server and opa-java, both of which have a No-marked section still listed in their generated TOC.

Non-comment changed lines under scripts/ is zero — every changed line there starts with #.

Merge gate

yarn codegen was never run. speakeasy is not installed, openapi.stable.json is gitignored and absent, and workflow.yaml's registry: line is a publish target rather than an input — so a reviewer is as blocked as the author. Someone with Speakeasy auth should run it on this branch and confirm the section survives with HEAD intact and no duplicate section re-inserted at <!-- Placeholder for Future Speakeasy SDK Sections -->.

Worst case if it does not survive is today's status quo: the URLs revert to main and 404, exactly as they do now.

Expect codegen to also add ~18 docs/vf_test*.md files. That is pre-existing staleness — the test command tree exists in internal/cli/test/ but was never doc-generated — not caused by this PR.

Follow-ups worth filing

  1. Release-pinned install URL. HEAD is still mutable: a bad commit on the default branch reaches users immediately. The durable target is https://github.com/voiceflow/cli/releases/latest/download/install.sh, immutable per release and free to maintain via release.extra_files in goreleaser. It cannot ship here because that URL 404s until a release carries the asset — sequence: goreleaser change, cut a release, flip the URLs. This PR is the prerequisite either way, since README ownership is what lets any non-Speakeasy URL survive codegen.
  2. No PR CI exists. The only workflow is release-on-tag; test/ holds 20 vitest files that automation never runs. A user-facing 404 shipped across 123 releases with nothing to catch it. A liveness check on the two published URLs would have.
  3. Consider renaming the default branch to main. It would make Speakeasy's hardcoded output correct at the source. Blast radius looks near-zero (the release workflow triggers on tags, and no branch references exist in .github/, goreleaser, or docs/). Rejected here because it does not get us to release-pinning and HEAD already removes the rename fragility — but if follow-up 1 is never going to land, the rename is the better durable fix.

Worth knowing: the installer body already resolves binaries through the releases API, so the branch affects only the bootstrap fetch of the installer itself.

The published install commands fetched
raw.githubusercontent.com/voiceflow/cli/main/scripts/install.sh, but this
repository's default branch is master. That URL returns 404, so both the bash
and PowerShell quick-install paths were broken for every user.

  main   -> 404
  master -> 200

Corrects all six occurrences: the comment headers in scripts/install.sh and
scripts/install.ps1, and the two commands actually published in README.md.

The README occurrences sat inside a Speakeasy-managed block. Speakeasy hardcodes
the branch as `main` -- it is not inferred from the repository's default branch,
and no gen.yaml or workflow.yaml key overrides it -- so editing in place would be
reverted by the next `yarn codegen`. The section is therefore taken out of
generator management using Speakeasy's documented `No ... [tag]` marker, which
replaces the `Start` marker and drops the `End` marker. README.md is not in
gen.lock's trackedFiles, so persistentEdits would not have protected it.

The installer body already resolves binaries through the releases API, so the
branch affects only the bootstrap fetch of the installer itself. Pinning that to
a mutable branch remains fragile; migrating it to a release asset is tracked
separately.
Copilot AI lite review requested due to automatic review settings August 11, 2026 21:10

Copilot AI 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.

Pull request overview

Fixes broken “quick install” commands by updating the raw GitHub URLs to point at this repo’s default master branch, and prevents Speakeasy regeneration from silently reverting the README install section back to main.

Changes:

  • Update the published install one-liners (README + script headers) from .../main/... to .../master/....
  • Replace Speakeasy Start/End markers for the README install section with the No ... marker and add an explanatory comment so the fix survives yarn codegen.

Reviewed changes

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

File Description
scripts/install.sh Updates usage header URLs to master so copy/paste install instructions don’t 404.
scripts/install.ps1 Updates usage header URLs to master so PowerShell install instructions don’t 404.
README.md Updates the published quick-install commands to master and removes the section from Speakeasy management to avoid reversion.

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

Addresses two findings from adversarial review of this PR.

Use `HEAD` rather than `master` in the install URLs. The original defect was a
hardcoded branch name; fixing it with a different hardcoded branch name leaves
the same bug latent, and it would fire the day anyone renames master to main --
raw.githubusercontent.com does not redirect renamed branches. `HEAD` resolves to
whatever the default branch currently is. Verified: HEAD returns 200 with content
byte-identical to master, and also resolves on a repository whose default is
`main`, so it is branch-name agnostic.

Move `<!-- No CLI Installation [installation] -->` from the `Start` slot to the
`End` slot, which is what Speakeasy documents: remove the `Start` comment and
change the matching `End` comment to `No`. Evidence from generated repositories
in the wild shows the marker behaves as a file-level suppression flag whose
position does not matter -- Kong/terraform-provider-konnect carries bare untagged
`No` markers with no associated content at all, and open-policy-agent/opa-java
places its marker 70 lines below the content it suppresses. Since position
appears not to matter and the documented form costs nothing, use the documented
form.

Also record in the README comment that hand-owning this section means the
dormant `cli.distribution` channels in .speakeasy/gen.yaml (homebrew, nfpm,
winget) will not contribute install instructions here if they are enabled later.
@Bradenream Bradenream changed the title fix: point install one-liner at master instead of main fix: point install one-liner at HEAD instead of main Aug 11, 2026
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.

3 participants