From 87b11a23bb15dd18fb429d30e120fab5ebde0fe1 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Mon, 16 Apr 2018 10:40:38 +0200 Subject: [PATCH] fix some deprecation warnings, 0.7 compatibility and test on mac --- .travis.yml | 3 +++ REQUIRE | 2 +- src/activity/events.jl | 4 ++-- src/git/reference.jl | 4 ++-- src/utils/GitHubType.jl | 42 ++++++++++++++++++------------------- src/utils/requests.jl | 2 +- test/commit_comment.jl | 2 ++ test/event_tests.jl | 2 +- test/ghtype_tests.jl | 6 +++--- test/read_only_api_tests.jl | 2 +- 10 files changed, 37 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index 23b7583..eda2418 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ language: julia +os: + - linux + - osx julia: - 0.6 - nightly diff --git a/REQUIRE b/REQUIRE index a6c6a02..84265b6 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,6 +1,6 @@ julia 0.6 -Compat 0.43 +Compat 0.62 JSON MbedTLS HTTP 0.6.3 diff --git a/src/activity/events.jl b/src/activity/events.jl index dd08ca7..89b0096 100644 --- a/src/activity/events.jl +++ b/src/activity/events.jl @@ -43,7 +43,7 @@ sig_header(request::HTTP.Request) = HTTP.header(request, "X-Hub-Signature") function has_valid_secret(request::HTTP.Request, secret) if has_sig_header(request) - secret_sha = "sha1="*bytes2hex(MbedTLS.digest(MbedTLS.MD_SHA1, HTTP.payload(request, String), secret)) + secret_sha = "sha1="*bytes2hex(MbedTLS.digest(MbedTLS.MD_SHA1, HTTP.payload(request), secret)) return sig_header(request) == secret_sha end return false @@ -97,7 +97,7 @@ function handle_event_request(request, handle; return HTTP.Response(204, "event ignored") end - event = event_from_payload!(event_header(request), JSON.parse(HTTP.payload(request, String))) + event = event_from_payload!(event_header(request), JSON.parse(IOBuffer(HTTP.payload(request)))) if !(isa(repos, Nothing)) && !(from_valid_repo(event, repos)) return HTTP.Response(400, "invalid repo") diff --git a/src/git/reference.jl b/src/git/reference.jl index df4a682..35ece37 100644 --- a/src/git/reference.jl +++ b/src/git/reference.jl @@ -10,12 +10,12 @@ name(ref::Reference) = String(split(get(ref.ref), "refs/")[2]) @api_default function reference(api::GitHubAPI, repo, ref_obj; options...) result = gh_get_json(api, "/repos/$(name(repo))/git/refs/$(name(ref_obj))"; options...) - return Reference.(result) + return Reference(result) end @api_default function references(api::GitHubAPI, repo; options...) results, page_data = gh_get_paged_json(api, "/repos/$(name(repo))/git/refs"; options...) - return Reference.(results), page_data + return Reference.((results,)), page_data end @api_default function create_reference(api::GitHubAPI, repo; options...) diff --git a/src/utils/GitHubType.jl b/src/utils/GitHubType.jl index 855462b..8a417dc 100644 --- a/src/utils/GitHubType.jl +++ b/src/utils/GitHubType.jl @@ -82,7 +82,7 @@ end @generated function json2github(::Type{G}, data::Dict) where {G<:GitHubType} types = G.types fields = fieldnames(G) - args = Vector{Expr}(length(fields)) + args = Vector{Expr}(undef, length(fields)) for i in eachindex(fields) field, T = fields[i], first(types[i].parameters) key = field == :typ ? "type" : string(field) @@ -125,27 +125,27 @@ end ################### function Base.show(io::IO, g::GitHubType) - print(io, "$(typeof(g)) (all fields are Nullable):") - for field in fieldnames(typeof(g)) - val = getfield(g, field) - if !(isnull(val)) - gotval = get(val) - println(io) - print(io, " $field: ") - if isa(gotval, Vector) - print(io, typeof(gotval)) - else - showcompact(io, gotval) - end + if get(io, :compact, false) + uri_id = namefield(g) + if isnull(uri_id) + print(io, typeof(g), "(…)") + else + print(io, typeof(g), "($(repr(get(uri_id))))") end - end -end - -function Base.showcompact(io::IO, g::GitHubType) - uri_id = namefield(g) - if isnull(uri_id) - print(io, typeof(g), "(…)") else - print(io, typeof(g), "($(repr(get(uri_id))))") + print(io, "$(typeof(g)) (all fields are Nullable):") + for field in fieldnames(typeof(g)) + val = getfield(g, field) + if !(isnull(val)) + gotval = get(val) + println(io) + print(io, " $field: ") + if isa(gotval, Vector) + print(io, typeof(gotval)) + else + show(IOContext(io, :compact => true), gotval) + end + end + end end end diff --git a/src/utils/requests.jl b/src/utils/requests.jl index 10b3b1b..fd067da 100644 --- a/src/utils/requests.jl +++ b/src/utils/requests.jl @@ -92,7 +92,7 @@ get_page_links(r) = split(HTTP.header(r, "Link",), ",") function find_page_link(links, rel) relstr = "rel=\"$(rel)\"" for i in 1:length(links) - if contains(links[i], relstr) + if occursin(relstr, links[i]) return i end end diff --git a/test/commit_comment.jl b/test/commit_comment.jl index 94268a2..41807a7 100644 --- a/test/commit_comment.jl +++ b/test/commit_comment.jl @@ -1,3 +1,5 @@ +using Compat.Base64 + function create_event() data_base64 = "eyJhY3Rpb24iOiJjcmVhdGVkIiwiY29tbWVudCI6eyJ1cmwiOiJodHRwczovL2FwaS5naXRodWIuY29tL3JlcG9zL0p1bGlhQ0kvQmVuY2htYXJrVHJhY2tlcnMuamwvY29tbWVudHMvMTQwNDcwNTgiLCJodG1sX3VybCI6Imh0dHBzOi8vZ2l0aHViLmNvbS9KdWxpYUNJL0JlbmNobWFya1RyYWNrZXJzLmpsL2NvbW1pdC8zMmQzNWYyODU3NzdiMDc3ZDhiNmEyNTIxMzA5ZDFhYjY0NmQyMzc5I2NvbW1pdGNvbW1lbnQtMTQwNDcwNTgiLCJpZCI6MTQwNDcwNTgsInVzZXIiOnsibG9naW4iOiJqcmV2ZWxzIiwiaWQiOjMyNzc0NDMsImF2YXRhcl91cmwiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMzI3NzQ0Mz92PTMiLCJncmF2YXRhcl9pZCI6IiIsInVybCI6Imh0dHBzOi8vYXBpLmdpdGh1Yi5jb20vdXNlcnMvanJldmVscyIsImh0bWxfdXJsIjoiaHR0cHM6Ly9naXRodWIuY29tL2pyZXZlbHMiLCJmb2xsb3dlcnNfdXJsIjoiaHR0cHM6Ly9hcGkuZ2l0aHViLmNvbS91c2Vycy9qcmV2ZWxzL2ZvbGxvd2VycyIsImZvbGxvd2luZ191cmwiOiJodHRw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RwczovL2FwaS5naXRodWIuY29tL3VzZXJzL2pyZXZlbHMiLCJodG1sX3VybCI6Imh0dHBzOi8vZ2l0aHViLmNvbS9qcmV2ZWxzIiwiZm9sbG93ZXJzX3VybCI6Imh0dHBzOi8vYXBpLmdpdGh1Yi5jb20vdXNlcnMvanJldmVscy9mb2xsb3dlcnMiLCJmb2xsb3dpbmdfdXJsIjoiaHR0cHM6Ly9hcGkuZ2l0aHViLmNvbS91c2Vycy9qcmV2ZWxzL2ZvbGxvd2luZ3svb3RoZXJfdXNlcn0iLCJnaXN0c191cmwiOiJodHRwczovL2FwaS5naXRodWIuY29tL3VzZXJzL2pyZXZlbHMvZ2lzdHN7L2dpc3RfaWR9Iiwic3RhcnJlZF91cmwiOiJodHRwczovL2FwaS5naXRodWIuY29tL3VzZXJzL2pyZXZlbHMvc3RhcnJlZHsvb3duZXJ9ey9yZXBvfSIsInN1YnNjcmlwdGlvbnNfdXJsIjoiaHR0cHM6Ly9hcGkuZ2l0aHViLmNvbS91c2Vycy9qcmV2ZWxzL3N1YnNjcmlwdGlvbnMiLCJvcmdhbml6YXRpb25zX3VybCI6Imh0dHBzOi8vYXBpLmdpdGh1Yi5jb20vdXNlcnMvanJldmVscy9vcmdzIiwicmVwb3NfdXJsIjoiaHR0cHM6Ly9hcGkuZ2l0aHViLmNvbS91c2Vycy9qcmV2ZWxzL3JlcG9zIiwiZXZlbnRzX3VybCI6Imh0dHBzOi8vYXBpLmdpdGh1Yi5jb20vdXNlcnMvanJldmVscy9ldmVudHN7L3ByaXZhY3l9IiwicmVjZWl2ZWRfZXZlbnRzX3VybCI6Imh0dHBzOi8vYXBpLmdpdGh1Yi5jb20vdXNlcnMvanJldmVscy9yZWNlaXZlZF9ldmVudHMiLCJ0eXBlIjoiVXNlciIsInNpdGVfYWRtaW4iOmZhbHNlfX0=" diff --git a/test/event_tests.jl b/test/event_tests.jl index 3b118bb..603f883 100644 --- a/test/event_tests.jl +++ b/test/event_tests.jl @@ -1,6 +1,6 @@ include("commit_comment.jl") event_request = create_event() -event_json = JSON.parse(HTTP.payload(event_request, String)) +event_json = JSON.parse(IOBuffer(HTTP.payload(event_request))) event = GitHub.event_from_payload!("commit_comment", event_json) @testset "WebhookEvent" begin diff --git a/test/ghtype_tests.jl b/test/ghtype_tests.jl index abe728c..f4fa964 100644 --- a/test/ghtype_tests.jl +++ b/test/ghtype_tests.jl @@ -12,7 +12,7 @@ function test_show(g::GitHub.GitHubType) @test repr(g) == String(take!(tmpio)) tmpio = IOBuffer() - showcompact(tmpio, g) + show(IOContext(tmpio, :compact => true), g) @test "$(typeof(g))($(repr(name(g))))" == String(take!(tmpio)) end @@ -540,7 +540,7 @@ end test_show(hook_result) end - + @testset "Gist" begin gist_json = JSON.parse(""" { @@ -734,7 +734,7 @@ end "updated_at": "2017-07-08T16:18:44" } """) - + app_result = App(app_json) @test name(app_result) == Int(app_json["id"]) end diff --git a/test/read_only_api_tests.jl b/test/read_only_api_tests.jl index 8cc4850..78c7480 100644 --- a/test/read_only_api_tests.jl +++ b/test/read_only_api_tests.jl @@ -189,7 +189,7 @@ end @test entry["type"] == "blob" b = blob(github_jl, entry["sha"]; auth=auth) - @test contains(String(base64decode(replace(get(b.content),"\n" => ""))), "GitHub.jl") + @test occursin("GitHub.jl", String(base64decode(replace(get(b.content),"\n" => "")))) break end