Skip to content
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

Upgrade to Julia 0.7; switch to HTTP.jl #20

Merged
merged 9 commits into from
Oct 31, 2018
Merged

Conversation

xiuliren
Copy link
Contributor

Julia 0.7 is pretty nice, let's upgrade!

I also switched to HTTP.jl since it is update to Julia 0.7

@xiuliren
Copy link
Contributor Author

this is going to fix
#19

@joshbode
Copy link
Contributor

Thanks for working on this!
I'm not using Julia in my current job so this is very helpful to keep this up to date

@joshbode
Copy link
Contributor

Looks like the Travis and AppVeyor CI files need to be updated for the latest versions.

src/session.jl Outdated
@@ -137,19 +141,39 @@ function JWS(credentials::JSONCredentials, claimset::JWTClaimSet, header::JWTHea
"$payload.$signature"
end

function token(credentials::JSONCredentials, scopes::AbstractVector{<: AbstractString})
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at #21 - HTTP.URIs.escapeuri should cover this

@joshbode joshbode mentioned this pull request Aug 13, 2018
@xiuliren
Copy link
Contributor Author

@joshbode I just updated the travis and appveyor and other code, but still have some test error of storage api. I got some difficulty to locate the error code, do you have any idea?

test gsdict io: Error During Test at /usr/people/jingpeng/.julia/dev/BigArrays/test/backen
ds/GSDicts.jl:7                                                                           
  Got exception MethodError(iterate, (nothing,), 0xffffffffffffffff) outside of a @test   
  MethodError: no method matching iterate(::Nothing)                                      
  Closest candidates are:                                                                 
    iterate(::Any) at essentials.jl:853                                                   
    iterate(::Any, !Matched::Any) at essentials.jl:847                                    
    iterate(!Matched::Core.SimpleVector) at essentials.jl:583                             
    ...                                                                                   

@xiuliren
Copy link
Contributor Author

xiuliren commented Oct 4, 2018

here is the full error message:

┌ Warning: Error in @async writebody task
│   exception =
│    MethodError: no method matching iterate(::Nothing)
│    Closest candidates are:
│      iterate(::Any) at essentials.jl:853
│      iterate(::Any, !Matched::Any) at essentials.jl:847
│      iterate(!Matched::Core.SimpleVector) at essentials.jl:583
│      ...
│    Stacktrace:
│     [1] start(::Nothing) at ./essentials.jl:878
│     [2] iterate(::Nothing) at ./essentials.jl:853
│     [3] writebodystream(::HTTP.Streams.Stream{HTTP.Messages.Response,HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}, ::HTTP.Messages.Request, ::Nothing) at /usr/people/jingpeng/.julia/packages/HTT
P/YjRCz/src/StreamRequest.jl:118
│     [4] writebody(::HTTP.Streams.Stream{HTTP.Messages.Response,HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}, ::HTTP.Messages.Request, ::Nothing) at /usr/people/jingpeng/.julia/packages/HTTP/YjRC
z/src/StreamRequest.jl:97
│     [5] (::getfield(HTTP.StreamRequest, Symbol("##2#3")){HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext},HTTP.Messages.Request,Nothing})() at ./task.jl:262                                          
└ @ HTTP.StreamRequest ~/.julia/packages/HTTP/YjRCz/src/StreamRequest.jl:60
test gsdict io: Error During Test at /usr/people/jingpeng/.julia/dev/BigArrays/test/backends/GSDicts.jl:7                                                                                                  
  Got exception UndefVarError(:statuscode) outside of a @test
  UndefVarError: statuscode not defined
  Stacktrace:
   [1] #execute#20(::Nothing, ::Bool, ::String, ::Bool, ::Bool, ::Dates.Second, ::Int64, ::Base.Iterators.Pairs{Symbol,String,Tuple{Symbol},NamedTuple{(:fields,),Tuple{String}}}, ::typeof(GoogleCloud.api.
execute), ::GoogleCloud.session.GoogleSession{GoogleCloud.credentials.JSONCredentials}, ::GoogleCloud.api.APIResource, ::GoogleCloud.api.APIMethod, ::String) at /usr/people/jingpeng/.julia/dev/GoogleCloud
/src/api/api.jl:310
   [2] (::getfield(GoogleCloud.api, Symbol("#kw##execute")))(::NamedTuple{(:fields,),Tuple{String}}, ::typeof(GoogleCloud.api.execute), ::GoogleCloud.session.GoogleSession{GoogleCloud.credentials.JSONCred
entials}, ::GoogleCloud.api.APIResource, ::GoogleCloud.api.APIMethod, ::String) at ./none:0
   [3] #call#19(::Base.Iterators.Pairs{Symbol,Any,Tuple{Symbol,Symbol},NamedTuple{(:session, :fields),Tuple{GoogleCloud.session.GoogleSession{GoogleCloud.credentials.JSONCredentials},String}}}, ::GoogleCl
oud.api.APIRoot, ::Symbol, ::Symbol, ::String) at /usr/people/jingpeng/.julia/dev/GoogleCloud/src/api/api.jl:218                                                                                           
   [4] (::getfield(GoogleCloud.api, Symbol("#kw#APIRoot")))(::NamedTuple{(:session, :fields),Tuple{GoogleCloud.session.GoogleSession{GoogleCloud.credentials.JSONCredentials},String}}, ::GoogleCloud.api.AP
IRoot, ::Symbol, ::Symbol, ::String) at ./none:0
   [5] #connect!#4(::String, ::Bool, ::Function, ::GoogleCloud.collection.KeyStore{String,Array{UInt8,1}}) at /usr/people/jingpeng/.julia/dev/GoogleCloud/src/collection.jl:75                             
   [6] #connect! at ./none:0 [inlined]
   [7] #call#1(::GoogleCloud.session.GoogleSession{GoogleCloud.credentials.JSONCredentials}, ::String, ::Bool, ::Bool, ::Symbol, ::Symbol, ::Type{GoogleCloud.collection.KeyStore{String,Array{UInt8,1}}}, :
:String) at /usr/people/jingpeng/.julia/dev/GoogleCloud/src/collection.jl:70
   [8] (::getfield(Core, Symbol("#kw#Type")))(::NamedTuple{(:session, :key_format, :val_format, :empty, :gzip),Tuple{GoogleCloud.session.GoogleSession{GoogleCloud.credentials.JSONCredentials},Symbol,Symbo
l,Bool,Bool}}, ::Type{GoogleCloud.collection.KeyStore{String,Array{UInt8,1}}}, ::String) at ./none:0
   [9] #GSDict#1(::Bool, ::String, ::DataType, ::Type, ::String) at /usr/people/jingpeng/.julia/dev/BigArrays/src/backends/GSDicts.jl:31                                                                   
   [10] GSDict(::String) at /usr/people/jingpeng/.julia/dev/BigArrays/src/backends/GSDicts.jl:26
   [11] macro expansion at /usr/people/jingpeng/.julia/dev/BigArrays/test/backends/GSDicts.jl:8 [inlined]                                                                                                  
   [12] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Test/src/Test.jl:1079 [inlined]                                                                           
   [13] top-level scope at /usr/people/jingpeng/.julia/dev/BigArrays/test/backends/GSDicts.jl:8
   [14] include at ./boot.jl:317 [inlined]
   [15] include_relative(::Module, ::String) at ./loading.jl:1038
   [16] include(::Module, ::String) at ./sysimg.jl:29
   [17] exec_options(::Base.JLOptions) at ./client.jl:239
   [18] _start() at ./client.jl:432
Test Summary:  | Error  Total
test gsdict io |     1      1
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /usr/people/jingpeng/.julia/dev/BigArrays/test/backends/GSDicts.jl:7

@joshbode
Copy link
Contributor

joshbode commented Oct 4, 2018

Looks like the issue is:

  UndefVarError: statuscode not defined

@xiuliren
Copy link
Contributor Author

xiuliren commented Oct 5, 2018

I have fixed that error, but get some more.

┌ Warning: Error in @async writebody task                                                                                                                                           │   exception =                                                    
│    MethodError: no method matching iterate(::Nothing)                                                                                                                             │    Closest candidates are:                                                                                                                                                       
│      iterate(::Any) at essentials.jl:853                                                                                                                                          │      iterate(::Any, !Matched::Any) at essentials.jl:847                                                                                                                          
│      iterate(!Matched::Core.SimpleVector) at essentials.jl:583                                                                                                                    │      ...                                                                            
│    Stacktrace:                                                                                                                                                                    │     [1] start(::Nothing) at ./essentials.jl:878
│     [2] iterate(::Nothing) at ./essentials.jl:853
│     [3] writebodystream(::HTTP.Streams.Stream{HTTP.Messages.Response,HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}, ::HTTP.Messages.Request, ::Nothing) at /usr/people/jingpeng/.julia/packages/HTTP/YjRCz/src/StreamRequest.jl:118                                                                                                                           
│     [4] writebody(::HTTP.Streams.Stream{HTTP.Messages.Response,HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}, ::HTTP.Messages.Request, ::Nothing) at /usr/people/jingpeng/.julia/packages/HTTP/YjRCz/src/StreamRequest.jl:97                                                                                                                                  
│     [5] (::getfield(HTTP.StreamRequest, Symbol("##2#3")){HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext},HTTP.Messages.Request,Nothing})() at ./task.jl:262                  
└ @ HTTP.StreamRequest ~/.julia/packages/HTTP/YjRCz/src/StreamRequest.jl:60        
test gsdict io: Error During Test at /usr/people/jingpeng/.julia/dev/BigArrays/test/backends/GSDicts.jl:7                                                                          
  Got exception ArgumentError("invalid index: Content-Type of type String") outside of a @test                                                                                     
  ArgumentError: invalid index: Content-Type of type String
  Stacktrace:
   [1] to_index(::String) at ./indices.jl:241
   [2] to_index(::Array{Pair{SubString{String},SubString{String}},1}, ::String) at ./indices.jl:222                                                                                
   [3] to_indices at ./indices.jl:269 [inlined]
   [4] to_indices at ./indices.jl:266 [inlined]                                                                                                                                    
   [5] getindex(::Array{Pair{SubString{String},SubString{String}},1}, ::String) at ./abstractarray.jl:913                                                                          
   [6] macro expansion at ./show.jl:556 [inlined]                                                                                                                                  
   [7] macro expansion at ./logging.jl:311 [inlined]
   [8] #execute#20(::Nothing, ::Bool, ::String, ::Bool, ::Bool, ::Dates.Second, ::Int64, ::Base.Iterators.Pairs{Symbol,String,Tuple{Symbol},NamedTuple{(:fields,),Tuple{String}}}, $:typeof(GoogleCloud.api.execute), ::GoogleCloud.session.GoogleSession{GoogleCloud.credentials.JSONCredentials}, ::GoogleCloud.api.APIResource, ::GoogleCloud.api.APIMethod, ::Strin$
) at /usr/people/jingpeng/.julia/dev/GoogleCloud/src/api/api.jl:287
   [9] (::getfield(GoogleCloud.api, Symbol("#kw##execute")))(::NamedTuple{(:debug, :fields),Tuple{Bool,String}}, ::typeof(GoogleCloud.api.execute), ::GoogleCloud.session.GoogleSes$
ion{GoogleCloud.credentials.JSONCredentials}, ::GoogleCloud.api.APIResource, ::GoogleCloud.api.APIMethod, ::String) at ./none:0                                                    
   [10] #call#19(::Base.Iterators.Pairs{Symbol,Any,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:session, :fields, :debug),Tuple{GoogleCloud.session.GoogleSession{GoogleCloud.credentia$
s.JSONCredentials},String,Bool}}}, ::GoogleCloud.api.APIRoot, ::Symbol, ::Symbol, ::String) at /usr/people/jingpeng/.julia/dev/GoogleCloud/src/api/api.jl:218                      
   [11] (::getfield(GoogleCloud.api, Symbol("#kw#APIRoot")))(::NamedTuple{(:session, :fields, :debug),Tuple{GoogleCloud.session.GoogleSession{GoogleCloud.credentials.JSONCredentia$
s},String,Bool}}, ::GoogleCloud.api.APIRoot, ::Symbol, ::Symbol, ::String) at ./none:0
   [12] #connect!#4(::String, ::Bool, ::Bool, ::Function, ::GoogleCloud.collection.KeyStore{String,Array{UInt8,1}}) at /usr/people/jingpeng/.julia/dev/GoogleCloud/src/collection.j$
:77
   [13] #connect! at ./none:0 [inlined]
   [14] #call#1(::GoogleCloud.session.GoogleSession{GoogleCloud.credentials.JSONCredentials}, ::String, ::Bool, ::Bool, ::Symbol, ::Symbol, ::Bool, ::Type{GoogleCloud.collection.K$
yStore{String,Array{UInt8,1}}}, ::String) at /usr/people/jingpeng/.julia/dev/GoogleCloud/src/collection.jl:71                                                                      
   [15] (::getfield(Core, Symbol("#kw#Type")))(::NamedTuple{(:session, :key_format, :val_format, :empty, :gzip, :debug),Tuple{GoogleCloud.session.GoogleSession{GoogleCloud.credent$
als.JSONCredentials},Symbol,Symbol,Bool,Bool,Bool}}, ::Type{GoogleCloud.collection.KeyStore{String,Array{UInt8,1}}}, ::String) at ./none:0                                         
   [16] #GSDict#1(::Bool, ::String, ::DataType, ::Type, ::String) at /usr/people/jingpeng/.julia/dev/BigArrays/src/backends/GSDicts.jl:31                                          
   [17] GSDict(::String) at /usr/people/jingpeng/.julia/dev/BigArrays/src/backends/GSDicts.jl:26                                                                                   
   [18] macro expansion at /usr/people/jingpeng/.julia/dev/BigArrays/test/backends/GSDicts.jl:8 [inlined]                                                                          
   [19] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Test/src/Test.jl:1079 [inlined]                                                   
   [20] top-level scope at /usr/people/jingpeng/.julia/dev/BigArrays/test/backends/GSDicts.jl:8                                                                                    
   [21] include at ./boot.jl:317 [inlined]                                                                                                                                         
   [22] include_relative(::Module, ::String) at ./loading.jl:1038

@xiuliren
Copy link
Contributor Author

@samoconnor @quinnj There are some errors related with HTTP. It probably is a bug of this package rather than HTTP.
could you please help to take a look at the errors? any idea will be appreciated.

@samoconnor
Copy link

getindex(::Array{Pair{SubString{String},SubString{String}},1}, ::String)

The stack trace says you're calling getindex(x, i) (x[i]) on a Vector{Pair} with a String as an index.

https://juliaweb.github.io/HTTP.jl/latest/index.html#HTTP.Messages.header

https://juliaweb.github.io/HTTP.jl/latest/index.html#HTTP.Messages.hasheader

@xiuliren xiuliren changed the title [WIP] upgrade to Julia 0.7; switch to HTTP.jl Upgrade to Julia 0.7; switch to HTTP.jl Oct 31, 2018
@xiuliren
Copy link
Contributor Author

I have fixed the bugs, tests passed. I have only tested with Storage backend and KeyStore functions though.

@xiuliren xiuliren merged commit 6cc36fd into JuliaCloud:master Oct 31, 2018
@xiuliren
Copy link
Contributor Author

xiuliren commented Oct 31, 2018

@StefanKarpinski I would like to register this upgrade to METADATA.jl using attobot, but I can not set it up since I do not have the permission. Could you please help to set it up or just give me the permission?

There is an issue from attobot complaining the tagging link is not correct, since it was migrated from @joshbode 's repo.
#23

@xiuliren
Copy link
Contributor Author

I also can not edit the documentation link which is invalid and outdated.

@joshbode
Copy link
Contributor

Thanks for all your effort @jingpengw!

I also am not able to edit that link for some reason...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants