-
Notifications
You must be signed in to change notification settings - Fork 1
v1.8.2 — rate-limit auto-retry + release workflow improvements #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -77,10 +77,8 @@ bun run build.ts # binary compiles without errors | |||||
| Once the PR is merged into `main`, publish a **minor** (new feature) or **major** (breaking change) release: | ||||||
|
|
||||||
| ```bash | ||||||
| bun pm version minor # new feature: 1.2.4 → 1.3.0 | ||||||
| # or | ||||||
| bun pm version major # breaking change: 1.2.4 → 2.0.0 | ||||||
|
|
||||||
| sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json # bump directly — do NOT use bun pm version | ||||||
|
||||||
| sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json # bump directly — do NOT use bun pm version | |
| jq '.version = "X.Y.Z"' package.json > package.tmp.json && mv package.tmp.json package.json # bump directly — do NOT use bun pm version |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -21,16 +21,39 @@ This project follows [Semantic Versioning](https://semver.org/): | |||||||||||||||
|
|
||||||||||||||||
| ## 2. Bump the version | ||||||||||||||||
|
|
||||||||||||||||
| Edit `package.json` directly — **do not use `bun pm version`**. | ||||||||||||||||
|
|
||||||||||||||||
| > `bun pm version` automatically creates a git commit _and_ a git tag in one shot, | ||||||||||||||||
| > which conflicts with the release workflow (tag must land on the release branch, | ||||||||||||||||
| > not on the current branch, and only after the blog post / CHANGELOG are ready). | ||||||||||||||||
| > Undoing that auto-tag with `git tag -d` and `git push --delete` is error-prone. | ||||||||||||||||
|
|
||||||||||||||||
| ```bash | ||||||||||||||||
| bun pm version patch # or minor / major | ||||||||||||||||
| # Option A — in-place sed (reliable, no interactive editor needed) | ||||||||||||||||
| sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json | ||||||||||||||||
|
Comment on lines
+32
to
+33
|
||||||||||||||||
| # Option A — in-place sed (reliable, no interactive editor needed) | |
| sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json | |
| # Option A — non-interactive sed (no editor needed) | |
| # macOS / BSD sed: | |
| sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json | |
| # GNU sed (Linux): | |
| sed -i 's/"version": ".*"/"version": "X.Y.Z"/' package.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,34 @@ This skill complements `.github/instructions/release.instructions.md`. | |
|
|
||
| --- | ||
|
|
||
| ## Version bump — important note | ||
|
|
||
| **Never use `bun pm version patch/minor/major` to bump the version.** | ||
|
|
||
| Unlike `npm version`, Bun's implementation creates both a git commit _and_ a git | ||
| tag in a single operation. This is incompatible with the release workflow: | ||
|
|
||
| - The tag must land on the dedicated `release/X.Y.Z` branch, not on `main`. | ||
| - The blog post and `CHANGELOG.md` must be committed _before_ the version tag is | ||
| pushed (the CD pipeline reads the tag to build binaries and name the release). | ||
| - Undoing an unwanted auto-tag requires `git tag -d vX.Y.Z` locally and | ||
| `git push origin --delete vX.Y.Z` on the remote — easy to forget one of the | ||
| two, which can trigger the CD pipeline prematurely. | ||
|
|
||
| **Correct approach:** | ||
|
|
||
| ```bash | ||
| # Bump directly in package.json | ||
| sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json | ||
|
|
||
| # Verify | ||
| jq -r .version package.json | ||
| ``` | ||
|
Comment on lines
+24
to
+30
|
||
|
|
||
| The git commit and tag are created separately in steps 4 and 5. | ||
|
|
||
| --- | ||
|
|
||
| ## Semver decision guide | ||
|
|
||
| | Change type | Bump | Example | | ||
|
|
@@ -57,6 +85,16 @@ Pushing `vX.Y.Z` triggers the release pipeline automatically: | |
|
|
||
| Required for **minor** and **major** releases. Optional for patch (GitHub Release body is sufficient for patch). | ||
|
|
||
| > **Always ask the user interactively before writing the blog post.** | ||
| > Do not invent highlights, descriptions or examples from code alone. | ||
| > Ask at minimum: | ||
| > | ||
| > - Which changes deserve a `###` section and why? | ||
| > - Suggested one-line `description` for the front-matter. | ||
| > - Any before/after CLI output or screenshots to illustrate? | ||
| > | ||
| > Then draft the post and show it to the user for approval before committing. | ||
|
|
||
| **Front-matter:** | ||
|
|
||
| ```yaml | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -177,10 +177,11 @@ This project follows [Semantic Versioning](https://semver.org/): | |||||||||||||||
| ### Step-by-step | ||||||||||||||||
|
|
||||||||||||||||
| ```bash | ||||||||||||||||
| # 1. Bump the version in package.json (pick one) | ||||||||||||||||
| bun pm version patch # bug fix | ||||||||||||||||
| bun pm version minor # new feature | ||||||||||||||||
| bun pm version major # breaking change | ||||||||||||||||
| # 1. Bump the version in package.json directly | ||||||||||||||||
| # Do NOT use `bun pm version` — it creates a git commit AND a git tag | ||||||||||||||||
| # automatically, which conflicts with the release workflow below. | ||||||||||||||||
| sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json | ||||||||||||||||
|
Comment on lines
+182
to
+183
|
||||||||||||||||
| # automatically, which conflicts with the release workflow below. | |
| sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json | |
| # automatically, which conflicts with the release workflow below. | |
| # macOS (BSD sed) | |
| sed -i '' 's/"version": ".*"/"version": "X.Y.Z"/' package.json | |
| # Linux (GNU sed) | |
| sed -i 's/"version": ".*"/"version": "X.Y.Z"/' package.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --- | ||
| title: "What's new in v1.8.2" | ||
| description: "Bug fix: multi-page searches no longer abort when GitHub rate-limits mid-pagination — the CLI now waits and resumes automatically." | ||
| date: 2026-03-09 | ||
| --- | ||
|
|
||
| # What's new in github-code-search v1.8.2 | ||
|
|
||
| > Full release notes: <https://github.com/fulll/github-code-search/releases/tag/v1.8.2> | ||
|
|
||
| ## Highlights | ||
|
|
||
| ### Fix: multi-page searches aborted by rate limits now auto-resume | ||
|
|
||
| When searching across a large organisation with many results (close to the | ||
| GitHub 1 000-result cap), the CLI could crash mid-way through pagination with: | ||
|
|
||
| ``` | ||
| Fetching results from GitHub… ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░ page 9/10 | ||
| error: GitHub API rate limit exceeded. Please retry in 53 seconds. | ||
| ``` | ||
|
Comment on lines
+18
to
+21
|
||
|
|
||
| The search was lost at ~90 % completion and had to be restarted from scratch. | ||
|
|
||
| #### Root causes (three compounding issues) | ||
|
|
||
| **1. Long rate-limit waits threw immediately.** | ||
| When `x-ratelimit-reset` indicated a wait longer than 10 seconds, | ||
| `fetchWithRetry` threw an error instead of waiting. The pagination loop | ||
| propagated this exception and discarded all pages already fetched. | ||
|
|
||
| **2. Secondary rate limits were not recognised.** | ||
| GitHub secondary rate limits return `403 + Retry-After` (without | ||
| `x-ratelimit-remaining: 0`). This pattern bypassed the retry logic entirely | ||
| and surfaced as an unhandled API error. | ||
|
|
||
| **3. 422 error when results hit exactly 1 000.** | ||
| When `total_count` was an exact multiple of 100 (e.g. 1 000 results across 10 | ||
| full pages), the pagination loop attempted a page 11. GitHub rejects this with | ||
| `422 Cannot access beyond the first 1000 results`. | ||
|
|
||
| #### What changed | ||
|
|
||
| - **Auto-wait with visible feedback.** When a rate-limit response is received | ||
| during pagination, the CLI now prints a message, waits for the exact duration | ||
| indicated by GitHub (`x-ratelimit-reset` or `Retry-After` + 1 s clock-skew | ||
| buffer), and resumes automatically — no retry counting, no data lost: | ||
|
Comment on lines
+44
to
+47
|
||
|
|
||
| ``` | ||
| Fetching results from GitHub… ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░ page 9/10 | ||
| Rate limited — waiting 53 seconds, resuming automatically… | ||
| Fetching results from GitHub… ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ page 10/10 | ||
| ``` | ||
|
Comment on lines
+49
to
+53
|
||
|
|
||
| - **Secondary rate limit detection.** Any `403 + Retry-After` response is now | ||
| treated as a retriable rate-limit condition. | ||
|
|
||
| - **Page 11 guard.** `fetchAllResults` now short-circuits before requesting | ||
| a page beyond `totalPages`, preventing the 422 error at the cap. | ||
|
|
||
| **Before:** error at page 9, search lost. | ||
| **After:** transparent pause, TUI opens with all 1 000 results. | ||
|
|
||
| --- | ||
|
|
||
| ## Upgrade | ||
|
|
||
| ```bash | ||
| github-code-search upgrade | ||
| ``` | ||
|
|
||
| Or download the latest binary directly from the | ||
| [GitHub Releases page](https://github.com/fulll/github-code-search/releases/tag/v1.8.2). | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "github-code-search", | ||
| "version": "1.8.1", | ||
| "version": "1.8.2", | ||
|
||
| "description": "Interactive GitHub code search with per-repo aggregation", | ||
| "keywords": [ | ||
| "bun", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The release command uses
sed -i '', which is BSD/macOS-specific and can fail on GNU sed. Please provide a portable alternative or separate commands for macOS vs Linux.