Repository navigation
Conversation
This used to be needed to get _some_ information back, but now it no longer works: "return_run_details" is not an object Seems that the newest API version silently dropped this flag. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
8a730bf to
c068ec7
Compare
|
Funnily enough, this slash command worked... even before merging this PR... |
We just got surprised with a failure due to an update in the API version: When triggering workflows, the `return_run_details` flag, which used to be required, now triggers an error. Let's avoid getting such nasty surprises by specifying which API version we target. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
c068ec7 to
36fbbff
Compare
| body, | ||
| { | ||
| Authorization: `Bearer ${token}`, | ||
| 'X-GitHub-Api-Version': '2026-03-10', |
There was a problem hiding this comment.
I know this is only used in two places but could it be environment controlled? An env var could set the supported api version without a code change. Would that require more changes when a level set is needed?
Since the api change has been addressed, is version locking needed? Should we wait for the next break given the api usage is so basic?
There was a problem hiding this comment.
I don't think it would be a good idea to have this controlled by the environment because any API version change will require code changes. For example, the return_run_details attribute to trigger workflow dispatches. That is no longer supported by this new API version. So if we just allow the API version to be overridden, the code might have wrong assumptions about what it can and cannot do.
|
I think I misinterpreted the situation that was fixed by the corresponding PR. I thought the API had changed, but what is much more likely based on my recent understanding is that we sent an incomplete request that wasn't even correct JSON. On GitHub's side it did not reject that as invalid JSON, but still tried to interpret the truncated value, which was no longer Here is the actual fix for that recent problem, which I plan on porting to GitGitGadget, too: |
Workflow-dispatch inputs can contain non-ASCII text. JSON containing such text may require more UTF-8 bytes than its JavaScript string length. Understating Content-Length can leave GitHub with incomplete JSON, which the API can reject. Git for Windows Automation previously fixed the same problem: git-for-windows/git-for-windows-automation@8ca6bfd Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
And I added a corresponding fix to this PR. |
A non-ASCII workflow input can make `Content-Length` smaller than the UTF-8 request body and leave GitHub with truncated JSON. This follows up the merged changes (with the _actual_ fix for the bug) in #267 and matches gitgitgadget/gitgitgadget-github-app#13.
I just tried to trigger a workflow in a sister GitHub App, and it failed.
Turns out that the API advanced in a way that is incompatible with what we started using. Let's fix that, and while at it, no longer just use the latest API version but instead pin it.
This is a companion of git-for-windows/gfw-helper-github-app#267.