Repository navigation
feat(shortcuts): add /release-notes shortcut to display changelog entries - #634
Conversation
|
@infer CI is failing - can you fix it? |
Todos
Pull Request✅ Infer Result: SuccessThe task is complete. All CI checks are passing on PR #634:
The two CI failures (a Model: Tokens: 5,702,076 in · 10,253 out · 5,712,329 total (88 requests) Tool calls: 94 total · 100% success rate Triggered by edenreich · Infer Action |
Co-authored-by: Eden Reich <[email protected]>
|
@claude Can you review this? |
|
Claude finished @edenreich's task in 5m 0s —— View job Review:
|
|
@infer Please address the comments from claude, it's right about the fact that the release notes have to be fetched from the remote release! |
Todos
Pull Request✅ Infer Result: SuccessThe task is complete. All of Claude's review comments have been addressed:
Everything builds, Model: Tokens: 1,566,484 in · 14,338 out · 1,580,822 total (30 requests) Tool calls: 40 total · 100% success rate Triggered by edenreich · Infer Action |
|
@infer CI is failing, please prepare this PR for another review from claude. |
Todos
Pull Request✅ Infer Result: SuccessThe task is complete. Here's a summary of what was accomplished: Problem: The Fix: Extracted the error handling into a dedicated All CI checks are now passing:
The PR is ready for Claude's review. Model: Tokens: 3,169,171 in · 11,800 out · 3,180,971 total (77 requests) Tool calls: 87 total · 100% success rate Triggered by edenreich · Infer Action |
|
@claude Can you give your final review and tell me if this is ready for merge? |
|
Claude finished @edenreich's task in 4m 24s —— View job Final Review:
|
| Prior concern | Status |
|---|---|
| 🔴 CHANGELOG.md read from working directory | ✅ Now fetches from GitHub Releases via gh release view |
🟡 Unreachable notes = sections[0] fallback |
✅ Gone (Execute rewritten) |
🟡 Redundant second TrimPrefix |
✅ Gone (parseChangelog removed) |
🟡 Non-hermetic Execute test |
✅ Injectable fetchFn; tests no longer touch the repo's CHANGELOG |
🔵 Ignored scanner.Err() |
✅ No scanner anymore |
| 🔵 Implicit newest-first ordering | ✅ No longer applicable (gh returns latest) |
| Docs | ✅ shortcuts-guide.md:54 notes the gh install/auth requirement |
Coverage is solid - 13 hermetic tests including v-prefix stripping, version-not-found, fetch error, and date/section parsing.
🔴 Blocker: gh release view isn't pinned to a repo, so it still depends on the working directory
fetchReleaseNotesFromGH (release_notes.go:77-87) runs:
args := []string{"release", "view", "--json", "body,tagName,publishedAt"}
if version != "" {
args = append(args, "v"+version)
}
cmd := exec.Command("gh", args...)There's no --repo. When gh release view has no --repo flag (and no GH_REPO env var), it resolves the target repository from the current directory's git remote. For the installed infer binary - which users run from arbitrary directories - that means:
- In a non-git dir, or a repo whose remote isn't GitHub:
gherrors and the user seesFailed to fetch release notes: .../no releases found. - In a different GitHub project's checkout:
/release-notesshows that project's releases, notinference-gateway/cli's.
This is the very scenario the rewrite set out to fix (issue #518, end users of the released binary). The file-walk dependency on os.Getwd() was removed, but gh's remote resolution reintroduces an equivalent CWD dependency. It only reliably shows infer's notes when run from a checkout of this repo - the same limitation as before.
Fix: pin the repository explicitly so resolution never touches the CWD:
args := []string{"release", "view", "--repo", "inference-gateway/cli", "--json", "body,tagName,publishedAt"}A package-level const releaseRepo = "inference-gateway/cli" keeps it tidy, and a one-line test asserting the args contain --repo inference-gateway/cli would lock it in. (gh still needs auth for the API, which the docs already call out - that part is fine.)
🔵 Nits (non-blocking)
- Context is ignored.
Execute(_ context.Context, ...)drops the ctx, andfetchFn func(version string)can't thread it, so theghnetwork call isn't cancellable - if it hangs, the chat hangs. Considerexec.CommandContext(ctx, "gh", ...)and addingctxto thefetchFnsignature. (release_notes.go:42,48,83) errors.Isover string matching. InhandleGHError(release_notes.go:110),strings.Contains(err.Error(), "executable file not found")works, buterrors.Is(err, exec.ErrNotFound)is the idiomatic, locale-proof way to detect a missingghbinary.- Default version. Default shows the repo's latest release rather than the running build's version (
versionincmd/version.go, injected via ldflags). "Latest" is a perfectly reasonable UX choice - just noting the build version is available if you ever want/release-notesto default to "the notes for the version you're running."
✅ Things done well
- Clean
Shortcut-interface conformance; the injectablefetchFnmirrors theCopyShortcuttestability pattern I pointed to last time - nicely done. handleGHErrorextraction keepsnestifhappy and reads clearly.v-prefix trimmed on both the input arg (release_notes.go:45) and the tag name (releaseDataToSection,:123);PublishedAt[:10]is length-guarded.- Local checks all green:
go build ./...,go vet ./internal/shortcuts/, and 13/13 tests pass.
Bottom line: Not a "no," just a "one more thing." The previous round of feedback is fully resolved; pin the gh repo so the feature actually works for the installed binary (its whole purpose), and I'd consider this ready to merge. The nits are optional polish. Happy to implement the repo-pinning fix if you tag me - it's a few lines plus a test.
· branch feat/release-notes-shortcut
|
@infer /model deepseek/deepseek-v4-flash can you address claude's comment and make this pull request ready for merge? |
Todos
Pull Request✅ Infer Result: SuccessThe task is complete. Here's what was accomplished: What was asked@edenreich asked: "address claude's comment and make this pull request ready for merge" What was done
The PR is ready for merge. Model: Tokens: 5,583,288 in · 17,548 out · 5,600,836 total (94 requests) Cost: $0.7817 in · $0.0049 out · $0.7866 total Tool calls: 96 total · 99% success rate
|
|
@claude Can you give your final review ? deepseek addressed most of the issues if not all. |
|
Claude finished @edenreich's task in 3m 27s —— View job Final Review:
|
| Prior concern | Status |
|---|---|
🔴 gh release view not pinned → resolved from CWD git remote |
✅ --repo inference-gateway/cli pinned via const releaseRepo (release_notes.go:35,80) |
| 🔵 Context ignored / call not cancellable | ✅ fetchFn now takes ctx; exec.CommandContext(ctx, …) (:16,79,85) |
| 🔵 String matching for missing binary | ✅ errors.Is(err, exec.ErrNotFound) (:112) |
| 🔵 Default = latest release | ✅ Acknowledged as intended UX |
| (earlier round) CHANGELOG read from CWD, dead code, non-hermetic tests, docs | ✅ All resolved in prior commits |
The feature now works for the installed infer binary regardless of the current directory - which was the whole point of issue #518. go build ./..., go vet ./internal/shortcuts/, and all 14 release-notes tests pass locally.
🔵 Nits (non-blocking - optional polish, fine to merge as-is)
1. Redundant boolean operand in handleGHError (release_notes.go:104)
if strings.Contains(stderr, "not found") || strings.Contains(stderr, "release not found") {The second operand is dead: any string containing "release not found" already contains "not found", so the first check subsumes it. (It's also case-sensitive, so it wouldn't match a capitalized "Release not found" anyway - the first operand is what actually does the work.) This is the same class of redundant-check cleanup as the TrimPrefix one from round 1. Collapses to:
if strings.Contains(stderr, "not found") {2. TestReleaseRepoConst doesn't lock in the actual fix (release_notes_test.go:229)
The test asserts the const value equals "inference-gateway/cli", but nothing asserts that fetchReleaseNotesFromGH actually passes --repo <const> to gh. If someone dropped the --repo flag from the args slice but left the const, this test would still pass - so it doesn't guard against a regression of the very blocker it was added for. Extracting the arg list into a tiny helper (e.g. buildReleaseViewArgs(version) []string) and asserting it contains --repo inference-gateway/cli would actually lock it in. Minor - the const test is a reasonable proxy.
✅ Things done well
--repopinning makes the feature CWD-independent - the installed binary always showsinference-gateway/cli's releases.- Context threaded end-to-end; the
ghnetwork call is now cancellable viaexec.CommandContext. v-prefix handled symmetrically: stripped on input (:47), re-added for the tag lookup (:82), and stripped again fromTagNamefor display (:125) - consistent for this repo'sv-prefixed semantic-release tags.PublishedAt[:10]is length-guarded (:121);errors.As/errors.Isused idiomatically inhandleGHError.- Injectable
fetchFnkeeps theExecutetests hermetic - mirrors theCopyShortcutpattern.
Bottom line: This is a yes - the feature does what issue #518 asked, the prior blocker is fixed, and CI is green. The two nits above are cleanup you can fold in now or leave for a follow-up; neither blocks the merge. 🚀
· branch feat/release-notes-shortcut
## [0.122.0](v0.121.1...v0.122.0) (2026-06-20) ### 🚀 Features * **shortcuts:** add /release-notes shortcut to display changelog entries ([#634](#634)) ([4d0d0bf](4d0d0bf)), closes [#518](#518) * **explorer:** add snippet selection and annotation for targeted refactoring ([#637](#637)) ([7e619f9](7e619f9)), closes [#599](#599) * add wrap-up reminders for agent mode ([#628](#628)) ([#635](#635)) ([f5d95a5](f5d95a5)) * **skills:** scan .agents/skills as a third skill location ([#640](#640)) ([6e422b9](6e422b9)), closes [#639](#639) [#639](#639) ### ♻️ Code Refactoring * **pricing:** add MiniMax models and update subscription terminology ([8df84e7](8df84e7)) ### 🔧 Build System * **deps:** bump alpine from 3.24.0 to 3.24.1 in the docker group ([#630](#630)) ([4d2160e](4d2160e)) * **deps:** bump inference-gateway/.github/.github/workflows/infer.yml from 0.8.0 to 0.10.3 in the github-actions group across 1 directory ([#633](#633)) ([913304d](913304d)) * **deps:** bump the gomod group with 4 updates ([#629](#629)) ([b73f4d3](b73f4d3)) ### 👷 CI/CD * **infer:** centralize infer.yml + sync .infer config ([#638](#638)) ([86d0c18](86d0c18)) * **deps:** upgrade actions/checkout from v6.0.3 to v7.0.0 across workflows ([7befc6c](7befc6c)) ### 🧹 Maintenance * **deps:** bump claude-code 2.1.161 -> 2.1.170, claude-code-action v1.0.135 -> v1.0.142 ([#626](#626)) ([9edfb85](9edfb85)) * **deps:** bump claude-code 2.1.170 -> 2.1.177, claude-code-action v1.0.142 -> v1.0.150 ([#632](#632)) ([c81923f](c81923f)) * **deps:** bump claude-code-action v1.0.150 -> v1.0.152 ([#636](#636)) ([1d58889](1d58889)) * **deps:** bump infer CLI v0.121.0 -> v0.121.1, infer-action v0.12.1 -> v0.13.1 ([#627](#627)) ([c231a03](c231a03)) * bump schema version to 1.13.0 and update docker version to 29.5.2 ([287b1bb](287b1bb))
|
🎉 This PR is included in version 0.122.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Resolves #518
Summary
The agent's original PR description was incomplete, so this summary was generated from the commit history.
Changes
Files changed