From 22f91f55595b613c3c70b9b6593e2fe135268df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20B=C3=B6ker?= Date: Mon, 6 Nov 2023 21:32:17 +0100 Subject: [PATCH] Rename hook-url to web-url. It's not only hooks --- config-prod.yml | 2 +- lib/Config.rakumod | 8 ++++---- lib/GitHubCITestRequester.rakumod | 2 +- lib/OBS.rakumod | 2 +- lib/RakudoCIBot.rakumod | 8 ++++---- t/data/config-test.yml | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config-prod.yml b/config-prod.yml index 8e0d113..6f5d05f 100644 --- a/config-prod.yml +++ b/config-prod.yml @@ -29,7 +29,7 @@ projects: slug: MoarVM/MoarVM install-id: 20243470 -hook-url: https://cibot.rakudo.org/ +web-url: https://cibot.rakudo.org/ jwt-secret: "N#xTe4>IGSWfH#M&MYXxI~#w9yj@X8X/g8-N{;n)5D>kFh~AaW" obs-user: some_user diff --git a/lib/Config.rakumod b/lib/Config.rakumod index 1660d37..8ad198a 100644 --- a/lib/Config.rakumod +++ b/lib/Config.rakumod @@ -49,7 +49,7 @@ class Config { has $.github-app-key-file; has $.projects; - has $.hook-url; + has $.web-url; has $.jwt-secret; has $.obs-user; @@ -85,8 +85,8 @@ class Config { has $.log-level; submethod TWEAK() { - unless $!hook-url.ends-with('/') { - $!hook-url ~= '/'; + unless $!web-url.ends-with('/') { + $!web-url ~= '/'; } } @@ -104,7 +104,7 @@ class Config { moar => ConfigProject.from-config(%config), ), - hook-url => %config, + web-url => %config, jwt-secret => %config, obs-user => %config, diff --git a/lib/GitHubCITestRequester.rakumod b/lib/GitHubCITestRequester.rakumod index 9a3ab89..ae4f54e 100644 --- a/lib/GitHubCITestRequester.rakumod +++ b/lib/GitHubCITestRequester.rakumod @@ -298,7 +298,7 @@ method process-worklist() is serial-dedup { repo => %project-and-repo, name => $test.name, sha => $ts.commit-sha, - url => config.hook-url ~ "testset/" ~ $ts.id, + url => config.web-url ~ "testset/" ~ $ts.id, id => $test.id, started-at => DateTime.now, status => $gh-status, diff --git a/lib/OBS.rakumod b/lib/OBS.rakumod index 477eb12..a9072a9 100644 --- a/lib/OBS.rakumod +++ b/lib/OBS.rakumod @@ -116,7 +116,7 @@ method process-worklist() is serial-dedup { $spec ~~ s{ '' } = $source-id; $spec ~~ s{ '' } = $source-id; $spec ~~ s{ '' } = $source-id; - $spec ~~ s{ '' } = config.hook-url ~ $!hook-suffix ~ "?pts-id=" ~ $running-pts.id; + $spec ~~ s{ '' } = config.web-url ~ $!hook-suffix ~ "?pts-id=" ~ $running-pts.id; $!interface.upload-file($package, $package ~ ".spec", :blob($spec)); my $dom = $!interface.commit($package); } diff --git a/lib/RakudoCIBot.rakumod b/lib/RakudoCIBot.rakumod index 4195588..36bb02e 100644 --- a/lib/RakudoCIBot.rakumod +++ b/lib/RakudoCIBot.rakumod @@ -65,7 +65,7 @@ submethod TWEAK() { client-secret => config.github-client-secret, pem => $gh-pem, processor => $!requester, - redirect-url => config.hook-url ~ "gh-oauth-callback", + redirect-url => config.web-url ~ "gh-oauth-callback", ; $!requester.github-interface = $!github-interface; $!testset-manager.register-status-listener($!requester); @@ -140,9 +140,9 @@ method start() { $http.start; say "Listening at http://{config.web-host}:{config.web-port}"; - say "GitHub Homepage URL: {config.hook-url}"; - say "GitHub Callback URL: {config.hook-url}gh-oauth-callback"; - say "GitHub Webhook URL: {config.hook-url}github-hook"; + say "GitHub Homepage URL: {config.web-url}"; + say "GitHub Callback URL: {config.web-url}gh-oauth-callback"; + say "GitHub Webhook URL: {config.web-url}github-hook"; } method stop() { diff --git a/t/data/config-test.yml b/t/data/config-test.yml index c98b38a..0c90f2d 100644 --- a/t/data/config-test.yml +++ b/t/data/config-test.yml @@ -27,7 +27,7 @@ projects: repo-url: https://github.com/MoarVM/MoarVM.git install-id: 20243470 -hook-url: https://rcb-host.org/ +web-url: https://rcb-host.org/ obs-user: someuser obs-password: "some_password"