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 GitHub to use newest HTTP #102

Merged
merged 8 commits into from
Jan 29, 2018
Merged

upgrade GitHub to use newest HTTP #102

merged 8 commits into from
Jan 29, 2018

Conversation

KristofferC
Copy link
Collaborator

@KristofferC KristofferC commented Jan 17, 2018

So we have it ready for when HTTP tags new release. @Keno, @ararslan

Need to test FemtoCleaner server with this as well Done

@@ -98,17 +98,17 @@ function handle_event_request(request, handle;
secret = nothing, events = nothing,
repos = nothing, forwards = nothing)
if !(isa(secret, Void)) && !(has_valid_secret(request, secret))
return HTTP.Response(400, "invalid signature")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure how to add these messages.

Copy link
Contributor

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

@quinnj, @KristofferC, looking at this now...

Choose a reason for hiding this comment

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

See JuliaWeb/HTTP.jl@2c14d43
-- " add constructors: Response(s::Int, body::AbstractString) ..."

Also, maybe this catch is not required because of the catch in HTTP.Servers.handle_stream()

        server = HTTP.Servers.Server() do request, response
            try
                handle_event_request(request, handle; auth = auth,
                                     secret = secret, events = events,
            vvvvv                    repos = repos, forwards = forwards)
            catch err
                bt = catch_backtrace()
                print(STDERR, "SERVER ERROR: ")
                Base.showerror(STDERR, err, bt)
                return HTTP.Response(500)
            end
        end

samoconnor added a commit to JuliaWeb/HTTP.jl that referenced this pull request Jan 17, 2018
@@ -146,7 +149,8 @@ function handle_response_error(r::HTTP.Response)
if r.status >= 400
message, docs_url, errors = "", "", ""
try
data = JSON.parse(String(r))
@show r
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Todo: remove.

@KristofferC KristofferC reopened this Jan 25, 2018
@Keno
Copy link
Contributor

Keno commented Jan 27, 2018

Should be good to go I think

@KristofferC
Copy link
Collaborator Author

Pushed some small fixups. Should be good when CI passes.

@ararslan
Copy link
Member

Looks like you need a dependency on Nullables in order to work on 0.7.

@KristofferC
Copy link
Collaborator Author

KristofferC commented Jan 28, 2018

Ok, passes on 0.7 now. Just want to state for the record that test time on 0.7 is significantly worse than on 0.6. Locally, timing Pkg.test("GitHub") gives

0.6:

 54.813450 seconds (4.63 M allocations: 243.637 MiB, 0.49% gc time)

0.7:

223.244748 seconds (8.74 M allocations: 487.098 MiB, 0.18% gc time)

Update:

Ok, the slowdown is due to deprecations in JSON. Nothing to worry about then.

HttpCommon # for deprecations
HTTP 0.6
Nullables

Copy link
Member

Choose a reason for hiding this comment

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

There should also be an explicit Compat dependency here, since you're using Nothing and the pairs method for replace (among other things).

Copy link
Member

Choose a reason for hiding this comment

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

Hah, and using Compat itself!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With my test script in Pkg3 this would have errored locally...

@KristofferC KristofferC merged commit 33e3dd4 into master Jan 29, 2018
@ararslan ararslan deleted the kc/http2 branch January 29, 2018 19:01
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.

4 participants