juliaweb / github.jl Goto Github PK
View Code? Open in Web Editor NEWA Julia package for interfacing with GitHub
License: MIT License
A Julia package for interfacing with GitHub
License: MIT License
The tag name "2.2.0" is not of the appropriate SemVer form (vX.Y.Z).
cc: @jrevels
I noticed this was removed (breaking the PkgEval website code), but I wasn't sure what the logic was
PackageEvaluator.jl is a script that runs nightly. It attempts to load all Julia packages and run their tests (if available) on both the stable version of Julia (0.3) and the nightly build of the unstable version (0.4). The results of this script are used to generate a package listing enhanced with testing results.
Tests pass.
Package doesn't load.
Tests pass.
means that PackageEvaluator found the tests for your package, executed them, and they all passed.
Package doesn't load.
means that PackageEvaluator did not find tests for your package. Additionally, trying to load your package with using
failed.
This issue was filed because your testing status became worse. No additional issues will be filed if your package remains in this state, and no issue will be filed if it improves. If you'd like to opt-out of these status-change messages, reply to this message saying you'd like to and @IainNZ will add an exception. If you'd like to discuss PackageEvaluator.jl please file an issue at the repository. For example, your package may be untestable on the test machine due to a dependency - an exception can be added.
Test log:
>>> 'Pkg.add("GitHub")' log
INFO: Cloning cache of GitHub from git://github.com/WestleyArgentum/GitHub.jl.git
INFO: Installing BinDeps v0.3.0
INFO: Installing Calendar v0.4.2
INFO: Installing Codecs v0.1.2
INFO: Installing FactCheck v0.1.2
INFO: Installing GitHub v0.0.4
INFO: Installing GnuTLS v0.0.1
INFO: Installing HttpCommon v0.0.5
INFO: Installing HttpParser v0.0.9
INFO: Installing ICU v0.4.1
INFO: Installing JSON v0.3.7
INFO: Installing Nettle v0.1.4
INFO: Installing Requests v0.0.5
INFO: Installing SHA v0.0.2
INFO: Installing URIParser v0.0.2
INFO: Building ICU
=================================[ ERROR: ICU ]=================================
None of the selected providers can install dependency icu.
Use BinDeps.debug(package_name) to see available providers
while loading /home/idunning/pkgtest/.julia/v0.3/ICU/deps/build.jl, in expression starting on line 28
================================================================================
INFO: Building HttpParser
INFO: Building Nettle
INFO: Building GnuTLS
================================[ BUILD ERRORS ]================================
WARNING: ICU had build errors.
- packages with build errors remain installed in /home/idunning/pkgtest/.julia/v0.3
- build a package and all its dependencies with `Pkg.build(pkg)`
- build a single package by running its `deps/build.jl` script
================================================================================
INFO: Package database updated
INFO: METADATA is out-of-date a you may not have the latest version of GitHub
INFO: Use `Pkg.update()` to get the latest versions of your packages
- Library "libhttp_parser"
>>> 'using GitHub' log
ERROR: could not open file /home/idunning/pkgtest/.julia/v0.3/ICU/src/../deps/deps.jl
in include at ./boot.jl:245
in include_from_node1 at ./loading.jl:128
in include at ./boot.jl:245
in include_from_node1 at ./loading.jl:128
in reload_path at loading.jl:152
in _require at loading.jl:67
in require at loading.jl:54
in include at ./boot.jl:245
in include_from_node1 at ./loading.jl:128
in reload_path at loading.jl:152
in _require at loading.jl:67
in require at loading.jl:54
in include at ./boot.jl:245
in include_from_node1 at ./loading.jl:128
in reload_path at loading.jl:152
in _require at loading.jl:67
in require at loading.jl:54
in include at ./boot.jl:245
in include_from_node1 at ./loading.jl:128
in reload_path at loading.jl:152
in _require at loading.jl:67
in require at loading.jl:54
in include at ./boot.jl:245
in include_from_node1 at ./loading.jl:128
in reload_path at loading.jl:152
in _require at loading.jl:67
in require at loading.jl:54
in include at ./boot.jl:245
in include_from_node1 at ./loading.jl:128
in reload_path at loading.jl:152
in _require at loading.jl:67
in require at loading.jl:51
in include at ./boot.jl:245
in include_from_node1 at loading.jl:128
in process_options at ./client.jl:285
in _start at ./client.jl:354
in _start_3B_1699 at /home/idunning/julia03/usr/bin/../lib/julia/sys.so
while loading /home/idunning/pkgtest/.julia/v0.3/ICU/src/ICU.jl, in expression starting on line 54
while loading /home/idunning/pkgtest/.julia/v0.3/Calendar/src/Calendar.jl, in expression starting on line 1
while loading /home/idunning/pkgtest/.julia/v0.3/HttpCommon/src/HttpCommon.jl, in expression starting on line 3
while loading /home/idunning/pkgtest/.julia/v0.3/HttpParser/src/HttpParser.jl, in expression starting on line 9
while loading /home/idunning/pkgtest/.julia/v0.3/Requests/src/Requests.jl, in expression starting on line 6
while loading /home/idunning/pkgtest/.julia/v0.3/GitHub/src/GitHub.jl, in expression starting on line 6
while loading /home/idunning/pkgtest/.julia/v0.3/GitHub/testusing.jl, in expression starting on line 1
>>> test log
no tests to run
>>> end of log
There are three parts to your current rate-limit status in the github api:
The headers to determine this are on every response we get from the API, but there's also a "free" (doesn't count towards the limit) api call to ask for your rate_limit info. As the pagination features cause a function call to count as >1 API call, checking your rate limit will become more important.
Rate Limiting Overview: https://developer.github.com/v3/#rate-limiting
Checking your rate-limit: https://developer.github.com/v3/rate_limit/
Checking Your Un-authenticated limit:
r = get("https://api.github.com/rate_limit")
r.headers["X-RateLimit-Reset"] # end of this hour in utc epoch time
r.headers["X-RateLimit-Limit"] # your max per hour
r.headers["X-RateLimit-Remaining"] # your remaining for this hour
Checking Your Authenticated limit:
headers = Dict()
GitHub.authenticate_headers(headers, my_auth)
r = get("https://api.github.com/rate_limit"; headers=headers)
r.headers["X-RateLimit-Reset"]
r.headers["X-RateLimit-Limit"]
r.headers["X-RateLimit-Remaining"]
julia> GitHub.rate_limit(auth=getauth())
Dict{String,Any} with 2 entries:
"rate" => Dict{String,Any}("remaining"=>4997,"reset"=>1542057303,"limit"=>5000)
"resources" => Dict{String,Any}("graphql"=>Dict{String,Any}("remaining"=>4999,"reset"=>…
julia> prs, page_data = GitHub.pull_requests(REPO;
page_limit = 1, auth=getauth(),
params = myparams)
(GitHub.PullRequest[PullRequest(30004), PullRequest(30000), PullRequest(29998), PullRequest(29997), PullRequest(29994), PullRequest(29993), PullRequest(29992), PullRequest(29991), PullRequest(29990), PullRequest(29986), PullRequest(29978), PullRequest(29976), PullRequest(29975), PullRequest(29973), PullRequest(29969), PullRequest(29965), PullRequest(29963), PullRequest(29962), PullRequest(29961), PullRequest(29959)], Dict("next"=>"https://api.github.com/repositories/1644196/pulls?page=2&per_page=20&state=all","last"=>"https://api.github.com/repositories/1644196/pulls?page=739&per_page=20&state=all"))
julia> prs, page_data = GitHub.pull_requests(REPO;
page_limit = 1, auth=getauth(),
start_page = page_data["next"])
ERROR: HTTP.ExceptionRequest.StatusError(403, HTTP.Messages.Response:
"""
HTTP/1.1 403 Forbidden
Server: GitHub.com
Date: Mon, 12 Nov 2018 20:19:36 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 247
Status: 403 Forbidden
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1542054575
X-GitHub-Media-Type: github.v3; format=json
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
X-GitHub-Request-Id: E5A0:2238:1A83900:3F68591:5BE9E051
{"message":"API rate limit exceeded for 97.106.76.121. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://developer.github.com/v3/#rate-limiting"}""")
Rate should be ok but it seemst hat the auth
is unused when calling this with pagination?
The GitHub doc says that they have been careful to use HTTP methods with semantics appropriate to the API operations.
HTTP.jl retries most request automatically in the event of network failure. However, POST operations are not generally idempotent and cannot be automatically retried. GitHub.jl should implement system-state-aware retry loops around POST requests. i.e. when a POST operation throws an HTTP.IOError
GitHub.jl should retry the operation in a way that avoids duplicate changes to system state.
In the case of the create_status
operation that is the subject of JuliaWeb/HTTP.jl#220, POST /repos/:owner/:repo/statuses/:sha
, it seems that double-posting would create two statuses, https://developer.github.com/v3/repos/statuses/, so in the event of a failure, the GitHub.jl create_status
function should do a GET to check if the status was created before retrying (or, if duplicate statuses are not considered harmful to overall system correctness, just set retry_non_idempotent=true
).
GitHub.jl/src/repositories/statuses.jl
Lines 30 to 33 in beb3659
See also JuliaWeb/HTTP.jl#214.
This issue may apply in other places that use gh_post_json
.
Currently, you have a function named contributors
that gets the statistics about contributions. An alternative meaning would be to get the list of contributors (using this url: https://developer.github.com/v3/repos/#list-contributors).
How do you want to make them co-exist?
One possibility is to make the existing function contributor_stats
and this other meaning contributors
. Another option would be to use multiple dispatch somehow.
collaborators
is broken. The issue is a call to a map
on Dict
that is removed in recent julia versions:
There doesn't seem to be a function for this part of the GitHub API: https://developer.github.com/v3/repos/#list-user-repositories
I'd like to have a repos
function that takes a User/Org and returns their repositories. I'll probably make an attempt at adding one today.
Harder, Better, Faster!
Once whatever bug necessitated their addition is fixed
If I hit my rate limit, it would be nice if GitHub.jl would automatically do an exponential back-off.
This would be an opt-in feature.
julia> auth = GitHub.authenticate(ENV["github_token"])
GitHub.OAuth2(9d**********************************)
julia> owner = GitHub.owner("kindlychung")
Owner (all fields are Union{Nothing, T}):
...
julia> GitHub.create_repo(owner, "testjl")
ERROR: Error found in GitHub reponse:
Status Code: 401
Message: Requires authentication
Docs URL: https://developer.github.com/v3/repos/#create
Errors:
Stacktrace:
[1] error(::String, ::String, ::String, ::String, ::String) at ./error.jl:42
[2] handle_response_error(::HTTP.Messages.Response) at /home/kaiyin/.julia/packages/GitHub/hKBtB/src/utils/requests.jl:159
[3] #github_request#3(::GitHub.AnonymousAuth, ::Bool, ::Dict{Any,Any}, ::Dict{String,Any}, ::Bool, ::Function, ::GitHub.GitHubWebAPI, ::Function, ::String) at /home/kaiyin/.julia/packages/GitHub/hKBtB/src/utils/requests.jl:63
[4] #gh_post_json#10(::Base.Iterators.Pairs{Symbol,Dict{String,Any},Tuple{Symbol},NamedTuple{(:params,),Tuple{Dict{String,Any}}}}, ::Function, ::GitHub.GitHubWebAPI, ::String) at ./none:0
[5] #gh_post_json at ./none:0 [inlined]
[6] #create_repo#52(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::GitHub.GitHubWebAPI, ::Owner, ::String, ::Dict{String,Any}) at /home/kaiyin/.julia/packages/GitHub/hKBtB/src/repositories/repositories.jl:58
[7] create_repo at /home/kaiyin/.julia/packages/GitHub/hKBtB/src/repositories/repositories.jl:54 [inlined]
[8] #create_repo#53 at ./none:0 [inlined]
[9] create_repo at ./none:0 [inlined] (repeats 2 times)
[10] top-level scope at none:0
I do have 2-factor auth turned on (by company policy). Could that be the cause?
So far I know of only one difference between them - Organizations
can't be hireable
What would a combination type be called? Thing
?
It would be useful to be able to create auth tokens (and potentially cache them) through this package.
Julia base has some code to do that here: https://github.com/JuliaLang/julia/blob/master/base/pkg/github.jl#L48
Maybe I'm being dumb (correct me if I'm wrong), but I don't see any methods for:
when fetching issue comments with comments()
, the Comment
constructor gets confused by timestamps because GitHub returns them in ISO DateTime format, but with an extra Z
for the timezone, and the default Dates
constructor is confused by the extra Z
.
If the ref doesn't exist in the repository, but existing refs start with ref they will be returned as an array. I
julia> GitHub.reference("JuliaLang/julia", "heads/v"; handle_error=false)
ERROR: MethodError: no method matching Reference(::Array{Any,1})
Closest candidates are:
Reference(::Any, ::Any, ::Any) at /home/kc/.julia/packages/GitHub/hKBtB/src/git/reference.jl:2
Reference(::Union{Nothing, String}, ::Union{Nothing, HTTP.URIs.URI}, ::Union{Nothing, Dict}) at /home/kc/.julia/packages/GitHub/hKBtB/src/git/reference.jl:2
Reference(::Dict) at /home/kc/.julia/packages/GitHub/hKBtB/src/git/reference.jl:7
Stacktrace:
[1] #reference#219(::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:handle_error,),Tuple{Bool}}}, ::typeof(reference), ::GitHub.GitHubWebAPI, ::String, ::String) at /home/kc/.julia/packages/GitHub/hKBtB/src/git/reference.jl:13
[2] #reference at ./none:0 [inlined]
[3] #reference#220 at ./none:0 [inlined]
[4] (::GitHub.var"#kw##reference")(::NamedTuple{(:handle_error,),Tuple{Bool}}, ::typeof(reference), ::String, ::String) at ./none:0
[5] top-level scope at REPL[8]:1
The GitHub.Owner
type is missing several fields which can be returned from a GitHub API query returning a representation of a GitHub user.
For example, a GitHub API query to https://api.github.com/repos/JuliaLang/julia/contributors
(as would be accessed by contributors("JuliaLang/julia")
returns records in raw JSON of the form
{
"login": "jiahao",
"id": 1732,
"avatar_url": "https://avatars.githubusercontent.com/u/1732?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/jiahao",
"html_url": "https://github.com/jiahao",
"followers_url": "https://api.github.com/users/jiahao/followers",
"following_url": "https://api.github.com/users/jiahao/following{/other_user}",
"gists_url": "https://api.github.com/users/jiahao/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jiahao/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jiahao/subscriptions",
"organizations_url": "https://api.github.com/users/jiahao/orgs",
"repos_url": "https://api.github.com/users/jiahao/repos",
"events_url": "https://api.github.com/users/jiahao/events{/privacy}",
"received_events_url": "https://api.github.com/users/jiahao/received_events",
"type": "User",
"site_admin": false,
"contributions": 716
},
Several of these fields, notably the *_url
fields like avatar_url
, have no corresponding field representation in the GitHub.Owner
type. Unfortunately, the lack of this information completely breaks code that relied on having this data, such as the World of Julia notebook (which wants the avatar_url
fields).
cc @jrevels
See #24 (comment)
First of all, great work, love the package.
I wanted to know if creating issues through the API is coming any time soon? If not I could try to make a PR.
julia> owner("knarz")
julia> owner("knarz")
ERROR: Unexpected character / after scheme
in parse_url at /Users/jiahao/.julia/v0.4/URIParser/src/parser.jl:213
in call at /Users/jiahao/.julia/v0.4/URIParser/src/parser.jl:295
in extract_nullable at /Users/jiahao/.julia/v0.4/GitHub/src/utils/GitHubType.jl:59
in json2github at /Users/jiahao/.julia/v0.4/GitHub/src/utils/GitHubType.jl:85
in call at /Users/jiahao/.julia/v0.4/GitHub/src/owners/owners.jl:43
in owner at /Users/jiahao/.julia/v0.4/GitHub/src/owners/owners.jl:60
in owner at /Users/jiahao/.julia/v0.4/GitHub/src/owners/owners.jl:59
Possibly an upstream error in the web stack due to an unescaped slash somewhere.
This is really inconsistent and annoying right now
import GitHub
github_token = ENV["MY_GITHUB_TOKEN"]
my_github_auth = GitHub.authenticate(github_token)
owner = GitHub.owner("MyGithubOrganization", true; auth = my_github_auth)
repo = GitHub.create_repo(owner, "my-brand-new-repo"; auth = my_github_auth)
The repo should be created, and the return value repo
should look something like this:
GitHub.Repo (all fields are Union{Nothing, T}):
name: "my-brand-new-repo"
full_name: "MyGithubOrganization/my-brand-new-repo"
default_branch: "master"
owner: Owner("MyGithubOrganization")
id: 151316725
size: 0
subscribers_count: 0
forks_count: 0
stargazers_count: 0
watchers_count: 0
open_issues_count: 0
url: HTTP.URI("https://api.github.com/repos/MyGithubOrganization/my-brand-new-repo")
html_url: HTTP.URI("https://github.com/MyGithubOrganization/my-brand-new-repo")
pushed_at: 2018-10-02T20:11:10
created_at: 2018-10-02T20:11:09
updated_at: 2018-10-02T20:11:09
has_issues: true
has_wiki: true
has_downloads: true
has_pages: false
private: false
fork: false
permissions: Dict{String,Any}("admin"=>true,"pull"=>true,"push"=>true)
ERROR: MethodError: objects of type String are not callable
Stacktrace:
[1] #create_repo#52(::Base.Iterators.Pairs{Symbol,GitHub.OAuth2,Tuple{Symbol},NamedTuple{(:auth,),Tuple{GitHub.OAuth2}}}, ::Function, ::GitHub.GitHubWebAPI, ::GitHub.Owner, ::String, ::Dict{String,Any}) at /Users/dilum/.julia/dev/GitHub/src/repositories/repositories.jl:56
[2] #create_repo at ./none:0 [inlined]
[3] #create_repo#53 at ./none:0 [inlined]
[4] #create_repo at ./none:0 [inlined] (repeats 2 times)
[5] top-level scope at none:0
This error occurs because the local function variable name
clashes with the function GitHub.name
.
I will submit a PR shortly that fixes this issue.
HELLO FROM JULIA
ERROR: LoadError: TypeError: #request: in typeassert, expected Dict{Any,Any}, got Dict{String,String}
Stacktrace:
[1] (::HTTP.#kw##request)(::Array{Any,1}, ::HTTP.#request, ::HTTP.Client, ::HTTP.Method, ::HTTP.URIs.URI) at ./<missing>:0
[2] #get#47(::Bool, ::Dict{Any,Any}, ::Array{Any,1}, ::Function, ::String) at /home/keno/.julia/v0.6/HTTP/src/client.jl:508
[3] (::HTTP.#kw##get)(::Array{Any,1}, ::HTTP.#get, ::String) at ./<missing>:0
[4] #github_request#3(::GitHub.AnonymousAuth, ::Bool, ::Dict{Any,Any}, ::Dict{Any,Any}, ::Bool, ::Function, ::GitHub.GitHubWebAPI, ::Function, ::String) at /home/keno/.julia/v0.6/GitHub/src/utils/requests.jl:58
[5] (::GitHub.#kw##github_request)(::Array{Any,1}, ::GitHub.#github_request, ::GitHub.GitHubWebAPI, ::Function, ::String) at ./<missing>:0
[6] #gh_get#4 at /home/keno/.julia/v0.6/GitHub/src/utils/requests.jl:66 [inlined]
[7] (::GitHub.#kw##gh_get)(::Array{Any,1}, ::GitHub.#gh_get, ::GitHub.GitHubWebAPI, ::String) at ./<missing>:0
[8] #authenticate#24(::Dict{Any,Any}, ::Array{Any,1}, ::Function, ::GitHub.GitHubWebAPI, ::String) at /home/keno/.julia/v0.6/GitHub/src/utils/auth.jl:54
[9] #authenticate#25(::Array{Any,1}, ::Function, ::String) at ./<missing>:0
[10] authenticate(::String) at ./<missing>:0
[11] include_from_node1(::String) at ./loading.jl:569
[12] include(::String) at ./sysimg.jl:14
[13] process_options(::Base.JLOptions) at ./client.jl:305
[14] _start() at ./client.jl:371
Any chance we could tag a new point release?
As far as I've seen there are no methods for working with Github's search API. It would be useful to be able to perform random searches and get back a list of repos.
https://developer.github.com/v3/search/
Cheers!
The readme docs are ok, but this could really use a readthedocs page
Currently, the definition of OAuth2
is: (see src/utils/auth.jl)
struct OAuth2 <: Authorization
token::String
end
Should token
be a Base.SecretBuffer
instead of a String
?
EDIT!
See Tim's attempted trigger phrase usage here, which reasonably should've been picked up.
julia> contributors("dlfivefifty", "ApproxFun.jl")
HttpError(404,"Not Found","https://developer.github.com/v3")
while loading In[42], in expression starting on line 103
in handle_error at /Users/jiahao/.julia/v0.3/GitHub/src/error.jl:36
in get_pages at /Users/jiahao/.julia/v0.3/GitHub/src/utils.jl:78
in get_pages at /Users/jiahao/.julia/v0.3/GitHub/src/utils.jl:77
in contributors at /Users/jiahao/.julia/v0.3/GitHub/src/repos.jl:132
in contributors at /Users/jiahao/.julia/v0.3/GitHub/src/repos.jl:120
This particular package was moved to https://github.com/ApproxFun/ApproxFun.jl
.
Since this is in JuliaWeb, it would be good to get its testing up to par with the other packages in the org.
So:
It'd be nice to be able to create/edit Gist's with github.
The stats URI appears to be hard limited to 100 results and therefore it is not possible to retrieve more than 100 contributors, stargazers, etc. Specifying the additional query "?pages=2" does not change the results, as would be expected from the pagination section of the API
I ran a Pkg.update()
and then did...
julia> Pkg.add("GitHub")
INFO: Nothing to be done
julia> using Github
Warning: replacing module GitHub
Warning: requiring "Github" did not define a corresponding module.
julia> using Github
Warning: requiring "Github" did not define a corresponding module.
What am I doing wrong?
Thanks!
I get the following error on the server on recieving the webhook ping event from github.com:
┌ Error: error handling request
│ exception =
│ MethodError: no method matching (::getfield(GitHub, Symbol("##165#167")){GitHub.OAuth2,String,Array{String,1},typeof(Main.Registrator.RegServer.event_handler)})(::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}})
│ Closest candidates are:
│ #165(!Matched::HTTP.Messages.Request) at /home/nkottary/.julia/packages/GitHub/Y0gpt/src/activity/events.jl:79
│ Stacktrace:
│ [1] macro expansion at /home/nkottary/.julia/packages/HTTP/GN0Te/src/Servers.jl:352 [inlined]
│ [2] (::getfield(HTTP.Servers, Symbol("##13#14")){getfield(GitHub, Symbol("##165#167")){GitHub.OAuth2,String,Array{String,1},typeof(Main.Registrator.RegServer.event_handler)},HTTP.ConnectionPool.Transaction{Sockets.TCPSocket},HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}})() at ./task.jl:259
I am running the server like this:
listener = GitHub.EventListener(event_handler;
auth=GitHub.authenticate("***"),
secret="***",
events=["ping", "pull_request", "push"])
GitHub.run(listener, ip"0.0.0.0", 8090)
e.g. in Repo code, it still tries to do Repo(JSON.parse(r.data))
. I think Repo(Requests.json(r))
is the new way. Do you want a PR?
I was using GitHub.file()
to download some of the url
files from Metadata.jl
and found some did not base64decode
correctly. Example:
file("JuliaLang/METADATA.jl", "ACME/url")
produces
GitHub.Content (all fields are Nullable):
typ: "file"
name: "url"
path: "ACME/url"
encoding: "base64"
content: "Z2l0Oi8vZ2l0aHViLmNvbS9IU1UtQU5UL0FDTUUuamwuZ2l0Cg==\n"
sha: "b5b82f0d5f1f349298b604abd2f1f6e77ca1ae64"
...
but
file("JuliaLang/METADATA.jl", "AWS/url").content.value
gives
"Z2l0Oi8vZ2l0aHViLmNvbS9KdWxpYUNsb3VkL0FXUy5qbC5naXQK\n"
and
base64decode("Z2l0Oi8vZ2l0aHViLmNvbS9KdWxpYUNsb3VkL0FXUy5qbC5naXQK\n")
ArgumentError: incorrect base64 format, block must be at least 2 and at most 4 bytes
in b64decode!(::Array{UInt8,1}, ::Array{UInt8,1}) at ./base64.jl:68
in read(::Base64DecodePipe, ::Type{UInt8}) at ./base64.jl:192
in readbytes!(::Base64DecodePipe, ::Array{UInt8,1}, ::Int64) at ./io.jl:345
in read(::Base64DecodePipe, ::Int64) at ./io.jl:368
in base64decode(::String) at ./base64.jl:203
Out of the 1000 files I downloaded, about a third gave this error. I'm not sure if this is an issue with how the Content gets parsed internally and need something deeper. For my own purposes, I just fixed the strings by adding a =
before the \n
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.