From 584659e727483db5a88bb1d9092d4018229ad78b Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Mon, 28 Oct 2024 20:30:31 +0100 Subject: [PATCH] treewide: remove GitHub, generalize, introduce Gerrit Signed-off-by: Raito Bezarius --- Cargo.lock | 1087 +++++++++++++--------- ofborg/Cargo.toml | 7 +- ofborg/src/commitstatus.rs | 28 - ofborg/src/config.rs | 104 +-- ofborg/src/lib.rs | 2 + ofborg/src/message/buildresult.rs | 15 - ofborg/src/tasks/eval/mod.rs | 3 +- ofborg/src/vcs/generic.rs | 40 + ofborg/src/vcs/gerrit/data_structures.rs | 318 +++++++ ofborg/src/vcs/gerrit/events.rs | 45 + ofborg/src/vcs/gerrit/mod.rs | 2 + ofborg/src/vcs/github.rs | 141 +++ ofborg/src/vcs/mod.rs | 3 + 13 files changed, 1214 insertions(+), 581 deletions(-) create mode 100644 ofborg/src/vcs/generic.rs create mode 100644 ofborg/src/vcs/gerrit/data_structures.rs create mode 100644 ofborg/src/vcs/gerrit/events.rs create mode 100644 ofborg/src/vcs/gerrit/mod.rs create mode 100644 ofborg/src/vcs/github.rs create mode 100644 ofborg/src/vcs/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 45ee1b0..ada1c3d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,21 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "aho-corasick" version = "0.7.19" @@ -55,8 +70,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56987108bf48d2eb500cae8896cd9291564eedd8744776ecc5c3338a8b2ca5f8" dependencies = [ "amq-protocol-types", - "percent-encoding 2.1.0", - "url 2.3.0", + "percent-encoding", + "url", ] [[package]] @@ -131,11 +146,11 @@ dependencies = [ "concurrent-queue 1.2.4", "futures-lite", "libc", - "log 0.4.17", + "log", "parking", "polling", "slab", - "socket2", + "socket2 0.4.7", "waker-fn", "winapi", ] @@ -198,7 +213,7 @@ dependencies = [ "futures-lite", "gloo-timers", "kv-log-macro", - "log 0.4.17", + "log", "memchr", "once_cell", "pin-project-lite", @@ -221,7 +236,7 @@ checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -237,39 +252,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] -name = "base64" -version = "0.9.3" +name = "backtrace" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "byteorder", - "safemem", + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", ] -[[package]] -name = "base64" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + [[package]] name = "block-buffer" version = "0.10.3" @@ -314,17 +334,11 @@ version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - [[package]] name = "bytes" -version = "1.1.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cache-padded" @@ -463,7 +477,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -490,7 +504,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.103", ] [[package]] @@ -507,15 +521,9 @@ checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] -[[package]] -name = "data-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" - [[package]] name = "des" version = "0.8.1" @@ -527,9 +535,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.5" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -550,13 +558,19 @@ checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "event-listener" version = "2.5.3" @@ -600,13 +614,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "form_urlencoded" -version = "1.0.1" +name = "foreign-types" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "matches", - "percent-encoding 2.1.0", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", ] [[package]] @@ -619,20 +647,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "futures" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - [[package]] name = "futures-channel" version = "0.3.25" @@ -640,14 +654,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", - "futures-sink", ] [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-io" @@ -672,13 +685,13 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.25" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.85", ] [[package]] @@ -689,19 +702,18 @@ checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-macro", - "futures-sink", "futures-task", "pin-project-lite", "pin-utils", @@ -729,6 +741,12 @@ dependencies = [ "wasi 0.11.0+wasi-snapshot-preview1", ] +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + [[package]] name = "gloo-timers" version = "0.2.4" @@ -743,16 +761,16 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.15" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", - "http", + "http 1.1.0", "indexmap", "slab", "tokio", @@ -762,18 +780,15 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hmac" @@ -796,119 +811,115 @@ dependencies = [ ] [[package]] -name = "http-body" -version = "0.4.5" +name = "http" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", - "http", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" - -[[package]] -name = "hubcaps" -version = "0.6.2" -source = "git+https://github.com/softprops/hubcaps.git?rev=d60d157b6638760fc725b2e4e4f329a4ec6b901e#d60d157b6638760fc725b2e4e4f329a4ec6b901e" -dependencies = [ - "base64 0.13.1", - "data-encoding", - "futures", - "http", - "hyperx", - "jsonwebtoken", - "log 0.4.17", - "mime 0.3.16", - "percent-encoding 2.1.0", - "reqwest", - "serde", - "serde_derive", - "serde_json", - "url 2.3.0", -] +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "hyper" -version = "0.10.16" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" -dependencies = [ - "base64 0.9.3", - "httparse", - "language-tags 0.2.2", - "log 0.3.9", - "mime 0.2.6", - "num_cpus", - "time", - "traitobject", - "typeable", - "unicase 1.4.2", - "url 1.7.2", -] - -[[package]] -name = "hyper" -version = "0.14.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", - "http", + "http 1.1.0", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ - "http", - "hyper 0.14.23", - "rustls", + "futures-util", + "http 1.1.0", + "hyper", + "hyper-util", + "rustls 0.23.16", + "rustls-pki-types", "tokio", "tokio-rustls", + "tower-service", ] [[package]] -name = "hyperx" -version = "1.4.0" +name = "hyper-tls" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5617e92fc2f2501c3e2bc6ce547cad841adba2bae5b921c7e52510beca6d084c" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ - "base64 0.13.1", "bytes", - "http", - "httpdate", - "language-tags 0.3.2", - "mime 0.3.16", - "percent-encoding 2.1.0", - "unicase 2.6.0", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body", + "hyper", + "pin-project-lite", + "socket2 0.5.7", + "tokio", + "tower-service", + "tracing", ] [[package]] @@ -937,33 +948,21 @@ dependencies = [ [[package]] name = "idna" -version = "0.1.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" -version = "1.9.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ - "autocfg", + "equivalent", "hashbrown", ] @@ -988,9 +987,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.5.1" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "itoa" @@ -1007,41 +1006,15 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonwebtoken" -version = "7.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afabcc15e437a6484fc4f12d0fd63068fe457bf93f1c148d3d9649c60b103f32" -dependencies = [ - "base64 0.12.3", - "pem", - "ring", - "serde", - "serde_json", - "simple_asn1", -] - [[package]] name = "kv-log-macro" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" dependencies = [ - "log 0.4.17", + "log", ] -[[package]] -name = "language-tags" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" - -[[package]] -name = "language-tags" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" - [[package]] name = "lapin" version = "2.1.1" @@ -1072,9 +1045,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.137" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "link-cplusplus" @@ -1101,15 +1074,6 @@ dependencies = [ "scopeguard", ] -[[package]] -name = "log" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -dependencies = [ - "log 0.4.17", -] - [[package]] name = "log" version = "0.4.17" @@ -1138,12 +1102,6 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - [[package]] name = "md5" version = "0.7.0" @@ -1158,18 +1116,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "mime" -version = "0.2.6" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -dependencies = [ - "log 0.3.9", -] - -[[package]] -name = "mime" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minimal-lexical" @@ -1178,15 +1127,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] -name = "mio" -version = "0.8.5" +name = "miniz_oxide" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ "libc", - "log 0.4.17", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.42.0", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", ] [[package]] @@ -1219,17 +1194,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-bigint" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-integer" version = "0.1.45" @@ -1250,13 +1214,12 @@ dependencies = [ ] [[package]] -name = "num_cpus" -version = "1.14.0" +name = "object" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ - "hermit-abi", - "libc", + "memchr", ] [[package]] @@ -1269,15 +1232,15 @@ dependencies = [ "either", "fs2", "futures-util", - "http", - "hubcaps", - "hyper 0.10.16", + "http 0.2.8", + "hyper", "lapin", "lru-cache", "md5", "nom 4.2.3", "regex", - "rustls-pemfile", + "reqwest", + "rustls-pemfile 1.0.2", "separator", "serde", "serde_derive", @@ -1293,15 +1256,41 @@ dependencies = [ name = "ofborg-simple-build" version = "0.1.0" dependencies = [ - "log 0.4.17", + "log", "ofborg", ] [[package]] name = "once_cell" -version = "1.16.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "openssl" +version = "0.10.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] [[package]] name = "openssl-probe" @@ -1309,6 +1298,18 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-sys" +version = "0.9.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "overload" version = "0.1.1" @@ -1361,28 +1362,11 @@ dependencies = [ "windows-sys 0.42.0", ] -[[package]] -name = "pem" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd56cbd21fea48d0c440b41cd69c589faacade08c992d9a54e471b79d0fd13eb" -dependencies = [ - "base64 0.13.1", - "once_cell", - "regex", -] - [[package]] name = "percent-encoding" -version = "1.0.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" @@ -1401,14 +1385,14 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -1428,6 +1412,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + [[package]] name = "polling" version = "2.4.0" @@ -1437,25 +1427,25 @@ dependencies = [ "autocfg", "cfg-if", "libc", - "log 0.4.17", + "log", "wepoll-ffi", "winapi", ] [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.21" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1486,7 +1476,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1526,41 +1516,45 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.12" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ - "base64 0.13.1", + "base64 0.22.1", "bytes", "encoding_rs", "futures-core", "futures-util", "h2", - "http", + "http 1.1.0", "http-body", - "hyper 0.14.23", + "http-body-util", + "hyper", "hyper-rustls", + "hyper-tls", + "hyper-util", "ipnet", "js-sys", - "log 0.4.17", - "mime 0.3.16", + "log", + "mime", + "native-tls", "once_cell", - "percent-encoding 2.1.0", + "percent-encoding", "pin-project-lite", - "rustls", - "rustls-pemfile", + "rustls-pemfile 2.2.0", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", + "system-configuration", "tokio", - "tokio-rustls", + "tokio-native-tls", "tower-service", - "url 2.3.0", + "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", - "winreg", + "windows-registry", ] [[package]] @@ -1573,31 +1567,64 @@ dependencies = [ "libc", "once_cell", "spin 0.5.2", - "untrusted", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.4", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + [[package]] name = "rustls" version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" dependencies = [ - "log 0.4.17", - "ring", + "log", + "ring 0.16.20", "sct", "webpki", ] +[[package]] +name = "rustls" +version = "0.23.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + [[package]] name = "rustls-connector" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c6a18f8d10f71bce9bca6eaeb80429460e652f3bcf0381f0c5f8954abf7b3b8" dependencies = [ - "log 0.4.17", - "rustls", + "log", + "rustls 0.20.7", "rustls-native-certs", "webpki", ] @@ -1609,7 +1636,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.2", "schannel", "security-framework", ] @@ -1623,18 +1650,38 @@ dependencies = [ "base64 0.21.0", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring 0.17.3", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "ryu" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" - [[package]] name = "schannel" version = "0.1.20" @@ -1663,8 +1710,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -1673,7 +1720,7 @@ version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -1713,7 +1760,7 @@ checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -1778,17 +1825,6 @@ dependencies = [ "libc", ] -[[package]] -name = "simple_asn1" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692ca13de57ce0613a363c8c2f1de925adebc81b04c923ac60c5488bb44abe4b" -dependencies = [ - "chrono", - "num-bigint", - "num-traits", -] - [[package]] name = "slab" version = "0.4.7" @@ -1800,9 +1836,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" @@ -1814,6 +1850,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "spin" version = "0.5.2" @@ -1831,9 +1877,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.4.1" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1846,6 +1892,26 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] + [[package]] name = "sys-info" version = "0.9.1" @@ -1856,6 +1922,27 @@ dependencies = [ "libc", ] +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tcp-stream" version = "0.24.4" @@ -1865,7 +1952,7 @@ dependencies = [ "cfg-if", "p12", "rustls-connector", - "rustls-pemfile", + "rustls-pemfile 1.0.2", ] [[package]] @@ -1928,51 +2015,58 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.21.2" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", - "num_cpus", "pin-project-lite", - "socket2", - "winapi", + "socket2 0.5.7", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", ] [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls", + "rustls 0.23.16", + "rustls-pki-types", "tokio", - "webpki", ] [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -1994,7 +2088,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -2014,7 +2108,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ "lazy_static", - "log 0.4.17", + "log", "tracing-core", ] @@ -2049,53 +2143,23 @@ dependencies = [ "tracing-serde", ] -[[package]] -name = "traitobject" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" - [[package]] name = "try-lock" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" -[[package]] -name = "typeable" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" - [[package]] name = "typenum" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" -[[package]] -name = "unicase" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -dependencies = [ - "version_check 0.1.5", -] - -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check 0.9.4", -] - [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" @@ -2125,25 +2189,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] -name = "url" -version = "1.7.2" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -dependencies = [ - "idna 0.1.5", - "matches", - "percent-encoding 1.0.1", -] +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.3.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fe195a4f217c25b25cb5058ced57059824a678474874038dc88d211bf508d3" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", - "idna 0.2.3", - "percent-encoding 2.1.0", + "idna", + "percent-encoding", ] [[package]] @@ -2171,6 +2230,12 @@ dependencies = [ "version_check 0.9.4", ] +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.1.5" @@ -2195,7 +2260,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" dependencies = [ - "log 0.4.17", + "log", "try-lock", ] @@ -2213,26 +2278,27 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", - "log 0.4.17", + "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.85", "wasm-bindgen-shared", ] @@ -2250,9 +2316,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2260,22 +2326,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-sys" @@ -2293,17 +2359,8 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -2346,6 +2403,36 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.36.1" @@ -2365,21 +2452,82 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", + "windows_aarch64_gnullvm 0.42.0", "windows_aarch64_msvc 0.42.0", "windows_i686_gnu 0.42.0", "windows_i686_msvc 0.42.0", "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm", + "windows_x86_64_gnullvm 0.42.0", "windows_x86_64_msvc 0.42.0", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" @@ -2392,6 +2540,18 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + [[package]] name = "windows_i686_gnu" version = "0.36.1" @@ -2404,6 +2564,24 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + [[package]] name = "windows_i686_msvc" version = "0.36.1" @@ -2416,6 +2594,18 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" @@ -2428,12 +2618,36 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" @@ -2447,16 +2661,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" [[package]] -name = "winreg" -version = "0.10.1" +name = "windows_x86_64_msvc" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "yasna" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "346d34a236c9d3e5f3b9b74563f238f955bbd05fa0b8b4efa53c130c43982f4c" + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/ofborg/Cargo.toml b/ofborg/Cargo.toml index a5361ad..eb6222a 100644 --- a/ofborg/Cargo.toml +++ b/ofborg/Cargo.toml @@ -12,11 +12,7 @@ chrono = "0.4.22" either = "1.8.0" fs2 = "0.4.3" futures-util = "0.3.25" -#hubcaps = "0.6" -# for Conclusion::Skipped which is in master -hubcaps = { git = "https://github.com/softprops/hubcaps.git", rev = "d60d157b6638760fc725b2e4e4f329a4ec6b901e", default-features = false, features = ["app", "rustls-tls"] } -# hyper = { version = "0.14", features = ["full"] } -hyper = "=0.10.*" +hyper = { version = "1.5.0", features = [ "client" ], package = "hyper" } # maybe can be removed when hyper is updated http = "0.2" lapin = "2.1.1" @@ -34,3 +30,4 @@ tracing = "0.1.37" tracing-subscriber = { version = "0.3.16", features = ["json", "env-filter"] } uuid = { version = "1.2", features = ["v4"] } rustls-pemfile = "1.0.2" +reqwest = "0.12.9" diff --git a/ofborg/src/commitstatus.rs b/ofborg/src/commitstatus.rs index cbc29a5..ba13715 100644 --- a/ofborg/src/commitstatus.rs +++ b/ofborg/src/commitstatus.rs @@ -72,31 +72,3 @@ impl CommitStatus { ) } } - -#[derive(Debug)] -pub enum CommitStatusError { - ExpiredCreds(hubcaps::Error), - MissingSha(hubcaps::Error), - Error(hubcaps::Error), -} - -impl From for CommitStatusError { - fn from(e: hubcaps::Error) -> CommitStatusError { - use http::status::StatusCode; - use hubcaps::Error; - match &e { - Error::Fault { code, error } - if code == &StatusCode::UNAUTHORIZED && error.message == "Bad credentials" => - { - CommitStatusError::ExpiredCreds(e) - } - Error::Fault { code, error } - if code == &StatusCode::UNPROCESSABLE_ENTITY - && error.message.starts_with("No commit found for SHA:") => - { - CommitStatusError::MissingSha(e) - } - _otherwise => CommitStatusError::Error(e), - } - } -} diff --git a/ofborg/src/config.rs b/ofborg/src/config.rs index 4522337..0c1c830 100644 --- a/ofborg/src/config.rs +++ b/ofborg/src/config.rs @@ -1,26 +1,24 @@ use crate::acl; use crate::nix::Nix; -use std::collections::HashMap; use std::fmt; use std::fs::File; -use std::io::{BufReader, Read}; +use std::io::Read; use std::marker::PhantomData; use std::path::{Path, PathBuf}; -use hubcaps::{Credentials, Github, InstallationTokenGenerator, JWTCredentials}; use serde::de::{self, Deserialize, Deserializer}; -use tracing::{debug, error, info, warn}; +use tracing::error; #[derive(Serialize, Deserialize, Debug)] -pub struct Config { +pub struct Config +{ pub runner: RunnerConfig, pub feedback: FeedbackConfig, pub checkout: CheckoutConfig, pub nix: NixConfig, pub rabbitmq: RabbitMqConfig, - pub github: Option, - pub github_app: Option, + // TODO: reintroduce VCS configuration somehow pub log_storage: Option, } @@ -47,17 +45,6 @@ pub struct NixConfig { pub initial_heap_size: Option, } -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct GithubConfig { - pub token_file: PathBuf, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct GithubAppConfig { - pub app_id: u64, - pub private_key: PathBuf, -} - #[derive(Serialize, Deserialize, Debug, Clone)] pub struct LogStorage { pub path: String, @@ -117,25 +104,6 @@ impl Config { acl::Acl::new(repos, trusted_users) } - pub fn github(&self) -> Github { - let token = std::fs::read_to_string(self.github.clone().unwrap().token_file) - .expect("Couldn't read from GitHub token file"); - Github::new( - "github.com/grahamc/ofborg", - // tls configured hyper client - Credentials::Token(token), - ) - .expect("Unable to create a github client instance") - } - - pub fn github_app_vendingmachine(&self) -> GithubAppVendingMachine { - GithubAppVendingMachine { - conf: self.github_app.clone().unwrap(), - id_cache: HashMap::new(), - client_cache: HashMap::new(), - } - } - pub fn nix(&self) -> Nix { if self.nix.build_timeout_seconds < 1200 { error!(?self.nix.build_timeout_seconds, "Please set build_timeout_seconds to at least 1200"); @@ -180,68 +148,6 @@ pub fn load(filename: &Path) -> Config { deserialized } -pub struct GithubAppVendingMachine { - conf: GithubAppConfig, - id_cache: HashMap<(String, String), Option>, - client_cache: HashMap, -} - -impl GithubAppVendingMachine { - fn useragent(&self) -> &'static str { - "github.com/grahamc/ofborg (app)" - } - - fn jwt(&self) -> JWTCredentials { - let private_key_file = - File::open(self.conf.private_key.clone()).expect("Unable to read private_key"); - let mut private_key_reader = BufReader::new(private_key_file); - let private_keys = rustls_pemfile::rsa_private_keys(&mut private_key_reader) - .expect("Unable to convert private_key to DER format"); - // We can be reasonably certain that there will only be one private key in this file - let private_key = &private_keys[0]; - JWTCredentials::new(self.conf.app_id, private_key.to_vec()) - .expect("Unable to create JWTCredentials") - } - - fn install_id_for_repo(&mut self, owner: &str, repo: &str) -> Option { - let useragent = self.useragent(); - let jwt = self.jwt(); - - let key = (owner.to_owned(), repo.to_owned()); - - *self.id_cache.entry(key).or_insert_with(|| { - info!("Looking up install ID for {}/{}", owner, repo); - - let lookup_gh = Github::new(useragent, Credentials::JWT(jwt)).unwrap(); - - match async_std::task::block_on(lookup_gh.app().find_repo_installation(owner, repo)) { - Ok(install_id) => { - debug!("Received install ID {:?}", install_id); - Some(install_id.id) - } - Err(e) => { - warn!("Error during install ID lookup: {:?}", e); - None - } - } - }) - } - - pub fn for_repo<'a>(&'a mut self, owner: &str, repo: &str) -> Option<&'a Github> { - let useragent = self.useragent(); - let jwt = self.jwt(); - let install_id = self.install_id_for_repo(owner, repo)?; - - Some(self.client_cache.entry(install_id).or_insert_with(|| { - Github::new( - useragent, - Credentials::InstallationToken(InstallationTokenGenerator::new(install_id, jwt)), - ) - .expect("Unable to create a github client instance") - })) - } -} - // Copied from https://stackoverflow.com/a/43627388 fn deserialize_one_or_many<'de, D>(deserializer: D) -> Result, D::Error> where diff --git a/ofborg/src/lib.rs b/ofborg/src/lib.rs index 35928c3..1c392e6 100644 --- a/ofborg/src/lib.rs +++ b/ofborg/src/lib.rs @@ -41,6 +41,7 @@ pub mod systems; pub mod tagger; pub mod tasks; pub mod test_scratch; +pub mod vcs; pub mod worker; pub mod writetoline; @@ -66,6 +67,7 @@ pub mod ofborg { pub use crate::tagger; pub use crate::tasks; pub use crate::test_scratch; + pub use crate::vcs; pub use crate::worker; pub use crate::writetoline; diff --git a/ofborg/src/message/buildresult.rs b/ofborg/src/message/buildresult.rs index 328c859..99f52e6 100644 --- a/ofborg/src/message/buildresult.rs +++ b/ofborg/src/message/buildresult.rs @@ -1,7 +1,5 @@ use crate::message::{Pr, Repo}; -use hubcaps::checks::Conclusion; - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] pub enum BuildStatus { Skipped, @@ -25,19 +23,6 @@ impl From for String { } } -impl From for Conclusion { - fn from(status: BuildStatus) -> Conclusion { - match status { - BuildStatus::Skipped => Conclusion::Skipped, - BuildStatus::Success => Conclusion::Success, - BuildStatus::Failure => Conclusion::Neutral, - BuildStatus::HashMismatch => Conclusion::Failure, - BuildStatus::TimedOut => Conclusion::Neutral, - BuildStatus::UnexpectedError { .. } => Conclusion::Neutral, - } - } -} - pub struct LegacyBuildResult { pub repo: Repo, pub pr: Pr, diff --git a/ofborg/src/tasks/eval/mod.rs b/ofborg/src/tasks/eval/mod.rs index 4e32ee6..50e329d 100644 --- a/ofborg/src/tasks/eval/mod.rs +++ b/ofborg/src/tasks/eval/mod.rs @@ -9,8 +9,7 @@ use crate::checkout::CachedProjectCo; use crate::commitstatus::{CommitStatus, CommitStatusError}; use crate::evalchecker::EvalChecker; use crate::message::buildjob::BuildJob; - -use hubcaps::checks::CheckRunOptions; +use crate::vcs::generic::CheckRunOptions; use std::path::Path; diff --git a/ofborg/src/vcs/generic.rs b/ofborg/src/vcs/generic.rs new file mode 100644 index 0000000..d7d2cef --- /dev/null +++ b/ofborg/src/vcs/generic.rs @@ -0,0 +1,40 @@ +/// Set of generic structures to abstract over a VCS in a richful way. +use serde::{Serialize, Deserialize}; + +#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CheckRunState { + Queued, + InProgress, + Completed, +} + +#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum Conclusion { + Skipped, + Success, + Failure, + Neutral, + Cancelled, + TimedOut, + ActionRequired, +} + +#[derive(Debug, Serialize, PartialEq)] +pub struct CheckRunOptions { + pub name: String, + pub head_sha: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub details_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub external_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub started_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub conclusion: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub completed_at: Option, +} diff --git a/ofborg/src/vcs/gerrit/data_structures.rs b/ofborg/src/vcs/gerrit/data_structures.rs new file mode 100644 index 0000000..dc77331 --- /dev/null +++ b/ofborg/src/vcs/gerrit/data_structures.rs @@ -0,0 +1,318 @@ +use std::collections::HashMap; + +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize, Debug)] +pub struct Account { + pub name: Option, // User's full name, if configured + pub email: Option, // User's preferred email address + pub username: Option, // User's username, if configured +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct Approval { + pub r#type: String, // Internal name of the approval + pub description: String, // Human-readable category of the approval + pub value: i32, // Value assigned by the approval (usually a numerical score) + #[serde(rename = "oldValue")] + pub old_value: Option, // Previous approval score, if present + #[serde(rename = "grantedOn")] + pub granted_on: u64, // Time in seconds since the UNIX epoch + pub by: Account, // Reviewer of the patch set +} + +#[derive(Serialize, Deserialize, Debug)] +#[serde(rename_all = "UPPERCASE")] +pub enum ChangeType { + Added, // The file is being created/introduced by this patch + Modified, // The file already exists and has updated content + Deleted, // The file existed, but is being removed by this patch + Renamed, // The file is renamed + Copied, // The file is copied from another file + Rewrite, // The file was rewritten +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct PatchFile { + pub file: String, // Name of the file, or new name if renamed + #[serde(rename = "fileOld")] + pub file_old: Option, // Old name of the file, if renamed + pub r#type: ChangeType, // Type of change (ADDED, MODIFIED, DELETED, etc.) + pub insertions: i64, // Number of insertions in the patch + pub deletions: i64, // Number of deletions in the patch +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct PatchSetComment { + pub file: String, // Name of the file on which the comment was added + pub line: u64, // Line number at which the comment was added + pub reviewer: Account, // Account that added the comment + pub message: String, // Comment text +} + +#[derive(Serialize, Deserialize, Debug)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum Kind { + Rework, // Nontrivial content changes + TrivialRebase, // Conflict-free merge with same commit message + TrivialRebaseWithMessageUpdate, // Conflict-free merge with message update + MergeFirstParentUpdate, // Conflict-free change of the first (left) parent + NoCodeChange, // No code change; same tree and parent tree + NoChange, // No changes; same commit message and tree +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct PatchSet { + pub number: u64, // Patchset number + pub revision: String, // Git commit for this patchset + pub parents: Vec, // List of parent revisions + pub r#ref: String, // Git reference pointing at the revision + pub uploader: Account, // Uploader of the patchset + pub author: Account, // Author of the patchset + #[serde(rename = "createdOn")] + pub created_on: u64, // Time in seconds since the UNIX epoch + pub kind: Kind, // Kind of change ("REWORK", "TRIVIAL_REBASE", etc.) + pub approvals: Vec, // Approvals granted + pub comments: Vec, // All comments for this patchset + pub files: Vec, // All changed files in this patchset + #[serde(rename = "sizeInsertions")] + pub size_insertions: i64, // Size of insertions + #[serde(rename = "sizeDeletions")] + pub size_deletions: i64, // Size of deletions +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct ReviewerMessage { + #[serde(rename = "message")] + pub comment_text: String, // Comment text added by the reviewer + pub timestamp: u64, // Time in seconds since the UNIX epoch when this comment was added + pub reviewer: Account, // Account of the reviewer who added the comment +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct TrackingId { + pub system: String, // Name of the system from the gerrit.config file + pub id: String, // ID number scraped out of the commit message +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct ChangeDependency { + pub id: String, // Change identifier + pub number: u64, // Change number + pub revision: String, // Patchset revision + pub r#ref: String, // Ref name + #[serde(rename = "isCurrentPatchSet")] + pub is_current_patch_set: bool, // If the revision is the current patchset of the change +} + +#[derive(Serialize, Deserialize, Debug)] +#[serde(rename_all = "UPPERCASE")] +pub enum ChangeStatus { + New, // Change is still being reviewed + Merged, // Change has been merged to its branch + Abandoned, // Change was abandoned by its owner or administrator +} + +#[derive(Serialize, Deserialize, Debug)] +#[serde(rename_all = "UPPERCASE")] +pub enum SubmitStatus { + Ok, // The change is ready for submission or already submitted + NotReady, // The change is missing a required label + RuleError, // An internal server error occurred preventing computation +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct Label { + pub label: String, // Name of the label + pub status: LabelStatus, // Status of the label + pub by: Account, // The account that applied the label +} + +#[derive(Serialize, Deserialize, Debug)] +#[serde(rename_all = "UPPERCASE")] +pub enum LabelStatus { + Ok, // This label provides what is necessary for submission + Reject, // This label prevents the change from being submitted + Need, // The label is required for submission but has not been satisfied + May, // The label may be set but isn’t necessary for submission + Impossible, // The label is required but impossible to complete +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct Requirement { + #[serde(rename = "fallbackText")] + pub fallback_text: String, // Human-readable description of the requirement + pub r#type: String, // Alphanumerical string identifying the requirement + pub data: Option>, // Additional key-value data linked to this requirement +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct SubmitRecord { + pub status: SubmitStatus, // Current submit status + pub labels: Option>, // State of each code review label attribute + pub requirements: Vec, // Requirements for submission +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct Change { + pub project: String, + pub branch: String, + pub topic: Option, + pub id: String, + #[serde(rename = "number")] + pub change_number: Option, // Deprecated, but keeping it optional + pub subject: String, + pub owner: Account, + pub url: String, + pub commit_message: String, + pub hashtags: Vec, + #[serde(rename = "createdOn")] + pub created_on: u64, // Time in seconds since UNIX epoch + #[serde(rename = "lastUpdated")] + pub last_updated: u64, // Time in seconds since UNIX epoch + pub open: bool, + pub status: ChangeStatus, // "NEW", "MERGED", or "ABANDONED" + pub private: bool, + pub wip: bool, // Work in progress + pub comments: Vec, // Inline/file comments + #[serde(rename = "trackingIds")] + pub tracking_ids: Vec, // Links to issue tracking systems + #[serde(rename = "currentPatchSet")] + pub current_patch_set: PatchSet, + #[serde(rename = "patchSets")] + pub patch_sets: Vec, // All patch sets + #[serde(rename = "dependsOn")] + pub depends_on: Vec, // Dependencies + #[serde(rename = "neededBy")] + pub needed_by: Vec, // Reverse dependencies + #[serde(rename = "submitRecords")] + pub submit_records: Vec, // Submission information + #[serde(rename = "allReviewers")] + pub all_reviewers: Vec, // List of all reviewers +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct RefUpdate { + #[serde(rename = "oldRev")] + pub old_rev: String, // The old value of the ref, prior to the update + #[serde(rename = "newRev")] + pub new_rev: String, // The new value the ref was updated to + pub ref_name: String, // Full ref name within the project + pub project: String, // Project path in Gerrit +} + +#[derive(Serialize, Deserialize, Debug)] +#[serde(rename_all = "camelCase", tag = "type")] +pub enum GerritStreamEvent { + ChangeAbandoned { + change: Change, + patch_set: PatchSet, + abandoner: Account, + reason: String, + event_created_on: u64 + }, + ChangeDeleted { + change: Change, + deleter: Account + }, + ChangeMerged { + change: Change, + patch_set: PatchSet, + submitter: Account, + new_rev: String, + event_created_on: u64 + }, + ChangeRestored { + change: Change, + patch_set: PatchSet, + restorer: Account, + reason: String, + event_created_on: u64 + }, + CommentAdded { + change: Change, + patch_set: PatchSet, + author: Account, + approvals: Vec, + comment: String, + event_created_on: u64 + }, + DroppedOutput, + HashtagsChanged { + change: Change, + editor: Account, + added: Vec, + removed: Vec, + hashtags: Vec, + event_created_on: u64, + }, + ProjectCreated { + project_name: String, + project_head: String, + event_created_on: u64 + }, + PatchSetCreated { + change: Change, + patch_set: PatchSet, + uploader: Account, + event_created_on: u64 + }, + RefUpdated { + submitter: Account, + ref_update: RefUpdate, + event_created_on: u64 + }, + BatchRefUpdated { + submitter: Account, + ref_updates: Vec, + event_created_on: u64 + }, + ReviewerAdded { + change: Change, + patch_set: PatchSet, + reviewer: Account, + adder: Account, + event_created_on: u64 + }, + ReviewerDeleted { + change: Change, + patch_set: PatchSet, + reviewer: Account, + remover: Account, + approvals: Vec, + comment: String, + event_created_on: u64, + }, + TopicChanged { + change: Change, + old_topic: Option, + new_topic: Option, + changer: Account, + event_created_on: u64 + }, + WorkInProgressStateChanged { + change: Change, + patch_set: PatchSet, + changer: Account, + event_created_on: u64 + }, + PrivateStateChanged { + change: Change, + patch_set: PatchSet, + changer: Account, + event_created_on: u64 + }, + VoteDeleted { + change: Change, + patch_set: PatchSet, + reviewer: Account, + remover: Account, + approvals: Vec, + comment: String, + }, + ProjectHeadUpdate { + old_head: String, + new_head: String, + event_created_on: u64 + } +} diff --git a/ofborg/src/vcs/gerrit/events.rs b/ofborg/src/vcs/gerrit/events.rs new file mode 100644 index 0000000..53d2c74 --- /dev/null +++ b/ofborg/src/vcs/gerrit/events.rs @@ -0,0 +1,45 @@ +use futures_util::stream::try_unfold; +use futures_util::Stream; +use reqwest::{Client, Response, Error}; + +use super::data_structures::GerritStreamEvent; + +/// Streams Gerrit events back to the caller. +async fn stream_events(gerrit_baseurl: &str) -> Result>>, Box> { + let client = Client::new(); + + // Send the request and get a response + let response: Response = client.get(format!("{}/stream-events", gerrit_baseurl)).send().await?; + + // Ensure we are getting a successful response + if !response.status().is_success() { + return Err(format!("Failed to connect: {}", response.status()).into()); + } + + // Create a stream from the response body + let mut body_stream = response.bytes_stream(); + + // Create a stream of GerritStreamEvent from the body stream + let stream = try_unfold(body_stream, |mut body_stream| async move { + while let Some(item) = body_stream.next().await { + let bytes = item?; + let line = String::from_utf8_lossy(&bytes).to_string(); + + let event: Result = serde_json::from_str(&line); + + match event { + Ok(event) => { + return Ok(Some((event, body_stream))); + }, + Err(err) => { + eprintln!("Failed to deserialize event: {:?}", line); + return Err(Box::new(err)); + } + } + } + + Ok(None) // End of stream + }); + + Ok(stream) +} diff --git a/ofborg/src/vcs/gerrit/mod.rs b/ofborg/src/vcs/gerrit/mod.rs new file mode 100644 index 0000000..f58dccf --- /dev/null +++ b/ofborg/src/vcs/gerrit/mod.rs @@ -0,0 +1,2 @@ +pub mod data_structures; +pub mod events; diff --git a/ofborg/src/vcs/github.rs b/ofborg/src/vcs/github.rs new file mode 100644 index 0000000..51d9781 --- /dev/null +++ b/ofborg/src/vcs/github.rs @@ -0,0 +1,141 @@ +use std::{collections::HashMap, path::PathBuf}; + +use async_std::io::BufReader; +use hubcaps::{checks::Conclusion, Credentials, Github, InstallationTokenGenerator, JWTCredentials}; +use tracing::{debug, info, warn}; + +use crate::{config::Config, message::buildresult::BuildStatus, nix::File}; + +#[derive(Debug)] +pub enum CommitStatusError { + ExpiredCreds(hubcaps::Error), + MissingSha(hubcaps::Error), + Error(hubcaps::Error), +} + +impl From for CommitStatusError { + fn from(e: hubcaps::Error) -> CommitStatusError { + use http::status::StatusCode; + use hubcaps::Error; + match &e { + Error::Fault { code, error } + if code == &StatusCode::UNAUTHORIZED && error.message == "Bad credentials" => + { + CommitStatusError::ExpiredCreds(e) + } + Error::Fault { code, error } + if code == &StatusCode::UNPROCESSABLE_ENTITY + && error.message.starts_with("No commit found for SHA:") => + { + CommitStatusError::MissingSha(e) + } + _otherwise => CommitStatusError::Error(e), + } + } +} + +impl From for Conclusion { + fn from(status: BuildStatus) -> Conclusion { + match status { + BuildStatus::Skipped => Conclusion::Skipped, + BuildStatus::Success => Conclusion::Success, + BuildStatus::Failure => Conclusion::Neutral, + BuildStatus::HashMismatch => Conclusion::Failure, + BuildStatus::TimedOut => Conclusion::Neutral, + BuildStatus::UnexpectedError { .. } => Conclusion::Neutral, + } + } +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct GithubConfig { + pub token_file: PathBuf, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct GithubAppConfig { + pub app_id: u64, + pub private_key: PathBuf, +} + +pub struct GithubAppVendingMachine { + conf: GithubAppConfig, + id_cache: HashMap<(String, String), Option>, + client_cache: HashMap, +} +impl Config { + pub fn github(&self) -> Github { + let token = std::fs::read_to_string(self.github.clone().unwrap().token_file) + .expect("Couldn't read from GitHub token file"); + Github::new( + "github.com/grahamc/ofborg", + // tls configured hyper client + Credentials::Token(token), + ) + .expect("Unable to create a github client instance") + } + + pub fn github_app_vendingmachine(&self) -> GithubAppVendingMachine { + GithubAppVendingMachine { + conf: self.github_app.clone().unwrap(), + id_cache: HashMap::new(), + client_cache: HashMap::new(), + } + } +} + +impl GithubAppVendingMachine { + fn useragent(&self) -> &'static str { + "github.com/grahamc/ofborg (app)" + } + + fn jwt(&self) -> JWTCredentials { + let private_key_file = + File::open(self.conf.private_key.clone()).expect("Unable to read private_key"); + let mut private_key_reader = BufReader::new(private_key_file); + let private_keys = rustls_pemfile::rsa_private_keys(&mut private_key_reader) + .expect("Unable to convert private_key to DER format"); + // We can be reasonably certain that there will only be one private key in this file + let private_key = &private_keys[0]; + JWTCredentials::new(self.conf.app_id, private_key.to_vec()) + .expect("Unable to create JWTCredentials") + } + + fn install_id_for_repo(&mut self, owner: &str, repo: &str) -> Option { + let useragent = self.useragent(); + let jwt = self.jwt(); + + let key = (owner.to_owned(), repo.to_owned()); + + *self.id_cache.entry(key).or_insert_with(|| { + info!("Looking up install ID for {}/{}", owner, repo); + + let lookup_gh = Github::new(useragent, Credentials::JWT(jwt)).unwrap(); + + match async_std::task::block_on(lookup_gh.app().find_repo_installation(owner, repo)) { + Ok(install_id) => { + debug!("Received install ID {:?}", install_id); + Some(install_id.id) + } + Err(e) => { + warn!("Error during install ID lookup: {:?}", e); + None + } + } + }) + } + + pub fn for_repo<'a>(&'a mut self, owner: &str, repo: &str) -> Option<&'a Github> { + let useragent = self.useragent(); + let jwt = self.jwt(); + let install_id = self.install_id_for_repo(owner, repo)?; + + Some(self.client_cache.entry(install_id).or_insert_with(|| { + Github::new( + useragent, + Credentials::InstallationToken(InstallationTokenGenerator::new(install_id, jwt)), + ) + .expect("Unable to create a github client instance") + })) + } +} diff --git a/ofborg/src/vcs/mod.rs b/ofborg/src/vcs/mod.rs new file mode 100644 index 0000000..e664bef --- /dev/null +++ b/ofborg/src/vcs/mod.rs @@ -0,0 +1,3 @@ +pub mod github; +pub mod generic; +pub mod gerrit;