Skip to content

Commit 7d24c32

Browse files
authored
v1.8.2
v1.8.2 — rate-limit auto-retry + release workflow improvements
2 parents c1f40c9 + e115121 commit 7d24c32

File tree

9 files changed

+159
-13
lines changed

9 files changed

+159
-13
lines changed

.github/instructions/bug-fixing.instructions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Add a one-line comment above the fix if the root cause is non-obvious:
9292
Once the PR is merged into `main`, publish a **patch** release:
9393

9494
```bash
95-
bun pm version patch # bumps package.json: 1.2.4 → 1.2.5
95+
sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json # bump directly — do NOT use bun pm version
9696
git checkout -b release/$(jq -r .version package.json)
9797
git add package.json
9898
git commit -S -m "v$(jq -r .version package.json)"
@@ -101,4 +101,6 @@ git push origin release/$(jq -r .version package.json) --tags
101101
```
102102

103103
The tag push triggers `cd.yaml` which builds all-platform binaries and creates the GitHub Release automatically.
104+
105+
For the blog post (optional for patch, but encouraged): **ask the user interactively** for the highlights and description before writing `docs/blog/release-v<X-Y-Z>.md`.
104106
See the full release guide in `AGENTS.md § Release process`.

.github/instructions/implement-feature.instructions.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,8 @@ bun run build.ts # binary compiles without errors
7777
Once the PR is merged into `main`, publish a **minor** (new feature) or **major** (breaking change) release:
7878

7979
```bash
80-
bun pm version minor # new feature: 1.2.4 → 1.3.0
81-
# or
82-
bun pm version major # breaking change: 1.2.4 → 2.0.0
83-
80+
sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json # bump directly — do NOT use bun pm version
81+
# X.Y.Z: new feature → 1.2.4 → 1.3.0 | breaking change → 1.2.4 → 2.0.0
8482
git checkout -b release/$(jq -r .version package.json)
8583
git add package.json
8684
git commit -S -m "v$(jq -r .version package.json)"
@@ -90,7 +88,7 @@ git push origin release/$(jq -r .version package.json) --tags
9088

9189
The tag push triggers `cd.yaml` which builds all-platform binaries and creates the GitHub Release automatically.
9290

93-
For **minor and major releases**, also write the blog post **before pushing the tag**:
91+
For **minor and major releases**, a blog post is **required****ask the user interactively** for the highlights and description before writing `docs/blog/release-v<X-Y-Z>.md`. Do not draft it from code alone.
9492

9593
- Create `docs/blog/release-v<X-Y-Z>.md` with feature highlights
9694
- Add a row in `docs/blog/index.md`

.github/instructions/release.instructions.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,39 @@ This project follows [Semantic Versioning](https://semver.org/):
2121

2222
## 2. Bump the version
2323

24+
Edit `package.json` directly — **do not use `bun pm version`**.
25+
26+
> `bun pm version` automatically creates a git commit _and_ a git tag in one shot,
27+
> which conflicts with the release workflow (tag must land on the release branch,
28+
> not on the current branch, and only after the blog post / CHANGELOG are ready).
29+
> Undoing that auto-tag with `git tag -d` and `git push --delete` is error-prone.
30+
2431
```bash
25-
bun pm version patch # or minor / major
32+
# Option A — in-place sed (reliable, no interactive editor needed)
33+
sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json
34+
35+
# Option B — edit package.json manually, change the "version" field
2636
```
2737

28-
If the working tree is dirty (staged or unstaged changes), `bun pm version` will refuse. In that case bump directly in `package.json`, then commit the version bump as the first commit on the release branch.
38+
Verify the bump before committing:
39+
40+
```bash
41+
jq -r .version package.json # should print X.Y.Z
42+
```
2943

3044
## 3. Write the blog post
3145

3246
**Required for minor and major releases. Optional (but encouraged) for patch releases.**
3347

48+
> **Ask the user interactively before writing.** Do not invent highlights or
49+
> descriptions. Before drafting the post, ask the user:
50+
>
51+
> - Which changes should be highlighted?
52+
> - Is there a one-line description for the front-matter?
53+
> - Any before/after examples or screenshots to include?
54+
>
55+
> Only proceed to write the file once you have the user's input.
56+
3457
1. Create `docs/blog/release-v<X-Y-Z>.md` — use existing posts as format reference:
3558
- `docs/blog/release-v1-3-0.md` (minor, feature-focused)
3659
- `docs/blog/release-v1-4-0.md` (minor, TUI/community-focused)

.github/skills/release.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,34 @@ This skill complements `.github/instructions/release.instructions.md`.
55

66
---
77

8+
## Version bump — important note
9+
10+
**Never use `bun pm version patch/minor/major` to bump the version.**
11+
12+
Unlike `npm version`, Bun's implementation creates both a git commit _and_ a git
13+
tag in a single operation. This is incompatible with the release workflow:
14+
15+
- The tag must land on the dedicated `release/X.Y.Z` branch, not on `main`.
16+
- The blog post and `CHANGELOG.md` must be committed _before_ the version tag is
17+
pushed (the CD pipeline reads the tag to build binaries and name the release).
18+
- Undoing an unwanted auto-tag requires `git tag -d vX.Y.Z` locally and
19+
`git push origin --delete vX.Y.Z` on the remote — easy to forget one of the
20+
two, which can trigger the CD pipeline prematurely.
21+
22+
**Correct approach:**
23+
24+
```bash
25+
# Bump directly in package.json
26+
sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json
27+
28+
# Verify
29+
jq -r .version package.json
30+
```
31+
32+
The git commit and tag are created separately in steps 4 and 5.
33+
34+
---
35+
836
## Semver decision guide
937

1038
| Change type | Bump | Example |
@@ -57,6 +85,16 @@ Pushing `vX.Y.Z` triggers the release pipeline automatically:
5785

5886
Required for **minor** and **major** releases. Optional for patch (GitHub Release body is sufficient for patch).
5987

88+
> **Always ask the user interactively before writing the blog post.**
89+
> Do not invent highlights, descriptions or examples from code alone.
90+
> Ask at minimum:
91+
>
92+
> - Which changes deserve a `###` section and why?
93+
> - Suggested one-line `description` for the front-matter.
94+
> - Any before/after CLI output or screenshots to illustrate?
95+
>
96+
> Then draft the post and show it to the user for approval before committing.
97+
6098
**Front-matter:**
6199

62100
```yaml

AGENTS.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,11 @@ This project follows [Semantic Versioning](https://semver.org/):
177177
### Step-by-step
178178

179179
```bash
180-
# 1. Bump the version in package.json (pick one)
181-
bun pm version patch # bug fix
182-
bun pm version minor # new feature
183-
bun pm version major # breaking change
180+
# 1. Bump the version in package.json directly
181+
# Do NOT use `bun pm version` — it creates a git commit AND a git tag
182+
# automatically, which conflicts with the release workflow below.
183+
sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json
184+
jq -r .version package.json # verify
184185

185186
# 2. Create the release branch and commit
186187
git checkout -b release/$(jq -r .version package.json)
@@ -215,6 +216,15 @@ Pushing a **major** tag (`vX.0.0`) additionally triggers **`docs.yml` → snapsh
215216

216217
### Blog post requirement
217218

219+
> **Always ask the user interactively before writing the blog post.**
220+
> Do not invent highlights or descriptions from code alone. Ask at minimum:
221+
>
222+
> - Which changes should be highlighted?
223+
> - Is there a one-line description for the front-matter?
224+
> - Any before/after CLI output examples to include?
225+
>
226+
> Only proceed to write `docs/blog/release-v<X-Y-Z>.md` once you have the user's input.
227+
218228
| Release type | Blog post | Location |
219229
| ------------ | ----------------------------------------------------------- | --------------------------------- |
220230
| **Major** | Required (written by hand — CI stub automates the skeleton) | `docs/blog/release-vX-0-0.md` |

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Each release entry covers the motivation, new features, breaking changes (if any
66

77
| Version | Blog post |
88
| ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
9+
| [v1.8.2](https://fulll.github.io/github-code-search/blog/release-v1-8-2) | Fix rate-limit errors aborting multi-page searches; auto-wait and retry with live progress |
910
| [v1.8.1](https://fulll.github.io/github-code-search/blog/release-v1-8-1) | Fix silent hang after pagination bar — concurrency cap + progress bar for line-number resolution |
1011
| [v1.8.0](https://fulll.github.io/github-code-search/blog/release-v1-8-0) | Purple TUI theme, fetch progress bar, position indicator, line-anchored file links, Esc to close help |
1112
| [v1.7.0](https://fulll.github.io/github-code-search/blog/release-v1-7-0) | Shell completions (bash/zsh/fish) + extended syntax highlighting (PHP, C/C++, Swift, Terraform/HCL, Dockerfile) |

docs/blog/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Full release notes and changelogs are always available on
1111

1212
| Release | Highlights |
1313
| -------------------------- | ---------------------------------------------------------------------------------------------------------- |
14+
| [v1.8.2](./release-v1-8-2) | Fix rate-limit errors aborting multi-page searches — auto-wait and resume with live feedback |
1415
| [v1.8.1](./release-v1-8-1) | Fix silent hang after pagination bar — concurrency cap + progress bar for line-number resolution |
1516
| [v1.8.0](./release-v1-8-0) | Purple TUI theme, fetch progress bar, position indicator, line-anchored file links, Esc to close help |
1617
| [v1.7.0](./release-v1-7-0) | Shell completions (bash/zsh/fish), extended syntax highlighting (PHP, C/C++, Swift, Terraform, Dockerfile) |

docs/blog/release-v1-8-2.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: "What's new in v1.8.2"
3+
description: "Bug fix: multi-page searches no longer abort when GitHub rate-limits mid-pagination — the CLI now waits and resumes automatically."
4+
date: 2026-03-09
5+
---
6+
7+
# What's new in github-code-search v1.8.2
8+
9+
> Full release notes: <https://github.com/fulll/github-code-search/releases/tag/v1.8.2>
10+
11+
## Highlights
12+
13+
### Fix: multi-page searches aborted by rate limits now auto-resume
14+
15+
When searching across a large organisation with many results (close to the
16+
GitHub 1 000-result cap), the CLI could crash mid-way through pagination with:
17+
18+
```
19+
Fetching results from GitHub… ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░ page 9/10
20+
error: GitHub API rate limit exceeded. Please retry in 53 seconds.
21+
```
22+
23+
The search was lost at ~90 % completion and had to be restarted from scratch.
24+
25+
#### Root causes (three compounding issues)
26+
27+
**1. Long rate-limit waits threw immediately.**
28+
When `x-ratelimit-reset` indicated a wait longer than 10 seconds,
29+
`fetchWithRetry` threw an error instead of waiting. The pagination loop
30+
propagated this exception and discarded all pages already fetched.
31+
32+
**2. Secondary rate limits were not recognised.**
33+
GitHub secondary rate limits return `403 + Retry-After` (without
34+
`x-ratelimit-remaining: 0`). This pattern bypassed the retry logic entirely
35+
and surfaced as an unhandled API error.
36+
37+
**3. 422 error when results hit exactly 1 000.**
38+
When `total_count` was an exact multiple of 100 (e.g. 1 000 results across 10
39+
full pages), the pagination loop attempted a page 11. GitHub rejects this with
40+
`422 Cannot access beyond the first 1000 results`.
41+
42+
#### What changed
43+
44+
- **Auto-wait with visible feedback.** When a rate-limit response is received
45+
during pagination, the CLI now prints a message, waits for the exact duration
46+
indicated by GitHub (`x-ratelimit-reset` or `Retry-After` + 1 s clock-skew
47+
buffer), and resumes automatically — no retry counting, no data lost:
48+
49+
```
50+
Fetching results from GitHub… ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░ page 9/10
51+
Rate limited — waiting 53 seconds, resuming automatically…
52+
Fetching results from GitHub… ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ page 10/10
53+
```
54+
55+
- **Secondary rate limit detection.** Any `403 + Retry-After` response is now
56+
treated as a retriable rate-limit condition.
57+
58+
- **Page 11 guard.** `fetchAllResults` now short-circuits before requesting
59+
a page beyond `totalPages`, preventing the 422 error at the cap.
60+
61+
**Before:** error at page 9, search lost.
62+
**After:** transparent pause, TUI opens with all 1 000 results.
63+
64+
---
65+
66+
## Upgrade
67+
68+
```bash
69+
github-code-search upgrade
70+
```
71+
72+
Or download the latest binary directly from the
73+
[GitHub Releases page](https://github.com/fulll/github-code-search/releases/tag/v1.8.2).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-code-search",
3-
"version": "1.8.1",
3+
"version": "1.8.2",
44
"description": "Interactive GitHub code search with per-repo aggregation",
55
"keywords": [
66
"bun",

0 commit comments

Comments
 (0)