Skip to content

fix: restore Go installation for v2 releases - #87

Open
mvanhorn wants to merge 1 commit into
kunchenguid:mainfrom
mvanhorn:fix/62-go-v2-module-path
Open

fix: restore Go installation for v2 releases#87
mvanhorn wants to merge 1 commit into
kunchenguid:mainfrom
mvanhorn:fix/62-go-v2-module-path

Conversation

@mvanhorn

Copy link
Copy Markdown

Testing

  • From the repository root, the module reports github.com/kunchenguid/treehouse/v2, all packages resolve under that prefix, and the existing full Go test/build matrix continues to pass on Linux, macOS, and Windows.
  • The regression test fails when go.mod loses the /v2 suffix or when any production or test Go source imports github.com/kunchenguid/treehouse/... without /v2.
  • The README documents go install github.com/kunchenguid/treehouse/v2@latest, while clone URLs, GitHub release/update endpoints, Nix references, and installer repository identifiers remain unsuffixed.
  • After a maintainer publishes a corrected v2 tag, installing that tag through the /v2 module path succeeds; the release/tag verification remains an external post-merge check because an unpublished tag cannot be exercised in repository tests.

What Changed

Change the module declaration to github.com/kunchenguid/treehouse/v2 and migrate every Go self-import to that canonical prefix, including the import used by internal/pool/pool_test.go, so all packages remain within one valid v2 module. Update only the README's Go installation command to use the /v2 path; repository URLs used for cloning, releases, badges, Nix inputs, install scripts, and updater API calls continue to identify the unchanged GitHub repository and must not gain the module suffix. Add a focused root-level regression test that derives the declared module path from go.mod and verifies it is the expected v2 path and that repository Go files contain no legacy unsuffixed self-imports, without introducing a production-only test seam.

Why

Treehouse's v2 tags still declare the unsuffixed github.com/kunchenguid/treehouse module path, violating Go's semantic import versioning rule for major versions greater than one. Consequently, both explicit v2 installation forms fail, while the README's @latest command silently resolves to v1.8.0 instead of a current release. The report includes reproducible failures for v2.0.0, and a follow-up confirms the defect persists through v2.1.1. The issue is open and unassigned, with no competing or prior closed-unmerged pull requests in the supplied evidence.

Fixes #62

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: not merging yet. update-vendor-hash failed while check and the OS test matrix passed. @mvanhorn please fix that job (or say if it is a false fail) so this can go through Greptile. Fixes #62, which we still want.

@kunchenguid

Copy link
Copy Markdown
Owner

No description provided.

@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown

The update-vendor-hash failure is expected here. Changing go.mod from github.com/kunchenguid/treehouse to github.com/kunchenguid/treehouse/v2 updates vendor/modules.txt, which invalidates the vendorHash stored in flake.nix (currently sha256-z8IndcHcZ6nLqhLtAYul3ppddpOA4AHGQWIlfYY/pfI=).

To fix:

  1. Run go mod tidy && go mod vendor locally.
  2. In flake.nix, temporarily set vendorHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";.
  3. Run nix build — the build will fail with the correct hash in the error output.
  4. Replace the placeholder with the correct hash and push.

The core check and OS matrix are already green, so this is the only remaining blocker.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: re-checked after the later Greptile note. update-vendor-hash is still red; ubuntu/macos/windows tests are green. Still waiting on a vendorHash fix before merge. No competing PR.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: no new author push. Still blocked on update-vendor-hash. Not merging.

@andrew-codes

Copy link
Copy Markdown
Contributor

Note: I addressed the root cause of the merge blocker in #105 . This will make this PR merge-able.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: still not merging. Tests on this PR are green; update-vendor-hash is still the blocker. @andrew-codes's #105 is the path for that job. No new ask for @mvanhorn.

kunchenguid pushed a commit that referenced this pull request Aug 21, 2026
* fix(ci): checkout correct ref for fork PRs in update-vendor-hash

actions/checkout defaulted to the kunchenguid/treehouse repo with a
head_ref that only exists on the contributor's fork, so the fetch
failed outright for every fork-originated PR (e.g. #87, fixing #62).
Check out github.event.pull_request.head.repo.full_name/sha instead,
which resolves for both same-repo and fork PRs.

Also harden the commit step: since GITHUB_TOKEN can never push back to
a fork it doesn't own, detect that case explicitly and no-op instead
of failing - the preceding nix build step already verifies the
corrected vendorHash builds, so there's nothing left to gate on.

* fix(ci): checkout branch ref and fail loudly on stale fork vendorHash

Checking out head.sha (a commit) leaves actions/checkout@v4 in detached
HEAD, which breaks the final `git push` step for same-repo PRs - the
one case that worked before this fix was introduced. Use head.ref (the
branch name) instead, restoring a real local branch to push from.

Also stop reporting success on fork PRs when vendorHash is genuinely
stale: exiting 0 after only a warning let a real staleness go green
with nothing fixed. Exit 1 so CI still fails loudly for that case;
only an already-correct build exits 0.

* no-mistakes(document): No stale docs or lint issues; workflow fix is self-contained

* fix: remove .serena/ files not relevant to Treehouse

.serena/.gitignore and .serena/project.yml are Serena MCP editor/tool
config added incidentally by an earlier automated pass; they are not
part of the vendor-hash workflow fix and were flagged by the maintainer.

* no-mistakes(document): No stale docs or lint issues; change is CI-only and self-contained

* fix: gitignore .serena/ and remove tracked files again

.serena/.gitignore and .serena/project.yml got re-tracked by a tool
step during the previous pipeline run. Adding .serena/ to .gitignore
prevents it from being re-added mid-pipeline, alongside removing the
two files again per maintainer feedback on PR #105.
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.

go install broken for v2.0.0 — go.mod module path missing /v2 suffix

3 participants