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

remove deprecations and depwarns #295

Merged
merged 1 commit into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions src/codecovio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Codecov
using JSON
using LibGit2

export submit, submit_token, submit_local, submit_generic
export submit, submit_local, submit_generic

#=
JSON structure for Codecov.io
Expand Down Expand Up @@ -192,16 +192,9 @@ module Codecov
end
end

if haskey(ENV, "REPO_TOKEN")
@warn "the environment variable REPO_TOKEN is deprecated, use CODECOV_TOKEN instead"
kwargs = set_defaults(kwargs, token = ENV["REPO_TOKEN"])
end

return kwargs
end

@deprecate submit_token submit_local


"""
submit_generic(fcs::Vector{FileCoverage})
Expand All @@ -220,18 +213,11 @@ module Codecov
function submit_generic(fcs::Vector{FileCoverage}, kwargs::Dict)
@assert length(kwargs) > 0
dry_run = get(kwargs, :dry_run, false)
if haskey(kwargs, :verbose)
Base.depwarn("The verbose keyword argument is deprecated, set the environment variable " *
"JULIA_DEBUG=Coverage for verbose output", :submit_generic)
verbose = kwargs[:verbose]
else
verbose = false
end

uri_str = construct_uri_string(kwargs)

verbose && @info "Submitting data to Codecov..."
verbose && @debug "Codecov.io API URL:\n" * mask_token(uri_str)
@info "Submitting data to Codecov..."
@debug "Codecov.io API URL:\n" * mask_token(uri_str)

if !dry_run
heads = Dict("Content-Type" => "application/json")
Expand Down
27 changes: 6 additions & 21 deletions src/coveralls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Coveralls
using LibGit2
using MbedTLS

export submit, submit_token, submit_local
export submit, submit_local

#=
JSON structure for Coveralls
Expand Down Expand Up @@ -62,15 +62,8 @@ module Coveralls
on TravisCI, AppVeyor or Jenkins. If running locally, use `submit_local`.
"""
function submit(fcs::Vector{FileCoverage}; kwargs...)
if haskey(kwargs, :verbose)
Base.depwarn("The verbose keyword argument is deprecated, set the environment variable " *
"JULIA_DEBUG=Coverage for verbose output", :submit_generic)
verbose = kwargs[:verbose]
else
verbose = false
end
data = prepare_request(fcs, false)
post_request(data, verbose)
post_request(data)
end

function prepare_request(fcs::Vector{FileCoverage}, local_env::Bool, git_info=query_git_info)
Expand Down Expand Up @@ -204,23 +197,16 @@ module Coveralls
git_info can be either a `Dict` or a function that returns a `Dict`.
"""
function submit_local(fcs::Vector{FileCoverage}, git_info=query_git_info; kwargs...)
if haskey(kwargs, :verbose)
Base.depwarn("The verbose keyword argument is deprecated, set the environment variable " *
"JULIA_DEBUG=Coverage for verbose output", :submit_generic)
verbose = kwargs[:verbose]
else
verbose = false
end
data = prepare_request(fcs, true, git_info)
post_request(data, verbose)
post_request(data)
end

# posts the actual request given the data
function post_request(data, verbose)
verbose && @info "Submitting data to Coveralls..."
function post_request(data)
@info "Submitting data to Coveralls..."
coveralls_url = get(ENV, "COVERALLS_URL", "https://coveralls.io/api/v1/jobs")
req = HTTP.post(coveralls_url, HTTP.Form(makebody(data)))
verbose && @debug "Result of submission:\n" * String(req.body)
@debug "Result of submission:\n" * String(req)
nothing
end

Expand All @@ -240,6 +226,5 @@ module Coveralls
end
return data
end
@deprecate submit_token submit_local

end # module Coveralls