GitHub API polish and early Studio UI improvements#3
Conversation
| } | ||
|
|
||
| if (status === 404) { | ||
| if (/repository.*not found/i.test(message) || /not found.*repository/i.test(message)) { |
| } | ||
|
|
||
| if (status === 404) { | ||
| if (/repository.*not found/i.test(message) || /not found.*repository/i.test(message)) { |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d9e04dcfa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const validationError = validateGitHubFileBody(body); | ||
| if (validationError !== null) { | ||
| return localError(validationError, operation, config, { path }, response.status); |
There was a problem hiding this comment.
Avoid requiring inline content when only checking sha
When updating an existing file larger than 1 MB, GitHub’s Contents API can return the file metadata and sha while leaving content empty with a non-base64 encoding; this preflight only needs the sha for the later PUT, but validateGitHubFileBody now rejects that response before publishFile can update the file. This means any post/media path that already exists and is over the inline-content threshold becomes unpublishable even though the update endpoint can still use the returned sha.
Useful? React with 👍 / 👎.
|
Closing retroactive split-stack review PR. Continuing from protected main with scoped feature PRs. |
PR 2 of 11. GitHub Contents API error polish and writer-first Studio UI.