Skip to content

Improve GitHub API diagnostics for project creation failures#441

Open
saracarl wants to merge 1 commit into
developfrom
codex/debug-avannotate-project-creation-failure
Open

Improve GitHub API diagnostics for project creation failures#441
saracarl wants to merge 1 commit into
developfrom
codex/debug-avannotate-project-creation-failure

Conversation

@saracarl

Copy link
Copy Markdown

Motivation

  • Creating repositories from the shared template was producing opaque 500 errors for enterprise-managed users, making it hard to diagnose whether the issue was token scope, enterprise policy, or template-generation failures.
  • We need richer server-side diagnostics (request ids, scopes, rate-limit info, and parsed response payloads) to correlate with GitHub support and to tell permission problems from true server errors.

Description

  • Add a reusable logGitHubErrorResponse helper in the project-creation API route (src/pages/api/projects/[projectName]/index.ts) that logs status, x-github-request-id/x-request-id, x-ratelimit-remaining, OAuth scopes, and a safely-parsed response body (JSON or text).
  • Use the helper for the critical failure points: repo-create-from-template, pages-enable, and topics-replace, so POST/PATCH failures emit actionable logs.
  • Return the upstream GitHub HTTP status (or fallback to 500) and preserve statusText for these failure responses instead of always coercing to 500.
  • The change makes it easier to trace enterprise-specific failures and shows where additional logging (for example in src/lib/GitHub/index.ts before fetch) would be helpful.

Testing

  • Ran npm run build (which runs astro check && astro build) and the build completed successfully with TypeScript warnings only.
  • Verified the modified file is type-checking as part of the build step and the server bundle was produced successfully.

Codex Task

@netlify

netlify Bot commented Jun 30, 2026

Copy link
Copy Markdown

Deploy Preview for avannotate-staging ready!

Name Link
🔨 Latest commit 97ab509
🔍 Latest deploy log https://app.netlify.com/projects/avannotate-staging/deploys/6a43e5a2d72bef000843419b
😎 Deploy Preview https://deploy-preview-441--avannotate-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant