From 64cb3f4f9162b9c38da3c9b4d52f7e0e7323eb01 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 10 Oct 2024 18:16:43 +0200 Subject: [PATCH 1/6] Test repo slug for buildkite --- src/codecovio.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/codecovio.jl b/src/codecovio.jl index 0cf2129..2ccf160 100644 --- a/src/codecovio.jl +++ b/src/codecovio.jl @@ -173,6 +173,12 @@ function add_ci_to_kwargs(kwargs::Dict) build = ENV["BUILDKITE_BUILD_NUMBER"], build_url = ENV["BUILDKITE_BUILD_URL"] ) + buildkite_repo = ENV["BUILDKITE_REPO"] + # TODO: This only works for GitHub repos right now + m = match(r"/^(?:https:\/\/|git@)github.com(?:\/|:)(?.*?)\.git$/gm", buildkite_repo) + if m !== nothing + kwargs = set_defaults(kwargs, slug = String(m[:slug])) + end if ENV["BUILDKITE_PULL_REQUEST"] != "false" kwargs = set_defaults(kwargs, pr = ENV["BUILDKITE_PULL_REQUEST"]) end From d20ecc79dbac62891e256b4af9fdf993a03e442f Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 10 Oct 2024 18:21:11 +0200 Subject: [PATCH 2/6] test repo --- src/codecovio.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codecovio.jl b/src/codecovio.jl index 2ccf160..ef38bf1 100644 --- a/src/codecovio.jl +++ b/src/codecovio.jl @@ -177,7 +177,7 @@ function add_ci_to_kwargs(kwargs::Dict) # TODO: This only works for GitHub repos right now m = match(r"/^(?:https:\/\/|git@)github.com(?:\/|:)(?.*?)\.git$/gm", buildkite_repo) if m !== nothing - kwargs = set_defaults(kwargs, slug = String(m[:slug])) + kwargs = set_defaults(kwargs, repo = String(m[:slug])) end if ENV["BUILDKITE_PULL_REQUEST"] != "false" kwargs = set_defaults(kwargs, pr = ENV["BUILDKITE_PULL_REQUEST"]) @@ -254,7 +254,7 @@ function submit_generic(fcs::Vector{FileCoverage}, kwargs::Dict) uri_str = construct_uri_string(kwargs) @info "Submitting data to Codecov..." - @debug "Codecov.io API URL:\n" * mask_token(uri_str) + @info "Codecov.io API URL:\n" * mask_token(uri_str) is_black_hole_server = parse(Bool, strip(get(ENV, "JULIA_COVERAGE_IS_BLACK_HOLE_SERVER", "false")))::Bool if !dry_run From 232ac28af69baab4435b51b22092b8b792a54896 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 10 Oct 2024 18:29:23 +0200 Subject: [PATCH 3/6] More debug output --- src/codecovio.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/codecovio.jl b/src/codecovio.jl index ef38bf1..23965bb 100644 --- a/src/codecovio.jl +++ b/src/codecovio.jl @@ -174,9 +174,11 @@ function add_ci_to_kwargs(kwargs::Dict) build_url = ENV["BUILDKITE_BUILD_URL"] ) buildkite_repo = ENV["BUILDKITE_REPO"] + @info "BUILDKITE_REPO: $buildkite_repo" # TODO: This only works for GitHub repos right now m = match(r"/^(?:https:\/\/|git@)github.com(?:\/|:)(?.*?)\.git$/gm", buildkite_repo) if m !== nothing + @info "BUILDKITE_REPO matched: $(m[:slug])" kwargs = set_defaults(kwargs, repo = String(m[:slug])) end if ENV["BUILDKITE_PULL_REQUEST"] != "false" @@ -310,6 +312,7 @@ function construct_uri_string(kwargs::Dict) # (:verbose is there for backwards compatibility with versions # of this code that treated it in a special way) if k != :codecov_url && k != :dry_run && k != :verbose + @info "Adding key-value pair to URL: $(k)=$(v)" uri_str = "$(uri_str)$(k)=$(v)&" end end From b26591be68c2596ca2fe85f0ff2cc1a917365771 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 10 Oct 2024 18:31:49 +0200 Subject: [PATCH 4/6] duh --- src/codecovio.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codecovio.jl b/src/codecovio.jl index 23965bb..d622d92 100644 --- a/src/codecovio.jl +++ b/src/codecovio.jl @@ -176,7 +176,7 @@ function add_ci_to_kwargs(kwargs::Dict) buildkite_repo = ENV["BUILDKITE_REPO"] @info "BUILDKITE_REPO: $buildkite_repo" # TODO: This only works for GitHub repos right now - m = match(r"/^(?:https:\/\/|git@)github.com(?:\/|:)(?.*?)\.git$/gm", buildkite_repo) + m = match(r"^(?:https:\/\/|git@)github.com(?:\/|:)(?.*?)\.git$", buildkite_repo) if m !== nothing @info "BUILDKITE_REPO matched: $(m[:slug])" kwargs = set_defaults(kwargs, repo = String(m[:slug])) From 642dfe1b95a9dc95baaf2ef80709d85abec5e77b Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 10 Oct 2024 18:32:30 +0200 Subject: [PATCH 5/6] fsfd --- src/codecovio.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/codecovio.jl b/src/codecovio.jl index d622d92..8052da0 100644 --- a/src/codecovio.jl +++ b/src/codecovio.jl @@ -179,7 +179,8 @@ function add_ci_to_kwargs(kwargs::Dict) m = match(r"^(?:https:\/\/|git@)github.com(?:\/|:)(?.*?)\.git$", buildkite_repo) if m !== nothing @info "BUILDKITE_REPO matched: $(m[:slug])" - kwargs = set_defaults(kwargs, repo = String(m[:slug])) + kwargs = set_defaults(kwargs, slug = String(m[:slug])) + # kwargs = set_defaults(kwargs, repo = String(m[:slug])) end if ENV["BUILDKITE_PULL_REQUEST"] != "false" kwargs = set_defaults(kwargs, pr = ENV["BUILDKITE_PULL_REQUEST"]) From b3117af4f5b3e6a8489c849ec6a300da1450c11f Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 10 Oct 2024 18:56:20 +0200 Subject: [PATCH 6/6] Update codecovio.jl --- src/codecovio.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codecovio.jl b/src/codecovio.jl index 8052da0..79b4b43 100644 --- a/src/codecovio.jl +++ b/src/codecovio.jl @@ -179,8 +179,8 @@ function add_ci_to_kwargs(kwargs::Dict) m = match(r"^(?:https:\/\/|git@)github.com(?:\/|:)(?.*?)\.git$", buildkite_repo) if m !== nothing @info "BUILDKITE_REPO matched: $(m[:slug])" - kwargs = set_defaults(kwargs, slug = String(m[:slug])) - # kwargs = set_defaults(kwargs, repo = String(m[:slug])) + # kwargs = set_defaults(kwargs, slug = String(m[:slug])) + kwargs = set_defaults(kwargs, repo = String(m[:slug])) end if ENV["BUILDKITE_PULL_REQUEST"] != "false" kwargs = set_defaults(kwargs, pr = ENV["BUILDKITE_PULL_REQUEST"])