From 2f0b627a00a5b767939e5d211794af814e0347ee Mon Sep 17 00:00:00 2001 From: Chris de Graaf Date: Mon, 7 Dec 2020 15:05:54 -0600 Subject: [PATCH 1/4] Bump HTTP compat --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 279ec57a..f4e549b7 100644 --- a/Project.toml +++ b/Project.toml @@ -23,7 +23,7 @@ VisualStringDistances = "089bb0c6-1854-47b9-96f7-327dbbe09dca" [compat] GitHub = "5.2" -HTTP = "0.8, 0.9" +HTTP = "0.8, 0.9.1" JSON = "0.19, 0.20, 0.21" RegistryTools = "1.2" StringDistances = "0.9, 0.10" From baf99355e93934e85dab8c0095bada5a47673361 Mon Sep 17 00:00:00 2001 From: Chris de Graaf Date: Tue, 1 Dec 2020 16:54:19 -0600 Subject: [PATCH 2/4] Handle repos where issues are disabled --- Project.toml | 2 +- src/TagBot/TagBot.jl | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index f4e549b7..bda8f1ec 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "RegistryCI" uuid = "0c95cc5f-2f7e-43fe-82dd-79dbcba86b32" authors = ["Dilum Aluthge ", "Fredrik Ekre "] -version = "4.5.0" +version = "4.5.1" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/src/TagBot/TagBot.jl b/src/TagBot/TagBot.jl index 284376d6..676baa23 100644 --- a/src/TagBot/TagBot.jl +++ b/src/TagBot/TagBot.jl @@ -84,10 +84,16 @@ function get_repo_notification_issue(repo) filter!(x -> x.pull_request === nothing, issues) return if isempty(issues) @info "Creating new notification issue" - issue = GH.create_issue(repo; auth=AUTH[], params=(; - title=ISSUE_TITLE, - body=ISSUE_BODY, - )) + issue = try + GH.create_issue(repo; auth=AUTH[], params=(; + title=ISSUE_TITLE, + body=ISSUE_BODY, + )) + catch e + occursin("Issues are disabled", e.msg) || rethrow() + @info "Issues are disabled on $repo" + return nothing + end GH.edit_issue(repo, issue; auth=AUTH[], params=(; state="closed")) issue else @@ -131,6 +137,10 @@ function maybe_notify(event, repo, version; cron=false) return end issue = get_repo_notification_issue(repo) + if issue === nothing + @info "Couldn't get notification issue for $repo" + return + end if cron && should_fixup(repo, issue) @info "Opening fixup PR for $repo" open_fixup_pr(repo) From 1ab40f0626ba21b5cdec63020a4cea6cbadbc225 Mon Sep 17 00:00:00 2001 From: Chris de Graaf Date: Thu, 3 Dec 2020 10:01:47 -0600 Subject: [PATCH 3/4] Fix test --- test/tagbot-unit.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tagbot-unit.jl b/test/tagbot-unit.jl index a6f44cf2..8b3c63b6 100644 --- a/test/tagbot-unit.jl +++ b/test/tagbot-unit.jl @@ -53,7 +53,7 @@ end @testset "get_repo_notification_issue" begin playback("get_repo_notification_issue.bson") do - @test_logs (:info, "Creating new notification issue") begin + @test_logs match_mode=:any (:info, "Creating new notification issue") begin issue = TB.get_repo_notification_issue("christopher-dG/TestRepo") @test issue.number == 11 end From 6690f3caaa7605d82d47a489b077465161b74ea6 Mon Sep 17 00:00:00 2001 From: Chris de Graaf Date: Tue, 8 Dec 2020 09:20:39 -0600 Subject: [PATCH 4/4] Whyyyyyyy --- test/tagbot-unit.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tagbot-unit.jl b/test/tagbot-unit.jl index 8b3c63b6..69bfdb75 100644 --- a/test/tagbot-unit.jl +++ b/test/tagbot-unit.jl @@ -57,7 +57,7 @@ end issue = TB.get_repo_notification_issue("christopher-dG/TestRepo") @test issue.number == 11 end - @test_logs (:info, "Found existing notification issue") begin + @test_logs match_mode=:any (:info, "Found existing notification issue") begin issue = TB.get_repo_notification_issue("christopher-dG/TestRepo") @test issue.number == 11 end