-
Notifications
You must be signed in to change notification settings - Fork 67
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
[BUG]: (possibly) discrepancy between updateRef
docs and implementation
#339
Comments
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with |
There could be a bug in how we pass in the data parameters. That would be in the underlying modules We don't have any special implementation on our side, we just simply wrap a request to the API. |
The generated code has inconsistency between
This difference should be caused by request body V.S. path ( I assume Octokit cannot change this behavior in the all 2.x releases because changing this makes breaking change. |
I think the inconsistency is in how the REST API is defined in the OpenAPI spec: https://github.com/github/rest-api-description/ See the docs, which is generated from the same OpenAPI spec
You can see how that makes sense from the REST API design perspective. But when using named methods with Octokit it's confusing. I don't know what thy |
What happened?
Summary
Calling
updateRef
and passing aref
value of the formrefs/tags/foo/v1.2.3
results in a "ref doesn't exist" error. (it does exist)Passing a
ref
property of the formtags/foo/v1.2.3
does however work - but shouldn't since it doesn't start withrefs
Details
From the docs:
From the plugin-rest-endpoint-methods.js repo:
Why it might be a bug
updateRef
(viagithub-script@v6
) with aref
property of the formrefs/tags/foo/v1.2.3
Analysis
Upon inspection of the error, I noticed the underlying endpoint url contained
refs/refs/tags/...
ref
property in the call to exclude therefs/
prefix (ie.tags/foo/v1.2.3
instead ofrefs/tags/foo/v1.2.3
)refs
and doesn't contain at least two slashestags/foo/v1.2.3
updatedrefs/tags/foo/v1.2.3
Things which may (or may not!) be involved in fixing
Presumedly one of the following:
refs/
prefixrefs/
prefix if present (probably not great, though potentially less potentially breaking than(2)
and more consistent than(1)
And if going with
(2)
or(3)
, presumedly:updateRef
to reject refs which don't start withrefs
Versions
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: