-
Notifications
You must be signed in to change notification settings - Fork 34
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
GitHub upload using GraphQL #882
Conversation
🦋 Changeset detectedLatest commit: 4104f25 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
👍
src/api/github/push.ts
Outdated
contents: await fs.readFile(filePath, { | ||
encoding: 'base64', | ||
}), |
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.
Is there a request size limit that we need to be aware of here? In that scenario, does GitHub provide an option to upload files separately? (I'm hoping we can avoid this complexity, but just thinking out loud.)
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.
None that they publicly say. Does not look like there's an option to upload files separately unless you want to use their REST API which requires about 3 different API calls to make a commit :\
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.
Sorry for the 🐌 review! Mostly doco nitpicks that I'll apply in a sec.
docs/development-api/github.md
Outdated
@@ -119,5 +165,23 @@ await GitHub.putIssueComment({ | |||
|
|||
--- | |||
|
|||
## mapChangedFilesToFileChanges |
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.
Given this is an I/O operation, I wonder if the verb should here be read
or load
?
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.
Yeah I think that makes sense, when I first started this I thought it was going to be a simple map.
docs/development-api/github.md
Outdated
|
||
These file changes will appear as verified commits on GitHub. | ||
|
||
Please note: this will not update the local Git repository |
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.
Please note: this will not update the local Git repository | |
This function is roughly equivalent to `git push`, | |
but it will not update the local Git repository. |
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.
I would suggest it's not similar since push would push commits and this would not?
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.
Perhaps maybe avoiding push
might be wise? Would upload
make more sense?
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.
Ah yes, I clearly wrote the wrong thing here. Will revert 🙇
Co-authored-by: Sam Chung <[email protected]>
Adds new methods to use the GitHub GraphQL API to push code. This signs our commits which resolves #684
Each call seems to consume only 1 point per call out of our 5000 points/hour quota.