Repository navigation
stops preview deployments from changes to gh-pages dir
#189
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 |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| /* Outside Next there is no request scope, so `connection` would throw. Whether a route prerenders is Next's to test. */ | ||
| export const connection = async (): Promise<void> => {}; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { afterEach, expect, it, vi } from "vitest"; | ||
| import { throttledFetch } from "@/lib/data"; | ||
|
|
||
| afterEach(() => { | ||
| vi.unstubAllGlobals(); | ||
| }); | ||
|
|
||
| it("caps requests in flight and retries a 429", async () => { | ||
| let inFlight = 0; | ||
| let peak = 0; | ||
| const seen = new Map<string, number>(); | ||
| vi.stubGlobal("fetch", async (url: string) => { | ||
| inFlight++; | ||
| peak = Math.max(peak, inFlight); | ||
| await new Promise((resolve) => setTimeout(resolve, 1)); | ||
| inFlight--; | ||
| const tries = (seen.get(url) ?? 0) + 1; | ||
| seen.set(url, tries); | ||
| // Every request is rate-limited once, as GitHub Pages does under a burst. | ||
| return tries === 1 | ||
| ? new Response(null, { status: 429, headers: { "retry-after": "0" } }) | ||
| : new Response("{}", { status: 200 }); | ||
| }); | ||
|
|
||
| const responses = await Promise.all( | ||
| Array.from({ length: 50 }, (_, i) => throttledFetch(`https://x/${i}.json`)), | ||
| ); | ||
|
|
||
| expect(responses.every((r) => r.status === 200)).toBe(true); | ||
| expect(peak).toBeLessThanOrEqual(12); | ||
| expect([...seen.values()].every((n) => n === 2)).toBe(true); | ||
| }); |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,10 @@ | ||||||
| { | ||||||
| "$schema": "https://openapi.vercel.sh/vercel.json", | ||||||
| "buildCommand": "vlr build", | ||||||
| "installCommand": "echo $PWD && npm install vlt@latest --force --prefix=/vlt/ --install-strategy=nested --no-save && vlt --version && vlt ci", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: set -eu
printf '%s\n' '--- apps/www/vercel.json ---'
nl -ba apps/www/vercel.json
printf '%s\n' '--- PR diff ---'
git diff --no-ext-diff --unified=80 6c9aca524bbd61682a4d1e28221675ea36d31e09 7a9ae042363f65c68594426302e2bf52162795c6 -- apps/www/vercel.json
printf '%s\n' '--- relevant package metadata ---'
rg -n -F --glob 'package.json' -e '"name"' -e '"packageManager"' -e '"engines"' -e '"vlt"' -e '"bin"' apps/www package.json . 2>/dev/null | head -200 || true
printf '%s\n' '--- Vercel-related repository files ---'
rg --files -g '*vercel*' -g '*.md' . | head -200Repository: vltpkg/benchmarks Length of output: 21911 Make the installed The command installs Suggested fix--- "a/apps/www/vercel.json"
+++ "b/apps/www/vercel.json"
@@ -1,7 +1,7 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"buildCommand": "vlr build",
- "installCommand": "echo $PWD && npm install vlt@latest --force --prefix=/vlt/ --install-strategy=nested --no-save && vlt --version && vlt ci",
+ "installCommand": "echo $PWD && npm install vlt@latest --force --prefix=/vlt/ --install-strategy=nested --no-save && export PATH=/vlt/node_modules/.bin:$PATH && vlt --version && vlt ci",
"git": {
"deploymentEnabled": {
"gh-pages": false📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| "git": { | ||||||
| "deploymentEnabled": { | ||||||
| "gh-pages": false | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
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.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Parse HTTP-date
Retry-Aftervalues.Retry-Aftercan contain delay seconds or an HTTP date.Number(...)converts an HTTP date toNaN, so this code retries after the short fallback delay instead of the server-specified time. The retry budget can then exhaust and makecachedGetthrow on a final 429 response.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents