-
Notifications
You must be signed in to change notification settings - Fork 70
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: use_commit_name
option
#213
base: master
Are you sure you want to change the base?
Conversation
a ` : ` (space, colon, space) like that can be confused for a definition list classifier, especially in a definition list, so prefer to backslash-escape the colon. see the "reStructedText Markup Specification", section "Syntax Details" > "Body Elements" > "Definition Lists".
the `asyncio_mode` of `legacy` (current default) is deprecated. `asyncio_mode` will be `strict` by default in the future.
there is currently not GraphQL API equivalent to the REST API's `/repos/{owner}/{repo}/commits/{ref}` endpoint.
elif isinstance(x, dict): | ||
return tuple(sorted((_normalize(k), _normalize(v)) for k, v in x.items())) | ||
else: | ||
return x |
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.
It's not obvious what this function does. It needs a docstring or a better name.
_, url, headers = key | ||
res = await session.get(url, headers=dict(headers)) | ||
_, url, headers, json = key | ||
json = extra # denormalizing json would be a pain, so we sneak it through |
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.
What about passing json as a str
or bytes
? We can set the Content-Type
header and directly pass it to session
as body
@@ -393,6 +393,12 @@ use_latest_tag | |||
|
|||
This requires a token because it's using the v4 GraphQL API. | |||
|
|||
use_commit_name |
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.
What about use_commit_hash
? It's not obvious what a commit name is.
I would like to use
nvchecker
to pin check for new Git commits ongithub
without using thegit
source; this solves that problem. TheVER+HASH
syntax is compatible with Semantic Versioning, for whatever that's worth.Also, wider use of the GraphQL API when possible; it's a bit faster than the REST API and I had to use it more for comprehensive
use_commit_name
support.nvchecker.util.AsyncCache.get_json()
now knows how to send POST requests when ajson
body parameter is provided; this makes using the GraphQL API more innvchecker_sources.github
easier and more aligned with REST API.I'm not in love with the
list_count
option, but I didn't want to break backwards compatibility and I didn't want to be stuck fetching up to approximately 99 commits I don't need if I useuse_max_tag
in the future. A good way to handle this might be issuing a deprecation notice whenlist_count
isn't specified along withuse_max_tag
in the future, and then removing thelist_count = 100
default so it can be1
like everywhere else. Talking about other uses oflist_count
, there is flexibility to makeuse_latest_tag
support list options; I did not expose this functionality in this patch set and it still returns a scalarstr
for now.See the individual commit diffs for a smoother progression that doesn't change basically all of
nvchecker_sources.github
at once.Based off #212 because I made sure each commit in this set passed tests.