diff --git a/Cargo.lock b/Cargo.lock index a3bd6072..5720d677 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,27 +1,27 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -43,9 +43,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -58,49 +58,50 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "once_cell", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "async-compression" -version = "0.4.5" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc2d0cfb2a7388d34f590e76686704c494ed7aaceed62ee1ba35cbf363abc2a5" +checksum = "df895a515f70646414f4b45c0b79082783b80552b373a68283012928df56f522" dependencies = [ "flate2", "futures-core", @@ -111,41 +112,41 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bitflags" @@ -155,9 +156,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "block-buffer" @@ -170,24 +171,31 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] -name = "bytes" +name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" -version = "1.0.83" +version = "1.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -198,21 +206,21 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] name = "clap" -version = "4.4.8" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" dependencies = [ "clap_builder", "clap_derive", @@ -220,9 +228,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" dependencies = [ "anstream", "anstyle", @@ -232,21 +240,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", ] [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "codspeed-runner" @@ -287,28 +295,28 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "console" -version = "0.15.8" +version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" dependencies = [ "encode_unicode", - "lazy_static", "libc", + "once_cell", "unicode-width", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -322,27 +330,27 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -359,9 +367,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" @@ -392,23 +400,34 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "either" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encode_unicode" -version = "0.3.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -421,37 +440,37 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "fastrand" -version = "2.0.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -480,18 +499,18 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -504,9 +523,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -514,15 +533,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -531,38 +550,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -588,9 +607,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -601,9 +620,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "git2" @@ -611,7 +630,7 @@ version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.8.0", "libc", "libgit2-sys", "log", @@ -633,9 +652,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -643,7 +662,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap", "slab", "tokio", "tokio-util", @@ -652,21 +671,15 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hex" @@ -676,9 +689,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "http" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f95b9abcae896730d42b78e09c155ed4ddf82c07b4de772c64aee5b2d8b7c150" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -687,9 +700,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -698,9 +711,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -710,9 +723,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", @@ -725,7 +738,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2", "tokio", "tower-service", "tracing", @@ -747,16 +760,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core 0.51.1", + "windows-core 0.52.0", ] [[package]] @@ -768,70 +781,188 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "idna" -version = "0.4.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "indexmap" -version = "1.9.3" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "autocfg", - "hashbrown 0.12.3", + "icu_normalizer", + "icu_properties", ] [[package]] name = "indexmap" -version = "2.2.6" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown", ] [[package]] name = "indicatif" -version = "0.17.8" +version = "0.17.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" +checksum = "cbf675b85ed934d3c67b5c5469701eec7db22689d0a2139d856e0925fa28b281" dependencies = [ "console", - "instant", "number_prefix", "portable-atomic", "unicode-width", + "web-time", ] [[package]] name = "insta" -version = "1.34.0" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" +checksum = "6513e4067e16e69ed1db5ab56048ed65db32d10ba5fc1217f5393f8f17d8b5a5" dependencies = [ "console", - "lazy_static", "linked-hash-map", + "once_cell", "pest", "pest_derive", "serde", "similar", - "yaml-rust", ] [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", "js-sys", @@ -841,15 +972,15 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -862,33 +993,34 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ + "once_cell", "wasm-bindgen", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" @@ -910,6 +1042,17 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.8.0", + "libc", + "redox_syscall 0.5.8", +] + [[package]] name = "libssh2-sys" version = "0.3.0" @@ -926,9 +1069,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.16" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" +checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa" dependencies = [ "cc", "libc", @@ -944,15 +1087,21 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -960,9 +1109,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "md5" @@ -972,9 +1121,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" @@ -984,9 +1133,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -994,31 +1143,30 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.9" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -1039,7 +1187,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", ] [[package]] @@ -1059,9 +1207,9 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -1074,26 +1222,26 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.32.1" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" -version = "0.10.59" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.8.0", "cfg-if", "foreign-types", "libc", @@ -1110,7 +1258,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", ] [[package]] @@ -1121,18 +1269,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.1.6+3.1.4" +version = "300.4.1+3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439fac53e092cd7442a3660c85dde4643ab3b5bd39040912388dcdabf6b88085" +checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.95" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -1154,12 +1302,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.9", + "parking_lot_core 0.9.10", ] [[package]] @@ -1178,39 +1326,39 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall 0.5.8", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror", + "thiserror 2.0.11", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.5" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" +checksum = "816518421cfc6887a0d62bf441b6ffb4536fcc926395a69e1a85852d4363f57e" dependencies = [ "pest", "pest_generator", @@ -1218,22 +1366,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.5" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +checksum = "7d1396fd3a870fc7838768d171b4616d5c91f6cc25e377b673d714567d99377b" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", ] [[package]] name = "pest_meta" -version = "2.7.5" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" dependencies = [ "once_cell", "pest", @@ -1242,9 +1390,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1254,15 +1402,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.6.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" [[package]] name = "powerfmt" @@ -1272,9 +1420,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "proc-macro-error" @@ -1302,18 +1453,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.83" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -1388,18 +1539,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.8.0", ] [[package]] name = "regex" -version = "1.10.2" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -1409,9 +1560,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1420,15 +1571,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64", "bytes", @@ -1449,9 +1600,11 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -1467,9 +1620,9 @@ dependencies = [ [[package]] name = "reqwest-middleware" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a3e86aa6053e59030e7ce2d2a3b258dd08fc2d337d52f73f6cb480f5858690" +checksum = "5a735987236a8e238bf0296c7e351b999c188ccc11477f311b82b55c93984216" dependencies = [ "anyhow", "async-trait", @@ -1477,7 +1630,7 @@ dependencies = [ "reqwest", "serde", "task-local-extensions", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1516,23 +1669,38 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.8.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "rustversion" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + [[package]] name = "ryu" version = "1.0.18" @@ -1541,11 +1709,11 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -1556,11 +1724,11 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.8.0", "core-foundation", "core-foundation-sys", "libc", @@ -1569,9 +1737,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -1579,32 +1747,33 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.202" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.202" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" dependencies = [ - "indexmap 2.2.6", + "indexmap", "itoa", + "memchr", "ryu", "serde", ] @@ -1627,7 +1796,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.6", + "indexmap", "itoa", "ryu", "serde", @@ -1647,9 +1816,9 @@ dependencies = [ [[package]] name = "sha256" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7895c8ae88588ccead14ff438b939b0c569cd619116f14b4d13fdff7b8333386" +checksum = "18278f6a914fa3070aa316493f7d2ddfb9ac86ebc06fa3b83bffda487e9065b0" dependencies = [ "async-trait", "bytes", @@ -1658,17 +1827,23 @@ dependencies = [ "tokio", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "similar" -version = "2.3.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" [[package]] name = "simplelog" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acee08041c5de3d5048c8b3f6f13fafb3026b24ba43c6a695a0c76179b844369" +checksum = "16257adbfaef1ee58b1363bdc0664c9b8e1e30aed86049635fb5f147d065a9c0" dependencies = [ "log", "termcolor", @@ -1686,35 +1861,31 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.4.10" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] [[package]] -name = "socket2" -version = "0.5.5" +name = "stable_deref_trait" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" @@ -1728,15 +1899,32 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "sysinfo" version = "0.33.1" @@ -1789,55 +1977,77 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96374855068f47402c3121c6eed88d29cb1de8f3ab27090e273e420bdabcf050" dependencies = [ "futures", - "parking_lot 0.12.1", + "parking_lot 0.12.3", ] [[package]] name = "tempfile" -version = "3.10.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", "fastrand", + "getrandom", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "termcolor" -version = "1.1.3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", ] [[package]] name = "time" -version = "0.3.34" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -1856,54 +2066,49 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "tinyvec_macros", + "displaydoc", + "zerovec", ] -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "tokio" -version = "1.34.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", "libc", "mio", "pin-project-lite", - "socket2 0.5.5", + "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", ] [[package]] @@ -1918,9 +2123,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -1944,29 +2149,28 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" 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" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -1975,29 +2179,29 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -2007,45 +2211,27 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.13" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" [[package]] name = "unsafe-libyaml" @@ -2055,20 +2241,32 @@ checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "url" -version = "2.4.1" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "vcpkg" @@ -2078,9 +2276,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "want" @@ -2099,46 +2297,48 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", + "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2146,28 +2346,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasm-streams" -version = "0.3.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -2193,9 +2396,19 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", @@ -2219,11 +2432,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2244,11 +2457,11 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -2271,7 +2484,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", ] [[package]] @@ -2282,7 +2495,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.96", ] [[package]] @@ -2312,6 +2525,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -2443,20 +2665,113 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "xattr" -version = "1.0.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ "libc", + "linux-raw-sys", + "rustix", ] [[package]] -name = "yaml-rust" -version = "0.4.5" +name = "yoke" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ - "linked-hash-map", + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", ] diff --git a/README.md b/README.md index 6b417827..ab996214 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The following CI providers are supported: If you want to use the CLI with another provider, you can open an issue or chat with us on [Discord](https://discord.com/invite/MxpaCfKSqF) 🚀 -You can check out the implementation of the [supported providers](https://github.com/CodSpeedHQ/runner/tree/main/src/run/ci_provider) for reference. +You can check out the implementation of the [supported providers](https://github.com/CodSpeedHQ/runner/tree/main/src/run/run_environment) for reference. ## Installation diff --git a/cspell.json b/cspell.json index 40331c21..1adc0ec5 100644 --- a/cspell.json +++ b/cspell.json @@ -5,6 +5,15 @@ "language": "en", // words - list of words to be always considered correct "words": [ - "codspeed" + "adrien", + "adriencaccia", + "clippy", + "codspeed", + "insta", + "moonrepo", + "simplelog", + "thollander", + "tokenless", + "valgrind" ] } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 87493917..58e76ec0 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.79.0" +channel = "1.84.0" components = ["rustfmt", "clippy"] diff --git a/src/run/ci_provider/github_actions/provider.rs b/src/run/ci_provider/github_actions/provider.rs deleted file mode 100644 index eeb66d61..00000000 --- a/src/run/ci_provider/github_actions/provider.rs +++ /dev/null @@ -1,309 +0,0 @@ -use lazy_static::lazy_static; -use regex::Regex; -use serde_json::Value; -use simplelog::SharedLogger; -use std::{env, fs}; - -use crate::prelude::*; -use crate::run::{ - ci_provider::{ - interfaces::{CIProviderMetadata, GhData, RepositoryProvider, RunEvent, Sender}, - provider::{CIProvider, CIProviderDetector}, - }, - config::Config, - helpers::{find_repository_root, get_env_variable}, -}; - -use super::logger::GithubActionLogger; - -#[derive(Debug)] -pub struct GitHubActionsProvider { - pub owner: String, - pub repository: String, - pub ref_: String, - pub head_ref: Option, - pub base_ref: Option, - pub sender: Option, - pub gh_data: GhData, - pub event: RunEvent, - pub repository_root_path: String, -} - -impl GitHubActionsProvider { - fn get_owner_and_repository() -> Result<(String, String)> { - let owner_and_repository = get_env_variable("GITHUB_REPOSITORY")?; - let mut owner_and_repository = owner_and_repository.split('/'); - let owner = owner_and_repository.next().unwrap(); - let repository = owner_and_repository.next().unwrap(); - Ok((owner.into(), repository.into())) - } -} - -lazy_static! { - static ref PR_REF_REGEX: Regex = Regex::new(r"^refs/pull/(?P\d+)/merge$").unwrap(); -} - -impl TryFrom<&Config> for GitHubActionsProvider { - type Error = Error; - fn try_from(_config: &Config) -> Result { - let (owner, repository) = Self::get_owner_and_repository()?; - let ref_ = get_env_variable("GITHUB_REF")?; - let is_pr = PR_REF_REGEX.is_match(&ref_); - let head_ref = if is_pr { - let github_event_path = get_env_variable("GITHUB_EVENT_PATH")?; - let github_event = fs::read_to_string(github_event_path)?; - let github_event: Value = serde_json::from_str(&github_event) - .expect("GITHUB_EVENT_PATH file could not be read"); - let pull_request = github_event["pull_request"].as_object().unwrap(); - - let head_repo = pull_request["head"]["repo"].as_object().unwrap(); - let base_repo = pull_request["base"]["repo"].as_object().unwrap(); - - let is_head_repo_fork = head_repo["id"] != base_repo["id"]; - - let head_ref = if is_head_repo_fork { - format!( - "{}:{}", - head_repo["owner"]["login"].as_str().unwrap(), - pull_request["head"]["ref"].as_str().unwrap() - ) - } else { - pull_request["head"]["ref"].as_str().unwrap().to_owned() - }; - Some(head_ref) - } else { - None - }; - - let github_event_name = get_env_variable("GITHUB_EVENT_NAME")?; - let event = serde_json::from_str(&format!("\"{}\"", github_event_name)).context( - format!("Event {} is not supported by CodSpeed", github_event_name), - )?; - let repository_root_path = match find_repository_root(&std::env::current_dir()?) { - Some(mut path) => { - // Add a trailing slash to the path - path.push(""); - path.to_string_lossy().to_string() - } - None => format!("/home/runner/work/{}/{}/", repository, repository), - }; - - Ok(Self { - owner, - repository: repository.clone(), - ref_, - head_ref, - event, - gh_data: GhData { - job: get_env_variable("GITHUB_JOB")?, - run_id: get_env_variable("GITHUB_RUN_ID")?, - }, - sender: Some(Sender { - login: get_env_variable("GITHUB_ACTOR")?, - id: get_env_variable("GITHUB_ACTOR_ID")?, - }), - base_ref: get_env_variable("GITHUB_BASE_REF").ok(), - repository_root_path, - }) - } -} - -impl CIProviderDetector for GitHubActionsProvider { - fn detect() -> bool { - // check if the GITHUB_ACTIONS environment variable is set and the value is truthy - env::var("GITHUB_ACTIONS") == Ok("true".into()) - } -} - -impl CIProvider for GitHubActionsProvider { - fn get_repository_provider(&self) -> RepositoryProvider { - RepositoryProvider::GitHub - } - - fn get_logger(&self) -> Box { - Box::new(GithubActionLogger) - } - - fn get_provider_name(&self) -> &'static str { - "GitHub Actions" - } - - fn get_provider_slug(&self) -> &'static str { - "github-actions" - } - - fn get_ci_provider_metadata(&self) -> Result { - Ok(CIProviderMetadata { - base_ref: self.base_ref.clone(), - head_ref: self.head_ref.clone(), - event: self.event.clone(), - gh_data: Some(self.gh_data.clone()), - gl_data: None, - sender: self.sender.clone(), - owner: self.owner.clone(), - repository: self.repository.clone(), - ref_: self.ref_.clone(), - repository_root_path: self.repository_root_path.clone(), - }) - } -} - -#[cfg(test)] -mod tests { - use insta::assert_json_snapshot; - use temp_env::{with_var, with_vars}; - - use crate::VERSION; - - use super::*; - - #[test] - fn test_detect() { - with_var("GITHUB_ACTIONS", Some("true"), || { - assert!(GitHubActionsProvider::detect()); - }); - } - - #[test] - fn test_get_owner_and_repository() { - with_var("GITHUB_REPOSITORY", Some("owner/repository"), || { - let (owner, repository) = GitHubActionsProvider::get_owner_and_repository().unwrap(); - assert_eq!(owner, "owner"); - assert_eq!(repository, "repository"); - }); - } - - #[test] - fn test_try_from_push_main() { - with_vars( - [ - ("GITHUB_ACTOR_ID", Some("1234567890")), - ("GITHUB_ACTOR", Some("actor")), - ("GITHUB_BASE_REF", Some("main")), - ("GITHUB_EVENT_NAME", Some("push")), - ("GITHUB_JOB", Some("job")), - ("GITHUB_REF", Some("refs/heads/main")), - ("GITHUB_REPOSITORY", Some("owner/repository")), - ("GITHUB_RUN_ID", Some("1234567890")), - ], - || { - let config = Config { - token: Some("token".into()), - ..Config::test() - }; - let github_actions_provider = GitHubActionsProvider::try_from(&config).unwrap(); - assert_eq!(github_actions_provider.owner, "owner"); - assert_eq!(github_actions_provider.repository, "repository"); - assert_eq!(github_actions_provider.ref_, "refs/heads/main"); - assert_eq!(github_actions_provider.base_ref, Some("main".into())); - assert_eq!(github_actions_provider.head_ref, None); - assert_eq!(github_actions_provider.event, RunEvent::Push); - assert_eq!(github_actions_provider.gh_data.job, "job"); - assert_eq!(github_actions_provider.gh_data.run_id, "1234567890"); - assert_eq!( - github_actions_provider.sender.as_ref().unwrap().login, - "actor" - ); - assert_eq!( - github_actions_provider.sender.as_ref().unwrap().id, - "1234567890" - ); - }, - ) - } - - #[test] - fn test_pull_request_provider_metadata() { - with_vars( - [ - ("GITHUB_ACTIONS", Some("true")), - ("GITHUB_ACTOR_ID", Some("19605940")), - ("GITHUB_ACTOR", Some("adriencaccia")), - ("GITHUB_BASE_REF", Some("main")), - ("GITHUB_EVENT_NAME", Some("pull_request")), - ( - "GITHUB_EVENT_PATH", - Some( - format!( - "{}/src/run/ci_provider/github_actions/samples/pr-event.json", - env!("CARGO_MANIFEST_DIR") - ) - .as_str(), - ), - ), - ("GITHUB_HEAD_REF", Some("feat/codspeed-runner")), - ("GITHUB_JOB", Some("log-env")), - ("GITHUB_REF", Some("refs/pull/22/merge")), - ("GITHUB_REPOSITORY", Some("my-org/adrien-python-test")), - ("GITHUB_RUN_ID", Some("6957110437")), - ("VERSION", Some("0.1.0")), - ], - || { - let config = Config { - token: Some("token".into()), - ..Config::test() - }; - let github_actions_provider = GitHubActionsProvider::try_from(&config).unwrap(); - let provider_metadata = github_actions_provider.get_ci_provider_metadata().unwrap(); - - assert_json_snapshot!(provider_metadata, { - ".runner.version" => insta::dynamic_redaction(|value,_path| { - assert_eq!(value.as_str().unwrap(), VERSION.to_string()); - "[version]" - }), - }); - }, - ); - } - - #[test] - fn test_fork_pull_request_provider_metadata() { - with_vars( - [ - ("GITHUB_ACTIONS", Some("true")), - ("GITHUB_ACTOR_ID", Some("19605940")), - ("GITHUB_ACTOR", Some("adriencaccia")), - ("GITHUB_BASE_REF", Some("main")), - ("GITHUB_EVENT_NAME", Some("pull_request")), - ( - "GITHUB_EVENT_PATH", - Some( - format!( - "{}/src/run/ci_provider/github_actions/samples/fork-pr-event.json", - env!("CARGO_MANIFEST_DIR") - ) - .as_str(), - ), - ), - ("GITHUB_HEAD_REF", Some("feat/codspeed-runner")), - ("GITHUB_JOB", Some("log-env")), - ("GITHUB_REF", Some("refs/pull/22/merge")), - ("GITHUB_REPOSITORY", Some("my-org/adrien-python-test")), - ("GITHUB_RUN_ID", Some("6957110437")), - ("VERSION", Some("0.1.0")), - ], - || { - let config = Config { - token: Some("token".into()), - ..Config::test() - }; - let github_actions_provider = GitHubActionsProvider::try_from(&config).unwrap(); - let provider_metadata = github_actions_provider.get_ci_provider_metadata().unwrap(); - - assert_eq!(provider_metadata.owner, "my-org"); - assert_eq!(provider_metadata.repository, "adrien-python-test"); - assert_eq!(provider_metadata.base_ref, Some("main".into())); - assert_eq!( - provider_metadata.head_ref, - Some("fork-owner:feat/codspeed-runner".into()) - ); - assert_json_snapshot!(provider_metadata, { - ".runner.version" => insta::dynamic_redaction(|value,_path| { - assert_eq!(value.as_str().unwrap(), VERSION.to_string()); - "[version]" - }), - }); - }, - ); - } -} diff --git a/src/run/ci_provider/interfaces.rs b/src/run/ci_provider/interfaces.rs deleted file mode 100644 index ff59bd5c..00000000 --- a/src/run/ci_provider/interfaces.rs +++ /dev/null @@ -1,55 +0,0 @@ -use serde::{Deserialize, Serialize}; - -#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)] -#[serde(rename_all = "UPPERCASE")] -pub enum RepositoryProvider { - GitLab, - GitHub, -} - -#[derive(Deserialize, Serialize, Debug)] -#[serde(rename_all = "camelCase")] -pub struct CIProviderMetadata { - #[serde(rename = "ref")] - pub ref_: String, - pub head_ref: Option, - pub base_ref: Option, - pub owner: String, - pub repository: String, - pub event: RunEvent, - pub sender: Option, - pub gh_data: Option, - pub gl_data: Option, - pub repository_root_path: String, -} - -#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RunEvent { - Push, - PullRequest, - WorkflowDispatch, - Schedule, - Local, -} - -#[derive(Deserialize, Serialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct GhData { - pub run_id: String, - pub job: String, -} - -#[derive(Deserialize, Serialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct GlData { - pub run_id: String, - pub job: String, -} - -#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)] -#[serde(rename_all = "camelCase")] -pub struct Sender { - pub id: String, - pub login: String, -} diff --git a/src/run/ci_provider/local/snapshots/codspeed_runner__run__ci_provider__local__provider__tests__provider_metadata.snap b/src/run/ci_provider/local/snapshots/codspeed_runner__run__ci_provider__local__provider__tests__provider_metadata.snap deleted file mode 100644 index 73882345..00000000 --- a/src/run/ci_provider/local/snapshots/codspeed_runner__run__ci_provider__local__provider__tests__provider_metadata.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -source: src/run/ci_provider/local/provider.rs -expression: provider_metadata ---- -{ - "ref": "18ec1d64b5f25fb27451d89eee03cc569bd6bbb1", - "headRef": "feat/branch", - "owner": "my-org", - "repository": "adrien-python-test", - "event": "local", - "repositoryRootPath": "/Users/adrien/projects/my-org/adrien-python-test" -} diff --git a/src/run/logger.rs b/src/run/logger.rs index a0483378..dfcef7a2 100644 --- a/src/run/logger.rs +++ b/src/run/logger.rs @@ -1,6 +1,6 @@ use crate::logger::{GROUP_TARGET, OPENED_GROUP_TARGET}; use crate::prelude::*; -use crate::run::{ci_provider::CIProvider, runner::RunData}; +use crate::run::{run_environment::RunEnvironmentProvider, runner::RunData}; use log::LevelFilter; use simplelog::{CombinedLogger, WriteLogger}; use std::fs::copy; @@ -13,7 +13,7 @@ pub struct Logger { impl Logger { #[allow(clippy::borrowed_box)] - pub fn new(provider: &Box) -> Result { + pub fn new(provider: &Box) -> Result { let provider_logger = provider.get_logger(); let log_file = NamedTempFile::new().context("Failed to create log file")?; let log_file_path = log_file.path().to_path_buf(); diff --git a/src/run/mod.rs b/src/run/mod.rs index b5d849a3..8baa52ac 100644 --- a/src/run/mod.rs +++ b/src/run/mod.rs @@ -6,13 +6,14 @@ use crate::VERSION; use check_system::SystemInfo; use clap::Args; use instruments::mongo_tracer::MongoTracer; +use run_environment::interfaces::RunEnvironment; use runner::get_run_data; mod check_system; -pub mod ci_provider; mod helpers; mod instruments; mod poll_results; +pub mod run_environment; mod runner; mod uploader; @@ -96,16 +97,16 @@ impl RunArgs { pub async fn run(args: RunArgs, api_client: &CodSpeedAPIClient) -> Result<()> { let mut config = Config::try_from(args)?; - let provider = ci_provider::get_provider(&config)?; + let provider = run_environment::get_provider(&config)?; let codspeed_config = CodSpeedConfig::load()?; let logger = Logger::new(&provider)?; - if provider.get_provider_slug() != "local" { + if provider.get_run_environment() != RunEnvironment::Local { show_banner(); } debug!("config: {:#?}", config); - if provider.get_provider_slug() == "local" { + if provider.get_run_environment() == RunEnvironment::Local { if codspeed_config.auth.token.is_none() { bail!("You have to authenticate the CLI first. Run `codspeed auth login`."); } @@ -158,7 +159,7 @@ pub async fn run(args: RunArgs, api_client: &CodSpeedAPIClient) -> Result<()> { uploader::upload(&config, &system_info, &provider, &run_data, executor.name()).await?; end_group!(); - if provider.get_provider_slug() == "local" { + if provider.get_run_environment() == RunEnvironment::Local { start_group!("Fetching the results"); poll_results::poll_results(api_client, &provider, upload_result.run_id).await?; end_group!(); diff --git a/src/run/poll_results.rs b/src/run/poll_results.rs index 76907a90..44abedd0 100644 --- a/src/run/poll_results.rs +++ b/src/run/poll_results.rs @@ -8,7 +8,7 @@ use crate::api_client::{ }; use crate::prelude::*; -use super::ci_provider::CIProvider; +use super::run_environment::RunEnvironmentProvider; const RUN_PROCESSING_MAX_DURATION: Duration = Duration::from_secs(60 * 5); // 5 minutes const POLLING_INTERVAL: Duration = Duration::from_secs(1); @@ -16,13 +16,13 @@ const POLLING_INTERVAL: Duration = Duration::from_secs(1); #[allow(clippy::borrowed_box)] pub async fn poll_results( api_client: &CodSpeedAPIClient, - provider: &Box, + provider: &Box, run_id: String, ) -> Result<()> { let start = Instant::now(); - let ci_provider_metadata = provider.get_ci_provider_metadata()?; - let owner = ci_provider_metadata.owner; - let name = ci_provider_metadata.repository; + let run_environment_metadata = provider.get_run_environment_metadata()?; + let owner = run_environment_metadata.owner; + let name = run_environment_metadata.repository; let fetch_local_run_report_vars = FetchLocalRunReportVars { owner: owner.clone(), name: name.clone(), diff --git a/src/run/ci_provider/buildkite/logger.rs b/src/run/run_environment/buildkite/logger.rs similarity index 96% rename from src/run/ci_provider/buildkite/logger.rs rename to src/run/run_environment/buildkite/logger.rs index aea05bb2..0b007776 100644 --- a/src/run/ci_provider/buildkite/logger.rs +++ b/src/run/run_environment/buildkite/logger.rs @@ -1,6 +1,6 @@ use crate::{ logger::{get_group_event, GroupEvent}, - run::ci_provider::logger::should_provider_logger_handle_record, + run::run_environment::logger::should_provider_logger_handle_record, }; use log::*; use simplelog::SharedLogger; diff --git a/src/run/ci_provider/buildkite/mod.rs b/src/run/run_environment/buildkite/mod.rs similarity index 100% rename from src/run/ci_provider/buildkite/mod.rs rename to src/run/run_environment/buildkite/mod.rs diff --git a/src/run/ci_provider/buildkite/provider.rs b/src/run/run_environment/buildkite/provider.rs similarity index 90% rename from src/run/ci_provider/buildkite/provider.rs rename to src/run/run_environment/buildkite/provider.rs index b3d3e846..d0a80ce2 100644 --- a/src/run/ci_provider/buildkite/provider.rs +++ b/src/run/run_environment/buildkite/provider.rs @@ -4,13 +4,14 @@ use simplelog::SharedLogger; use crate::prelude::*; use crate::run::helpers::{parse_git_remote, GitRemote}; +use crate::run::run_environment::{RunEnvironment, RunPart}; use crate::run::{ - ci_provider::{ - interfaces::{CIProviderMetadata, RepositoryProvider, RunEvent}, - provider::{CIProvider, CIProviderDetector}, - }, config::Config, helpers::{find_repository_root, get_env_variable}, + run_environment::{ + interfaces::{RepositoryProvider, RunEnvironmentMetadata, RunEvent}, + provider::{RunEnvironmentDetector, RunEnvironmentProvider}, + }, }; use super::logger::BuildkiteLogger; @@ -108,13 +109,13 @@ impl TryFrom<&Config> for BuildkiteProvider { } } -impl CIProviderDetector for BuildkiteProvider { +impl RunEnvironmentDetector for BuildkiteProvider { fn detect() -> bool { env::var("BUILDKITE") == Ok("true".into()) } } -impl CIProvider for BuildkiteProvider { +impl RunEnvironmentProvider for BuildkiteProvider { fn get_repository_provider(&self) -> RepositoryProvider { RepositoryProvider::GitHub } @@ -123,16 +124,12 @@ impl CIProvider for BuildkiteProvider { Box::new(BuildkiteLogger::new()) } - fn get_provider_name(&self) -> &'static str { - "Buildkite" - } - - fn get_provider_slug(&self) -> &'static str { - "buildkite" + fn get_run_environment(&self) -> RunEnvironment { + RunEnvironment::Buildkite } - fn get_ci_provider_metadata(&self) -> Result { - Ok(CIProviderMetadata { + fn get_run_environment_metadata(&self) -> Result { + Ok(RunEnvironmentMetadata { base_ref: self.base_ref.clone(), head_ref: self.head_ref.clone(), event: self.event.clone(), @@ -145,6 +142,11 @@ impl CIProvider for BuildkiteProvider { sender: None, }) } + + /// For Buildkite, we don't support multipart uploads + fn get_run_provider_run_part(&self) -> Option { + None + } } #[cfg(test)] @@ -242,7 +244,7 @@ mod tests { } #[test] - fn test_pull_request_provider_metadata() { + fn test_pull_request_run_environment_metadata() { with_vars( [ ("BUILDKITE_AGENT_NAME", Some("7b10eca7600b-1")), @@ -265,9 +267,9 @@ mod tests { ..Config::test() }; let provider = BuildkiteProvider::try_from(&config).unwrap(); - let provider_metadata = provider.get_ci_provider_metadata().unwrap(); + let run_environment_metadata = provider.get_run_environment_metadata().unwrap(); - assert_json_snapshot!(provider_metadata, { + assert_json_snapshot!(run_environment_metadata, { ".runner.version" => insta::dynamic_redaction(|value,_path| { assert_eq!(value.as_str().unwrap(), VERSION.to_string()); "[version]" diff --git a/src/run/ci_provider/buildkite/snapshots/codspeed__run__ci_provider__buildkite__provider__tests__pull_request_provider_metadata.snap b/src/run/run_environment/buildkite/snapshots/codspeed__run__run_environment__buildkite__provider__tests__pull_request_run_environment_metadata.snap similarity index 78% rename from src/run/ci_provider/buildkite/snapshots/codspeed__run__ci_provider__buildkite__provider__tests__pull_request_provider_metadata.snap rename to src/run/run_environment/buildkite/snapshots/codspeed__run__run_environment__buildkite__provider__tests__pull_request_run_environment_metadata.snap index 24d10f61..634ff292 100644 --- a/src/run/ci_provider/buildkite/snapshots/codspeed__run__ci_provider__buildkite__provider__tests__pull_request_provider_metadata.snap +++ b/src/run/run_environment/buildkite/snapshots/codspeed__run__run_environment__buildkite__provider__tests__pull_request_run_environment_metadata.snap @@ -1,6 +1,6 @@ --- -source: src/run/ci_provider/buildkite/provider.rs -expression: provider_metadata +source: src/run/run_environment/buildkite/provider.rs +expression: run_environment_metadata --- { "ref": "refs/pull/22/merge", diff --git a/src/run/ci_provider/github_actions/logger.rs b/src/run/run_environment/github_actions/logger.rs similarity index 96% rename from src/run/ci_provider/github_actions/logger.rs rename to src/run/run_environment/github_actions/logger.rs index 5a24f870..dcab6b06 100644 --- a/src/run/ci_provider/github_actions/logger.rs +++ b/src/run/run_environment/github_actions/logger.rs @@ -1,6 +1,6 @@ use crate::{ logger::{get_group_event, GroupEvent}, - run::ci_provider::logger::should_provider_logger_handle_record, + run::run_environment::logger::should_provider_logger_handle_record, }; use log::*; use simplelog::SharedLogger; diff --git a/src/run/ci_provider/github_actions/mod.rs b/src/run/run_environment/github_actions/mod.rs similarity index 100% rename from src/run/ci_provider/github_actions/mod.rs rename to src/run/run_environment/github_actions/mod.rs diff --git a/src/run/run_environment/github_actions/provider.rs b/src/run/run_environment/github_actions/provider.rs new file mode 100644 index 00000000..5de9ae42 --- /dev/null +++ b/src/run/run_environment/github_actions/provider.rs @@ -0,0 +1,621 @@ +use lazy_static::lazy_static; +use regex::Regex; +use serde_json::Value; +use simplelog::SharedLogger; +use std::collections::BTreeMap; +use std::{env, fs}; + +use crate::prelude::*; +use crate::run::run_environment::{RunEnvironment, RunPart}; +use crate::run::{ + config::Config, + helpers::{find_repository_root, get_env_variable}, + run_environment::{ + interfaces::{GhData, RepositoryProvider, RunEnvironmentMetadata, RunEvent, Sender}, + provider::{RunEnvironmentDetector, RunEnvironmentProvider}, + }, +}; + +use super::logger::GithubActionLogger; + +#[derive(Debug)] +pub struct GitHubActionsProvider { + pub owner: String, + pub repository: String, + pub ref_: String, + pub head_ref: Option, + pub base_ref: Option, + pub sender: Option, + pub gh_data: GhData, + pub event: RunEvent, + pub repository_root_path: String, +} + +impl GitHubActionsProvider { + fn get_owner_and_repository() -> Result<(String, String)> { + let owner_and_repository = get_env_variable("GITHUB_REPOSITORY")?; + let mut owner_and_repository = owner_and_repository.split('/'); + let owner = owner_and_repository.next().unwrap(); + let repository = owner_and_repository.next().unwrap(); + Ok((owner.into(), repository.into())) + } +} + +lazy_static! { + static ref PR_REF_REGEX: Regex = Regex::new(r"^refs/pull/(?P\d+)/merge$").unwrap(); +} + +impl TryFrom<&Config> for GitHubActionsProvider { + type Error = Error; + fn try_from(_config: &Config) -> Result { + let (owner, repository) = Self::get_owner_and_repository()?; + let ref_ = get_env_variable("GITHUB_REF")?; + let is_pr = PR_REF_REGEX.is_match(&ref_); + let head_ref = if is_pr { + let github_event_path = get_env_variable("GITHUB_EVENT_PATH")?; + let github_event = fs::read_to_string(github_event_path)?; + let github_event: Value = serde_json::from_str(&github_event) + .expect("GITHUB_EVENT_PATH file could not be read"); + let pull_request = github_event["pull_request"].as_object().unwrap(); + + let head_repo = pull_request["head"]["repo"].as_object().unwrap(); + let base_repo = pull_request["base"]["repo"].as_object().unwrap(); + + let is_head_repo_fork = head_repo["id"] != base_repo["id"]; + + let head_ref = if is_head_repo_fork { + format!( + "{}:{}", + head_repo["owner"]["login"].as_str().unwrap(), + pull_request["head"]["ref"].as_str().unwrap() + ) + } else { + pull_request["head"]["ref"].as_str().unwrap().to_owned() + }; + Some(head_ref) + } else { + None + }; + + let github_event_name = get_env_variable("GITHUB_EVENT_NAME")?; + let event = serde_json::from_str(&format!("\"{}\"", github_event_name)).context( + format!("Event {} is not supported by CodSpeed", github_event_name), + )?; + let repository_root_path = match find_repository_root(&std::env::current_dir()?) { + Some(mut path) => { + // Add a trailing slash to the path + path.push(""); + path.to_string_lossy().to_string() + } + None => format!("/home/runner/work/{}/{}/", repository, repository), + }; + + Ok(Self { + owner, + repository: repository.clone(), + ref_, + head_ref, + event, + gh_data: GhData { + job: get_env_variable("GITHUB_JOB")?, + run_id: get_env_variable("GITHUB_RUN_ID")?, + }, + sender: Some(Sender { + login: get_env_variable("GITHUB_ACTOR")?, + id: get_env_variable("GITHUB_ACTOR_ID")?, + }), + base_ref: get_env_variable("GITHUB_BASE_REF").ok(), + repository_root_path, + }) + } +} + +impl RunEnvironmentDetector for GitHubActionsProvider { + fn detect() -> bool { + // check if the GITHUB_ACTIONS environment variable is set and the value is truthy + env::var("GITHUB_ACTIONS") == Ok("true".into()) + } +} + +impl RunEnvironmentProvider for GitHubActionsProvider { + fn get_repository_provider(&self) -> RepositoryProvider { + RepositoryProvider::GitHub + } + + fn get_logger(&self) -> Box { + Box::new(GithubActionLogger) + } + + fn get_run_environment(&self) -> RunEnvironment { + RunEnvironment::GithubActions + } + + fn get_run_environment_metadata(&self) -> Result { + Ok(RunEnvironmentMetadata { + base_ref: self.base_ref.clone(), + head_ref: self.head_ref.clone(), + event: self.event.clone(), + gh_data: Some(self.gh_data.clone()), + gl_data: None, + sender: self.sender.clone(), + owner: self.owner.clone(), + repository: self.repository.clone(), + ref_: self.ref_.clone(), + repository_root_path: self.repository_root_path.clone(), + }) + } + + /// For Github, the run environment run part is the most complicated + /// since we support matrix jobs. + /// + /// Computing the `run_part_id`: + /// - not in a matrix: + /// - simply take the job name + /// - in a matrix: + /// - take the job name + /// - concatenate it with key-values from `matrix` and `strategy` + /// + /// `GH_MATRIX` and `GH_STRATEGY` are environment variables computed by + /// https://github.com/CodSpeedHQ/action: + /// - `GH_MATRIX`: ${{ toJson(matrix) }} + /// - `GH_STRATEGY`: ${{ toJson(strategy) }} + /// + /// A note on parsing: + /// + /// The issue is these variables from Github Actions are multiline. + /// As we need to use them compute an identifier, we need them as a single line. + /// Plus we are interested in the content of these objects, + /// so it makes sense to parse and re-serialize them. + fn get_run_provider_run_part(&self) -> Option { + let job_name = self.gh_data.job.clone(); + + let mut metadata = BTreeMap::new(); + + let gh_matrix = get_env_variable("GH_MATRIX") + .ok() + .and_then(|v| serde_json::from_str::(&v).ok()); + + let gh_strategy = get_env_variable("GH_STRATEGY") + .ok() + .and_then(|v| serde_json::from_str::(&v).ok()); + + let run_part_id = if let (Some(Value::Object(matrix)), Some(Value::Object(mut strategy))) = + (gh_matrix, gh_strategy) + { + // remove useless values from the strategy + strategy.remove("fail-fast"); + strategy.remove("max-parallel"); + + // The re-serialization is on purpose here. We want to serialize it as a single line. + let matrix_str = serde_json::to_string(&matrix).expect("Unable to re-serialize matrix"); + let strategy_str = + serde_json::to_string(&strategy).expect("Unable to re-serialize strategy"); + + metadata.extend(matrix); + metadata.extend(strategy); + + format!("{job_name}-{matrix_str}-{strategy_str}") + } else { + job_name + }; + + Some(RunPart { + run_id: self.gh_data.run_id.clone(), + run_part_id, + job_name: self.gh_data.job.clone(), + metadata, + }) + } +} + +#[cfg(test)] +mod tests { + use insta::assert_json_snapshot; + use temp_env::{with_var, with_vars}; + + use crate::VERSION; + + use super::*; + + #[test] + fn test_detect() { + with_var("GITHUB_ACTIONS", Some("true"), || { + assert!(GitHubActionsProvider::detect()); + }); + } + + #[test] + fn test_get_owner_and_repository() { + with_var("GITHUB_REPOSITORY", Some("owner/repository"), || { + let (owner, repository) = GitHubActionsProvider::get_owner_and_repository().unwrap(); + assert_eq!(owner, "owner"); + assert_eq!(repository, "repository"); + }); + } + + #[test] + fn test_try_from_push_main() { + with_vars( + [ + ("GITHUB_ACTOR_ID", Some("1234567890")), + ("GITHUB_ACTOR", Some("actor")), + ("GITHUB_BASE_REF", Some("main")), + ("GITHUB_EVENT_NAME", Some("push")), + ("GITHUB_JOB", Some("job")), + ("GITHUB_REF", Some("refs/heads/main")), + ("GITHUB_REPOSITORY", Some("owner/repository")), + ("GITHUB_RUN_ID", Some("1234567890")), + ], + || { + let config = Config { + token: Some("token".into()), + ..Config::test() + }; + let github_actions_provider = GitHubActionsProvider::try_from(&config).unwrap(); + assert_eq!(github_actions_provider.owner, "owner"); + assert_eq!(github_actions_provider.repository, "repository"); + assert_eq!(github_actions_provider.ref_, "refs/heads/main"); + assert_eq!(github_actions_provider.base_ref, Some("main".into())); + assert_eq!(github_actions_provider.head_ref, None); + assert_eq!(github_actions_provider.event, RunEvent::Push); + assert_eq!(github_actions_provider.gh_data.job, "job"); + assert_eq!(github_actions_provider.gh_data.run_id, "1234567890"); + assert_eq!( + github_actions_provider.sender.as_ref().unwrap().login, + "actor" + ); + assert_eq!( + github_actions_provider.sender.as_ref().unwrap().id, + "1234567890" + ); + }, + ) + } + + #[test] + fn test_pull_request_run_environment_metadata() { + with_vars( + [ + ("GITHUB_ACTIONS", Some("true")), + ("GITHUB_ACTOR_ID", Some("19605940")), + ("GITHUB_ACTOR", Some("adriencaccia")), + ("GITHUB_BASE_REF", Some("main")), + ("GITHUB_EVENT_NAME", Some("pull_request")), + ( + "GITHUB_EVENT_PATH", + Some( + format!( + "{}/src/run/run_environment/github_actions/samples/pr-event.json", + env!("CARGO_MANIFEST_DIR") + ) + .as_str(), + ), + ), + ("GITHUB_HEAD_REF", Some("feat/codspeed-runner")), + ("GITHUB_JOB", Some("log-env")), + ("GITHUB_REF", Some("refs/pull/22/merge")), + ("GITHUB_REPOSITORY", Some("my-org/adrien-python-test")), + ("GITHUB_RUN_ID", Some("6957110437")), + ("VERSION", Some("0.1.0")), + ], + || { + let config = Config { + token: Some("token".into()), + ..Config::test() + }; + let github_actions_provider = GitHubActionsProvider::try_from(&config).unwrap(); + let run_environment_metadata = github_actions_provider + .get_run_environment_metadata() + .unwrap(); + let run_part = github_actions_provider.get_run_provider_run_part().unwrap(); + + assert_json_snapshot!(run_environment_metadata, { + ".runner.version" => insta::dynamic_redaction(|value,_path| { + assert_eq!(value.as_str().unwrap(), VERSION.to_string()); + "[version]" + }), + }); + assert_json_snapshot!(run_part); + }, + ); + } + + #[test] + fn test_fork_pull_request_run_environment_metadata() { + with_vars( + [ + ("GITHUB_ACTIONS", Some("true")), + ("GITHUB_ACTOR_ID", Some("19605940")), + ("GITHUB_ACTOR", Some("adriencaccia")), + ("GITHUB_BASE_REF", Some("main")), + ("GITHUB_EVENT_NAME", Some("pull_request")), + ( + "GITHUB_EVENT_PATH", + Some( + format!( + "{}/src/run/run_environment/github_actions/samples/fork-pr-event.json", + env!("CARGO_MANIFEST_DIR") + ) + .as_str(), + ), + ), + ("GITHUB_HEAD_REF", Some("feat/codspeed-runner")), + ("GITHUB_JOB", Some("log-env")), + ("GITHUB_REF", Some("refs/pull/22/merge")), + ("GITHUB_REPOSITORY", Some("my-org/adrien-python-test")), + ("GITHUB_RUN_ID", Some("6957110437")), + ("VERSION", Some("0.1.0")), + ("GH_MATRIX", Some("null")), + ], + || { + let config = Config { + token: Some("token".into()), + ..Config::test() + }; + let github_actions_provider = GitHubActionsProvider::try_from(&config).unwrap(); + let run_environment_metadata = github_actions_provider + .get_run_environment_metadata() + .unwrap(); + let run_part = github_actions_provider.get_run_provider_run_part().unwrap(); + + assert_eq!(run_environment_metadata.owner, "my-org"); + assert_eq!(run_environment_metadata.repository, "adrien-python-test"); + assert_eq!(run_environment_metadata.base_ref, Some("main".into())); + assert_eq!( + run_environment_metadata.head_ref, + Some("fork-owner:feat/codspeed-runner".into()) + ); + + assert_json_snapshot!(run_environment_metadata, { + ".runner.version" => insta::dynamic_redaction(|value,_path| { + assert_eq!(value.as_str().unwrap(), VERSION.to_string()); + "[version]" + }), + }); + assert_json_snapshot!(run_part); + }, + ); + } + + #[test] + fn test_matrix_job_run_environment_metadata() { + with_vars( + [ + ("GITHUB_ACTIONS", Some("true")), + ("GITHUB_ACTOR_ID", Some("19605940")), + ("GITHUB_ACTOR", Some("adriencaccia")), + ("GITHUB_BASE_REF", Some("main")), + ("GITHUB_EVENT_NAME", Some("pull_request")), + ( + "GITHUB_EVENT_PATH", + Some( + format!( + "{}/src/run/run_environment/github_actions/samples/pr-event.json", + env!("CARGO_MANIFEST_DIR") + ) + .as_str(), + ), + ), + ("GITHUB_HEAD_REF", Some("feat/codspeed-runner")), + ("GITHUB_JOB", Some("log-env")), + ("GITHUB_REF", Some("refs/pull/22/merge")), + ("GITHUB_REPOSITORY", Some("my-org/adrien-python-test")), + ("GITHUB_RUN_ID", Some("6957110437")), + ("VERSION", Some("0.1.0")), + ( + "GH_MATRIX", + Some( + r#"{ + "runner-version":"3.2.1", + "numeric-value":123456789 +}"#, + ), + ), + ( + "GH_STRATEGY", + Some( + r#"{ + "fail-fast":true, + "job-index":1, + "job-total":2, + "max-parallel":2 +}"#, + ), + ), + ], + || { + let config = Config { + token: Some("token".into()), + ..Config::test() + }; + let github_actions_provider = GitHubActionsProvider::try_from(&config).unwrap(); + let run_environment_metadata = github_actions_provider + .get_run_environment_metadata() + .unwrap(); + let run_part = github_actions_provider.get_run_provider_run_part().unwrap(); + + assert_json_snapshot!(run_environment_metadata, { + ".runner.version" => insta::dynamic_redaction(|value,_path| { + assert_eq!(value.as_str().unwrap(), VERSION.to_string()); + "[version]" + }), + }); + assert_json_snapshot!(run_part); + }, + ); + } + + #[test] + fn test_get_run_part_no_matrix() { + with_vars([("GITHUB_ACTIONS", Some("true"))], || { + let github_actions_provider = GitHubActionsProvider { + owner: "owner".into(), + repository: "repository".into(), + ref_: "refs/head/my-branch".into(), + head_ref: Some("my-branch".into()), + base_ref: None, + sender: None, + gh_data: GhData { + job: "my_job".into(), + run_id: "123789".into(), + }, + event: RunEvent::Push, + repository_root_path: "/home/work/my-repo".into(), + }; + + let run_part = github_actions_provider.get_run_provider_run_part().unwrap(); + + assert_eq!(run_part.run_id, "123789"); + assert_eq!(run_part.job_name, "my_job"); + assert_eq!(run_part.run_part_id, "my_job"); + assert_json_snapshot!(run_part.metadata, @"{}"); + }) + } + + #[test] + fn test_get_run_part_null_matrix() { + with_vars( + [ + ("GH_MATRIX", Some("null")), + ( + "GH_STRATEGY", + Some( + r#"{ + "fail-fast":true, + "job-index":0, + "job-total":1, + "max-parallel":1 +}"#, + ), + ), + ], + || { + let github_actions_provider = GitHubActionsProvider { + owner: "owner".into(), + repository: "repository".into(), + ref_: "refs/head/my-branch".into(), + head_ref: Some("my-branch".into()), + base_ref: None, + sender: None, + gh_data: GhData { + job: "my_job".into(), + run_id: "123789".into(), + }, + event: RunEvent::Push, + repository_root_path: "/home/work/my-repo".into(), + }; + + let run_part = github_actions_provider.get_run_provider_run_part().unwrap(); + + assert_eq!(run_part.run_id, "123789"); + assert_eq!(run_part.job_name, "my_job"); + assert_eq!(run_part.run_part_id, "my_job"); + assert_json_snapshot!(run_part.metadata, @"{}"); + }, + ) + } + + #[test] + fn test_get_matrix_run_part() { + with_vars( + [ + ( + "GH_MATRIX", + Some( + r#"{ + "runner-version":"3.2.1", + "numeric-value":123456789 +}"#, + ), + ), + ( + "GH_STRATEGY", + Some( + r#"{ + "fail-fast":true, + "job-index":1, + "job-total":2, + "max-parallel":2 +}"#, + ), + ), + ], + || { + let github_actions_provider = GitHubActionsProvider { + owner: "owner".into(), + repository: "repository".into(), + ref_: "refs/head/my-branch".into(), + head_ref: Some("my-branch".into()), + base_ref: None, + sender: None, + gh_data: GhData { + job: "my_job".into(), + run_id: "123789".into(), + }, + event: RunEvent::Push, + repository_root_path: "/home/work/my-repo".into(), + }; + + let run_part = github_actions_provider.get_run_provider_run_part().unwrap(); + + assert_eq!(run_part.run_id, "123789"); + assert_eq!(run_part.job_name, "my_job"); + assert_eq!(run_part.run_part_id, "my_job-{\"runner-version\":\"3.2.1\",\"numeric-value\":123456789}-{\"job-total\":2,\"job-index\":1}"); + assert_json_snapshot!(run_part.metadata, @r#" + { + "job-index": 1, + "job-total": 2, + "numeric-value": 123456789, + "runner-version": "3.2.1" + } + "#); + }, + ) + } + + #[test] + fn test_get_inline_matrix_run_part() { + with_vars( + [ + ( + "GH_MATRIX", + Some("{\"runner-version\":\"3.2.1\",\"numeric-value\":123456789}"), + ), + ( + "GH_STRATEGY", + Some("{\"fail-fast\":true,\"job-index\":1,\"job-total\":2,\"max-parallel\":2}"), + ), + ], + || { + let github_actions_provider = GitHubActionsProvider { + owner: "owner".into(), + repository: "repository".into(), + ref_: "refs/head/my-branch".into(), + head_ref: Some("my-branch".into()), + base_ref: None, + sender: None, + gh_data: GhData { + job: "my_job".into(), + run_id: "123789".into(), + }, + event: RunEvent::Push, + repository_root_path: "/home/work/my-repo".into(), + }; + + let run_part = github_actions_provider.get_run_provider_run_part().unwrap(); + + assert_eq!(run_part.run_id, "123789"); + assert_eq!(run_part.job_name, "my_job"); + assert_eq!(run_part.run_part_id, "my_job-{\"runner-version\":\"3.2.1\",\"numeric-value\":123456789}-{\"job-total\":2,\"job-index\":1}"); + assert_json_snapshot!(run_part.metadata, @r#" + { + "job-index": 1, + "job-total": 2, + "numeric-value": 123456789, + "runner-version": "3.2.1" + } + "#); + }, + ) + } +} diff --git a/src/run/ci_provider/github_actions/samples/fork-pr-event.json b/src/run/run_environment/github_actions/samples/fork-pr-event.json similarity index 100% rename from src/run/ci_provider/github_actions/samples/fork-pr-event.json rename to src/run/run_environment/github_actions/samples/fork-pr-event.json diff --git a/src/run/ci_provider/github_actions/samples/pr-event.json b/src/run/run_environment/github_actions/samples/pr-event.json similarity index 100% rename from src/run/ci_provider/github_actions/samples/pr-event.json rename to src/run/run_environment/github_actions/samples/pr-event.json diff --git a/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata-2.snap b/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata-2.snap new file mode 100644 index 00000000..00d51e01 --- /dev/null +++ b/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata-2.snap @@ -0,0 +1,10 @@ +--- +source: src/run/run_environment/github_actions/provider.rs +expression: run_part +--- +{ + "runId": "6957110437", + "runPartId": "log-env", + "jobName": "log-env", + "metadata": {} +} diff --git a/src/run/ci_provider/github_actions/snapshots/codspeed__run__ci_provider__github_actions__provider__tests__fork_pull_request_provider_metadata.snap b/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata.snap similarity index 81% rename from src/run/ci_provider/github_actions/snapshots/codspeed__run__ci_provider__github_actions__provider__tests__fork_pull_request_provider_metadata.snap rename to src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata.snap index fe6e8dc9..7154fdf6 100644 --- a/src/run/ci_provider/github_actions/snapshots/codspeed__run__ci_provider__github_actions__provider__tests__fork_pull_request_provider_metadata.snap +++ b/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata.snap @@ -1,6 +1,6 @@ --- -source: src/run/ci_provider/github_actions/provider.rs -expression: provider_metadata +source: src/run/run_environment/github_actions/provider.rs +expression: run_environment_metadata --- { "ref": "refs/pull/22/merge", diff --git a/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata-2.snap b/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata-2.snap new file mode 100644 index 00000000..737ea261 --- /dev/null +++ b/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata-2.snap @@ -0,0 +1,15 @@ +--- +source: src/run/run_environment/github_actions/provider.rs +expression: run_part +--- +{ + "runId": "6957110437", + "runPartId": "log-env-{\"runner-version\":\"3.2.1\",\"numeric-value\":123456789}-{\"job-total\":2,\"job-index\":1}", + "jobName": "log-env", + "metadata": { + "job-index": 1, + "job-total": 2, + "numeric-value": 123456789, + "runner-version": "3.2.1" + } +} diff --git a/src/run/ci_provider/github_actions/snapshots/codspeed__run__ci_provider__github_actions__provider__tests__pull_request_provider_metadata.snap b/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata.snap similarity index 81% rename from src/run/ci_provider/github_actions/snapshots/codspeed__run__ci_provider__github_actions__provider__tests__pull_request_provider_metadata.snap rename to src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata.snap index 48065dcd..45b5b79c 100644 --- a/src/run/ci_provider/github_actions/snapshots/codspeed__run__ci_provider__github_actions__provider__tests__pull_request_provider_metadata.snap +++ b/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata.snap @@ -1,6 +1,6 @@ --- -source: src/run/ci_provider/github_actions/provider.rs -expression: provider_metadata +source: src/run/run_environment/github_actions/provider.rs +expression: run_environment_metadata --- { "ref": "refs/pull/22/merge", diff --git a/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata-2.snap b/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata-2.snap new file mode 100644 index 00000000..00d51e01 --- /dev/null +++ b/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata-2.snap @@ -0,0 +1,10 @@ +--- +source: src/run/run_environment/github_actions/provider.rs +expression: run_part +--- +{ + "runId": "6957110437", + "runPartId": "log-env", + "jobName": "log-env", + "metadata": {} +} diff --git a/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata.snap b/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata.snap new file mode 100644 index 00000000..45b5b79c --- /dev/null +++ b/src/run/run_environment/github_actions/snapshots/codspeed__run__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata.snap @@ -0,0 +1,22 @@ +--- +source: src/run/run_environment/github_actions/provider.rs +expression: run_environment_metadata +--- +{ + "ref": "refs/pull/22/merge", + "headRef": "feat/codspeed-runner", + "baseRef": "main", + "owner": "my-org", + "repository": "adrien-python-test", + "event": "pull_request", + "sender": { + "id": "19605940", + "login": "adriencaccia" + }, + "ghData": { + "runId": "6957110437", + "job": "log-env" + }, + "glData": null, + "repositoryRootPath": "/home/runner/work/adrien-python-test/adrien-python-test/" +} diff --git a/src/run/ci_provider/gitlab_ci/logger.rs b/src/run/run_environment/gitlab_ci/logger.rs similarity index 98% rename from src/run/ci_provider/gitlab_ci/logger.rs rename to src/run/run_environment/gitlab_ci/logger.rs index 6171ee54..59cfed41 100644 --- a/src/run/ci_provider/gitlab_ci/logger.rs +++ b/src/run/run_environment/gitlab_ci/logger.rs @@ -12,7 +12,7 @@ use std::{ use crate::{ logger::{get_group_event, GroupEvent}, - run::ci_provider::logger::should_provider_logger_handle_record, + run::run_environment::logger::should_provider_logger_handle_record, }; lazy_static! { diff --git a/src/run/ci_provider/gitlab_ci/mod.rs b/src/run/run_environment/gitlab_ci/mod.rs similarity index 100% rename from src/run/ci_provider/gitlab_ci/mod.rs rename to src/run/run_environment/gitlab_ci/mod.rs diff --git a/src/run/ci_provider/gitlab_ci/provider.rs b/src/run/run_environment/gitlab_ci/provider.rs similarity index 83% rename from src/run/ci_provider/gitlab_ci/provider.rs rename to src/run/run_environment/gitlab_ci/provider.rs index 0d09d98f..f6eb348c 100644 --- a/src/run/ci_provider/gitlab_ci/provider.rs +++ b/src/run/run_environment/gitlab_ci/provider.rs @@ -1,14 +1,15 @@ use simplelog::SharedLogger; +use std::collections::BTreeMap; use std::env; use crate::prelude::*; -use crate::run::ci_provider::interfaces::{ - CIProviderMetadata, GlData, RepositoryProvider, RunEvent, Sender, -}; -use crate::run::ci_provider::provider::CIProviderDetector; -use crate::run::ci_provider::CIProvider; use crate::run::config::Config; use crate::run::helpers::get_env_variable; +use crate::run::run_environment::interfaces::{ + GlData, RepositoryProvider, RunEnvironment, RunEnvironmentMetadata, RunEvent, Sender, +}; +use crate::run::run_environment::provider::RunEnvironmentDetector; +use crate::run::run_environment::{RunEnvironmentProvider, RunPart}; use super::logger::GitLabCILogger; @@ -128,14 +129,14 @@ impl TryFrom<&Config> for GitLabCIProvider { } } -impl CIProviderDetector for GitLabCIProvider { +impl RunEnvironmentDetector for GitLabCIProvider { fn detect() -> bool { // check if the GITLAB_CI environment variable is set and the value is truthy env::var("GITLAB_CI") == Ok("true".into()) } } -impl CIProvider for GitLabCIProvider { +impl RunEnvironmentProvider for GitLabCIProvider { fn get_logger(&self) -> Box { Box::new(GitLabCILogger::new()) } @@ -144,16 +145,12 @@ impl CIProvider for GitLabCIProvider { RepositoryProvider::GitLab } - fn get_provider_name(&self) -> &'static str { - "GitLab CI" - } - - fn get_provider_slug(&self) -> &'static str { - "gitlab-ci" + fn get_run_environment(&self) -> RunEnvironment { + RunEnvironment::GitlabCi } - fn get_ci_provider_metadata(&self) -> Result { - Ok(CIProviderMetadata { + fn get_run_environment_metadata(&self) -> Result { + Ok(RunEnvironmentMetadata { base_ref: self.base_ref.clone(), head_ref: self.head_ref.clone(), event: self.event.clone(), @@ -166,6 +163,15 @@ impl CIProvider for GitLabCIProvider { repository_root_path: self.repository_root_path.clone(), }) } + + fn get_run_provider_run_part(&self) -> Option { + Some(RunPart { + run_id: self.gl_data.run_id.clone(), + run_part_id: self.gl_data.job.clone(), + job_name: self.gl_data.job.clone(), + metadata: BTreeMap::new(), + }) + } } #[cfg(test)] @@ -185,7 +191,7 @@ mod tests { } #[test] - fn test_push_main_provider_metadata() { + fn test_push_main_run_environment_metadata() { with_vars( [ ("GITLAB_CI", Some("true")), @@ -205,20 +211,23 @@ mod tests { ..Config::test() }; let gitlab_ci_provider = GitLabCIProvider::try_from(&config).unwrap(); - let provider_metadata = gitlab_ci_provider.get_ci_provider_metadata().unwrap(); + let run_environment_metadata = + gitlab_ci_provider.get_run_environment_metadata().unwrap(); + let run_part = gitlab_ci_provider.get_run_provider_run_part().unwrap(); - assert_json_snapshot!(provider_metadata, { + assert_json_snapshot!(run_environment_metadata, { ".runner.version" => insta::dynamic_redaction(|value,_path| { assert_eq!(value.as_str().unwrap(), VERSION.to_string()); "[version]" }), }); + assert_json_snapshot!(run_part); }, ) } #[test] - fn test_merge_request_provider_metadata() { + fn test_merge_request_run_environment_metadata() { with_vars( [ ("GITLAB_CI", Some("true")), @@ -249,20 +258,23 @@ mod tests { ..Config::test() }; let gitlab_ci_provider = GitLabCIProvider::try_from(&config).unwrap(); - let provider_metadata = gitlab_ci_provider.get_ci_provider_metadata().unwrap(); + let run_environment_metadata = + gitlab_ci_provider.get_run_environment_metadata().unwrap(); + let run_part = gitlab_ci_provider.get_run_provider_run_part().unwrap(); - assert_json_snapshot!(provider_metadata, { + assert_json_snapshot!(run_environment_metadata, { ".runner.version" => insta::dynamic_redaction(|value,_path| { assert_eq!(value.as_str().unwrap(), VERSION.to_string()); "[version]" }), }); + assert_json_snapshot!(run_part); }, ); } #[test] - fn test_fork_merge_request_provider_metadata() { + fn test_fork_merge_request_run_environment_metadata() { with_vars( [ ("GITLAB_CI", Some("true")), @@ -293,14 +305,17 @@ mod tests { ..Config::test() }; let gitlab_ci_provider = GitLabCIProvider::try_from(&config).unwrap(); - let provider_metadata = gitlab_ci_provider.get_ci_provider_metadata().unwrap(); + let run_environment_metadata = + gitlab_ci_provider.get_run_environment_metadata().unwrap(); + let run_part = gitlab_ci_provider.get_run_provider_run_part().unwrap(); - assert_json_snapshot!(provider_metadata, { + assert_json_snapshot!(run_environment_metadata, { ".runner.version" => insta::dynamic_redaction(|value,_path| { assert_eq!(value.as_str().unwrap(), VERSION.to_string()); "[version]" }), }); + assert_json_snapshot!(run_part); }, ); } diff --git a/src/run/ci_provider/gitlab_ci/snapshots/codspeed__run__ci_provider__gitlab_ci__provider__tests__fork_merge_request_provider_metadata.snap b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__fork_merge_request_provider_metadata.snap similarity index 81% rename from src/run/ci_provider/gitlab_ci/snapshots/codspeed__run__ci_provider__gitlab_ci__provider__tests__fork_merge_request_provider_metadata.snap rename to src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__fork_merge_request_provider_metadata.snap index 97a35ae7..4e408c8b 100644 --- a/src/run/ci_provider/gitlab_ci/snapshots/codspeed__run__ci_provider__gitlab_ci__provider__tests__fork_merge_request_provider_metadata.snap +++ b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__fork_merge_request_provider_metadata.snap @@ -1,6 +1,6 @@ --- -source: src/run/ci_provider/gitlab_ci/provider.rs -expression: provider_metadata +source: src/run/run_environment/gitlab_ci/provider.rs +expression: run_environment_metadata --- { "ref": "refs/pull/5/merge", diff --git a/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata-2.snap b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata-2.snap new file mode 100644 index 00000000..23423e53 --- /dev/null +++ b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata-2.snap @@ -0,0 +1,10 @@ +--- +source: src/run/run_environment/gitlab_ci/provider.rs +expression: run_part +--- +{ + "runId": "6957110437", + "runPartId": "build-job", + "jobName": "build-job", + "metadata": {} +} diff --git a/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata.snap b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata.snap new file mode 100644 index 00000000..4e408c8b --- /dev/null +++ b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata.snap @@ -0,0 +1,22 @@ +--- +source: src/run/run_environment/gitlab_ci/provider.rs +expression: run_environment_metadata +--- +{ + "ref": "refs/pull/5/merge", + "headRef": "fork-owner:feat/awesome-feature", + "baseRef": "main", + "owner": "owner", + "repository": "repository", + "event": "pull_request", + "sender": { + "id": "19605940", + "login": "actor" + }, + "ghData": null, + "glData": { + "runId": "6957110437", + "job": "build-job" + }, + "repositoryRootPath": "/builds/owner/repository" +} diff --git a/src/run/ci_provider/gitlab_ci/snapshots/codspeed__run__ci_provider__gitlab_ci__provider__tests__merge_request_provider_metadata.snap b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__merge_request_provider_metadata.snap similarity index 80% rename from src/run/ci_provider/gitlab_ci/snapshots/codspeed__run__ci_provider__gitlab_ci__provider__tests__merge_request_provider_metadata.snap rename to src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__merge_request_provider_metadata.snap index a8f496c3..ae588919 100644 --- a/src/run/ci_provider/gitlab_ci/snapshots/codspeed__run__ci_provider__gitlab_ci__provider__tests__merge_request_provider_metadata.snap +++ b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__merge_request_provider_metadata.snap @@ -1,6 +1,6 @@ --- -source: src/run/ci_provider/gitlab_ci/provider.rs -expression: provider_metadata +source: src/run/run_environment/gitlab_ci/provider.rs +expression: run_environment_metadata --- { "ref": "refs/pull/5/merge", diff --git a/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata-2.snap b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata-2.snap new file mode 100644 index 00000000..23423e53 --- /dev/null +++ b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata-2.snap @@ -0,0 +1,10 @@ +--- +source: src/run/run_environment/gitlab_ci/provider.rs +expression: run_part +--- +{ + "runId": "6957110437", + "runPartId": "build-job", + "jobName": "build-job", + "metadata": {} +} diff --git a/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata.snap b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata.snap new file mode 100644 index 00000000..ae588919 --- /dev/null +++ b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata.snap @@ -0,0 +1,22 @@ +--- +source: src/run/run_environment/gitlab_ci/provider.rs +expression: run_environment_metadata +--- +{ + "ref": "refs/pull/5/merge", + "headRef": "feat/awesome-feature", + "baseRef": "main", + "owner": "owner", + "repository": "repository", + "event": "pull_request", + "sender": { + "id": "19605940", + "login": "actor" + }, + "ghData": null, + "glData": { + "runId": "6957110437", + "job": "build-job" + }, + "repositoryRootPath": "/builds/owner/repository" +} diff --git a/src/run/ci_provider/gitlab_ci/snapshots/codspeed__run__ci_provider__gitlab_ci__provider__tests__push_main_provider_metadata.snap b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__push_main_provider_metadata.snap similarity index 79% rename from src/run/ci_provider/gitlab_ci/snapshots/codspeed__run__ci_provider__gitlab_ci__provider__tests__push_main_provider_metadata.snap rename to src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__push_main_provider_metadata.snap index 58dcef0b..de2361e9 100644 --- a/src/run/ci_provider/gitlab_ci/snapshots/codspeed__run__ci_provider__gitlab_ci__provider__tests__push_main_provider_metadata.snap +++ b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__push_main_provider_metadata.snap @@ -1,6 +1,6 @@ --- -source: src/run/ci_provider/gitlab_ci/provider.rs -expression: provider_metadata +source: src/run/run_environment/gitlab_ci/provider.rs +expression: run_environment_metadata --- { "ref": "refs/heads/main", diff --git a/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata-2.snap b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata-2.snap new file mode 100644 index 00000000..ce460485 --- /dev/null +++ b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata-2.snap @@ -0,0 +1,10 @@ +--- +source: src/run/run_environment/gitlab_ci/provider.rs +expression: run_part +--- +{ + "runId": "1234567890", + "runPartId": "job", + "jobName": "job", + "metadata": {} +} diff --git a/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata.snap b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata.snap new file mode 100644 index 00000000..de2361e9 --- /dev/null +++ b/src/run/run_environment/gitlab_ci/snapshots/codspeed__run__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata.snap @@ -0,0 +1,22 @@ +--- +source: src/run/run_environment/gitlab_ci/provider.rs +expression: run_environment_metadata +--- +{ + "ref": "refs/heads/main", + "headRef": null, + "baseRef": "main", + "owner": "owner", + "repository": "repository", + "event": "push", + "sender": { + "id": "1234567890", + "login": "actor" + }, + "ghData": null, + "glData": { + "runId": "1234567890", + "job": "job" + }, + "repositoryRootPath": "/builds/owner/repository" +} diff --git a/src/run/run_environment/interfaces.rs b/src/run/run_environment/interfaces.rs new file mode 100644 index 00000000..8f4e626b --- /dev/null +++ b/src/run/run_environment/interfaces.rs @@ -0,0 +1,97 @@ +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::collections::BTreeMap; + +#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)] +#[serde(rename_all = "UPPERCASE")] +pub enum RepositoryProvider { + GitLab, + GitHub, +} + +#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum RunEnvironment { + GithubActions, + GitlabCi, + Buildkite, + Local, +} + +#[derive(Deserialize, Serialize, Debug)] +#[serde(rename_all = "camelCase")] +pub struct RunEnvironmentMetadata { + #[serde(rename = "ref")] + pub ref_: String, + pub head_ref: Option, + pub base_ref: Option, + pub owner: String, + pub repository: String, + pub event: RunEvent, + pub sender: Option, + pub gh_data: Option, + pub gl_data: Option, + pub repository_root_path: String, +} + +#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum RunEvent { + Push, + PullRequest, + WorkflowDispatch, + Schedule, + Local, +} + +#[derive(Deserialize, Serialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct GhData { + pub run_id: String, + pub job: String, +} + +#[derive(Deserialize, Serialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct GlData { + pub run_id: String, + pub job: String, +} + +/// Each execution of the CLI maps to a `RunPart`. +/// +/// Several `RunParts` can be aggregated in a single `Run` thanks to this data. +#[derive(Deserialize, Serialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct RunPart { + /// A unique identifier of the `Run` on the run environment + /// + /// For example, the `runId` on Github Actions + pub run_id: String, + + /// Uniquely identify a `RunPart` within a `Run`. + /// + /// This id can be the same between `RunParts` of different `Runs`. + pub run_part_id: String, + + /// The name of the job. For example, on Github Actions, the workflow name. + /// + /// This is **not** unique between executions of the CLI, even between matrix jobs. + pub job_name: String, + + /// Some relevant metadata. + /// + /// This can include matrix and strategy for GithubActions, + /// some relevant env values. + /// + /// We use a `BTreeMap` and not a `HashMap` to keep insert order for + /// `serde_json` serialization. + pub metadata: BTreeMap, +} + +#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)] +#[serde(rename_all = "camelCase")] +pub struct Sender { + pub id: String, + pub login: String, +} diff --git a/src/run/ci_provider/local/mod.rs b/src/run/run_environment/local/mod.rs similarity index 100% rename from src/run/ci_provider/local/mod.rs rename to src/run/run_environment/local/mod.rs diff --git a/src/run/ci_provider/local/provider.rs b/src/run/run_environment/local/provider.rs similarity index 89% rename from src/run/ci_provider/local/provider.rs rename to src/run/run_environment/local/provider.rs index 10ab4760..ecda4124 100644 --- a/src/run/ci_provider/local/provider.rs +++ b/src/run/run_environment/local/provider.rs @@ -4,13 +4,14 @@ use simplelog::SharedLogger; use crate::local_logger::get_local_logger; use crate::prelude::*; use crate::run::helpers::{parse_git_remote, GitRemote}; +use crate::run::run_environment::{RunEnvironment, RunPart}; use crate::run::{ - ci_provider::{ - interfaces::{CIProviderMetadata, RepositoryProvider, RunEvent}, - provider::{CIProvider, CIProviderDetector}, - }, config::Config, helpers::find_repository_root, + run_environment::{ + interfaces::{RepositoryProvider, RunEnvironmentMetadata, RunEvent}, + provider::{RunEnvironmentDetector, RunEnvironmentProvider}, + }, }; #[derive(Debug)] @@ -98,13 +99,13 @@ impl TryFrom<&Config> for LocalProvider { } } -impl CIProviderDetector for LocalProvider { +impl RunEnvironmentDetector for LocalProvider { fn detect() -> bool { true } } -impl CIProvider for LocalProvider { +impl RunEnvironmentProvider for LocalProvider { fn get_repository_provider(&self) -> RepositoryProvider { self.repository_provider.clone() } @@ -113,16 +114,12 @@ impl CIProvider for LocalProvider { get_local_logger() } - fn get_provider_name(&self) -> &'static str { - "Local" - } - - fn get_provider_slug(&self) -> &'static str { - "local" + fn get_run_environment(&self) -> RunEnvironment { + RunEnvironment::Local } - fn get_ci_provider_metadata(&self) -> Result { - Ok(CIProviderMetadata { + fn get_run_environment_metadata(&self) -> Result { + Ok(RunEnvironmentMetadata { base_ref: self.base_ref.clone(), head_ref: self.head_ref.clone(), event: self.event.clone(), @@ -135,6 +132,11 @@ impl CIProvider for LocalProvider { repository_root_path: self.repository_root_path.clone(), }) } + + /// For local runs have, we cannot really send anything here + fn get_run_provider_run_part(&self) -> Option { + None + } } #[cfg(test)] diff --git a/src/run/ci_provider/logger.rs b/src/run/run_environment/logger.rs similarity index 100% rename from src/run/ci_provider/logger.rs rename to src/run/run_environment/logger.rs diff --git a/src/run/ci_provider/mod.rs b/src/run/run_environment/mod.rs similarity index 70% rename from src/run/ci_provider/mod.rs rename to src/run/run_environment/mod.rs index 9d7e1548..f2ac6b80 100644 --- a/src/run/ci_provider/mod.rs +++ b/src/run/run_environment/mod.rs @@ -1,4 +1,3 @@ -mod gitlab_ci; pub mod interfaces; pub mod logger; mod provider; @@ -7,19 +6,21 @@ use buildkite::BuildkiteProvider; use github_actions::GitHubActionsProvider; use gitlab_ci::GitLabCIProvider; use local::LocalProvider; -use provider::CIProviderDetector; +use provider::RunEnvironmentDetector; use crate::prelude::*; use crate::run::config::Config; -pub use self::provider::CIProvider; +pub use self::interfaces::*; +pub use self::provider::RunEnvironmentProvider; -// Provider implementations +// RunEnvironment Provider implementations mod buildkite; mod github_actions; +mod gitlab_ci; mod local; -pub fn get_provider(config: &Config) -> Result> { +pub fn get_provider(config: &Config) -> Result> { if BuildkiteProvider::detect() { let provider = BuildkiteProvider::try_from(config)?; return Ok(Box::new(provider)); @@ -40,5 +41,6 @@ pub fn get_provider(config: &Config) -> Result> { return Ok(Box::new(provider)); } - bail!("No CI provider detected") + // By design, this should not happen as the `LocalProvider` is a fallback + bail!("No RunEnvironment provider detected") } diff --git a/src/run/ci_provider/provider.rs b/src/run/run_environment/provider.rs similarity index 64% rename from src/run/ci_provider/provider.rs rename to src/run/run_environment/provider.rs index c9df0988..70d98548 100644 --- a/src/run/ci_provider/provider.rs +++ b/src/run/run_environment/provider.rs @@ -7,10 +7,10 @@ use crate::run::config::Config; use crate::run::runner::ExecutorName; use crate::run::uploader::{Runner, UploadMetadata}; -use super::interfaces::{CIProviderMetadata, RepositoryProvider}; +use super::interfaces::{RepositoryProvider, RunEnvironment, RunEnvironmentMetadata, RunPart}; -pub trait CIProviderDetector { - /// Detects if the current environment is running inside the CI provider. +pub trait RunEnvironmentDetector { + /// Detects if the runner is currently executed within this run environment. fn detect() -> bool; } @@ -29,36 +29,23 @@ fn get_commit_hash(repository_root_path: &str) -> Result { Ok(commit_hash) } -/// `CIProvider` is a trait that defines the necessary methods for a continuous integration provider. -pub trait CIProvider { - /// Returns the logger for the CI provider. +/// `RunEnvironmentProvider` is a trait that defines the necessary methods +/// for a continuous integration provider. +pub trait RunEnvironmentProvider { + /// Returns the logger for the RunEnvironment. fn get_logger(&self) -> Box; - /// Returns the repository provider for this CI provider + /// Returns the repository provider for this RunEnvironment fn get_repository_provider(&self) -> RepositoryProvider; - /// Returns the name of the CI provider. - /// - /// # Example - /// - /// ``` - /// let provider = MyCIProvider::new(); - /// assert_eq!(provider.get_provider_name(), "MyCIProvider"); - /// ``` - fn get_provider_name(&self) -> &'static str; + /// Returns the run environment of the current provider. + fn get_run_environment(&self) -> RunEnvironment; - /// Returns the slug of the CI provider. - /// - /// # Example - /// - /// ``` - /// let provider = MyCIProvider::new(); - /// assert_eq!(provider.get_provider_slug(), "my-ci-provider"); - /// ``` - fn get_provider_slug(&self) -> &'static str; + /// Returns the metadata related to the RunEnvironment. + fn get_run_environment_metadata(&self) -> Result; - /// Returns the metadata related to the CI provider. - fn get_ci_provider_metadata(&self) -> Result; + /// Return the metadata necessary to identify the `RunPart` + fn get_run_provider_run_part(&self) -> Option; /// Returns the metadata necessary for uploading results to CodSpeed. /// @@ -83,15 +70,15 @@ pub trait CIProvider { archive_hash: &str, executor_name: ExecutorName, ) -> Result { - let ci_provider_metadata = self.get_ci_provider_metadata()?; + let run_environment_metadata = self.get_run_environment_metadata()?; - let commit_hash = get_commit_hash(&ci_provider_metadata.repository_root_path)?; + let commit_hash = get_commit_hash(&run_environment_metadata.repository_root_path)?; Ok(UploadMetadata { - version: Some(5), + version: Some(6), tokenless: config.token.is_none(), repository_provider: self.get_repository_provider(), - ci_provider_metadata, + run_environment_metadata, profile_md5: archive_hash.into(), commit_hash, runner: Runner { @@ -101,7 +88,8 @@ pub trait CIProvider { executor: executor_name, system_info: system_info.clone(), }, - platform: self.get_provider_slug().into(), + run_environment: self.get_run_environment(), + run_part: self.get_run_provider_run_part(), }) } } diff --git a/src/run/uploader/interfaces.rs b/src/run/uploader/interfaces.rs index ebaa1d59..ad43fd94 100644 --- a/src/run/uploader/interfaces.rs +++ b/src/run/uploader/interfaces.rs @@ -2,8 +2,8 @@ use serde::{Deserialize, Serialize}; use crate::run::{ check_system::SystemInfo, - ci_provider::interfaces::{CIProviderMetadata, RepositoryProvider}, instruments::InstrumentName, + run_environment::{RepositoryProvider, RunEnvironment, RunEnvironmentMetadata, RunPart}, runner::ExecutorName, }; @@ -15,10 +15,11 @@ pub struct UploadMetadata { pub tokenless: bool, pub profile_md5: String, pub runner: Runner, - pub platform: String, + pub run_environment: RunEnvironment, + pub run_part: Option, pub commit_hash: String, #[serde(flatten)] - pub ci_provider_metadata: CIProviderMetadata, + pub run_environment_metadata: RunEnvironmentMetadata, } #[derive(Deserialize, Serialize, Debug)] diff --git a/src/run/uploader/snapshots/codspeed__run__uploader__upload_metadata__tests__get_metadata_hash.snap b/src/run/uploader/snapshots/codspeed__run__uploader__upload_metadata__tests__get_metadata_hash-2.snap similarity index 80% rename from src/run/uploader/snapshots/codspeed__run__uploader__upload_metadata__tests__get_metadata_hash.snap rename to src/run/uploader/snapshots/codspeed__run__uploader__upload_metadata__tests__get_metadata_hash-2.snap index 777124fb..cec82e18 100644 --- a/src/run/uploader/snapshots/codspeed__run__uploader__upload_metadata__tests__get_metadata_hash.snap +++ b/src/run/uploader/snapshots/codspeed__run__uploader__upload_metadata__tests__get_metadata_hash-2.snap @@ -4,7 +4,7 @@ expression: upload_metadata --- { "repositoryProvider": "GITHUB", - "version": 5, + "version": 6, "tokenless": true, "profileMd5": "jp/k05RKuqP3ERQuIIvx4Q==", "runner": { @@ -25,7 +25,16 @@ expression: upload_metadata "cpuCores": 2, "totalMemoryGb": 8 }, - "platform": "github-actions", + "runEnvironment": "GITHUB_ACTIONS", + "runPart": { + "runId": "7044765741", + "runPartId": "benchmarks_3.2.2", + "jobName": "codspeed", + "metadata": { + "anotherKey": "anotherValue", + "someKey": "someValue" + } + }, "commitHash": "5bd77cb0da72bef094893ed45fb793ff16ecfbe3", "ref": "refs/pull/29/merge", "headRef": "chore/native-action-runner", diff --git a/src/run/uploader/upload.rs b/src/run/uploader/upload.rs index 06c61937..0a568f76 100644 --- a/src/run/uploader/upload.rs +++ b/src/run/uploader/upload.rs @@ -1,6 +1,9 @@ -use crate::run::runner::ExecutorName; use crate::run::{ - check_system::SystemInfo, ci_provider::CIProvider, config::Config, runner::RunData, + check_system::SystemInfo, + config::Config, + run_environment::{RunEnvironment, RunEnvironmentProvider}, + runner::ExecutorName, + runner::RunData, uploader::UploadError, }; use crate::{prelude::*, request_client::REQUEST_CLIENT}; @@ -51,11 +54,12 @@ async fn retrieve_upload_data( .map(|body| body.error) .unwrap_or(text); if status == StatusCode::UNAUTHORIZED { - let additional_message = if upload_metadata.platform == "local" { - "Run `codspeed auth login` to authenticate the CLI" - } else { - "Check that CODSPEED_TOKEN is set and has the correct value" - }; + let additional_message = + if upload_metadata.run_environment == RunEnvironment::Local { + "Run `codspeed auth login` to authenticate the CLI" + } else { + "Check that CODSPEED_TOKEN is set and has the correct value" + }; error_message.push_str(&format!("\n\n{}", additional_message)); } bail!( @@ -109,13 +113,16 @@ pub struct UploadResult { pub async fn upload( config: &Config, system_info: &SystemInfo, - provider: &Box, + provider: &Box, run_data: &RunData, executor_name: ExecutorName, ) -> Result { let (archive_buffer, archive_hash) = get_profile_archive_buffer(run_data).await?; - debug!("CI provider detected: {:#?}", provider.get_provider_name()); + debug!( + "Run Environment provider detected: {:?}", + provider.get_run_environment() + ); let upload_metadata = provider.get_upload_metadata(config, system_info, &archive_hash, executor_name)?; @@ -124,8 +131,8 @@ pub async fn upload( "Linked repository: {}\n", style(format!( "{}/{}", - upload_metadata.ci_provider_metadata.owner, - upload_metadata.ci_provider_metadata.repository + upload_metadata.run_environment_metadata.owner, + upload_metadata.run_environment_metadata.repository )) .bold(), ); @@ -202,7 +209,7 @@ mod tests { ("VERSION", Some("0.1.0")), ], async { - let provider = crate::run::ci_provider::get_provider(&config).unwrap(); + let provider = crate::run::run_environment::get_provider(&config).unwrap(); upload( &config, &system_info, diff --git a/src/run/uploader/upload_metadata.rs b/src/run/uploader/upload_metadata.rs index 3f33d316..1c7eb0c5 100644 --- a/src/run/uploader/upload_metadata.rs +++ b/src/run/uploader/upload_metadata.rs @@ -11,14 +11,17 @@ impl UploadMetadata { #[cfg(test)] mod tests { - use insta::assert_json_snapshot; + use std::collections::BTreeMap; + + use insta::{assert_json_snapshot, assert_snapshot}; use crate::run::{ check_system::SystemInfo, - ci_provider::interfaces::{ - CIProviderMetadata, GhData, RepositoryProvider, RunEvent, Sender, - }, instruments::InstrumentName, + run_environment::{ + GhData, RepositoryProvider, RunEnvironment, RunEnvironmentMetadata, RunEvent, RunPart, + Sender, + }, runner::ExecutorName, uploader::{Runner, UploadMetadata}, }; @@ -27,7 +30,7 @@ mod tests { fn test_get_metadata_hash() { let upload_metadata = UploadMetadata { repository_provider: RepositoryProvider::GitHub, - version: Some(5), + version: Some(6), tokenless: true, profile_md5: "jp/k05RKuqP3ERQuIIvx4Q==".into(), runner: Runner { @@ -37,9 +40,9 @@ mod tests { executor: ExecutorName::Valgrind, system_info: SystemInfo::test(), }, - platform: "github-actions".into(), + run_environment: RunEnvironment::GithubActions, commit_hash: "5bd77cb0da72bef094893ed45fb793ff16ecfbe3".into(), - ci_provider_metadata: CIProviderMetadata { + run_environment_metadata: RunEnvironmentMetadata { ref_: "refs/pull/29/merge".into(), head_ref: Some("chore/native-action-runner".into()), base_ref: Some("main".into()), @@ -57,12 +60,23 @@ mod tests { gl_data: None, repository_root_path: "/home/runner/work/codspeed-node/codspeed-node/".into(), }, + run_part: Some(RunPart { + run_id: "7044765741".into(), + run_part_id: "benchmarks_3.2.2".into(), + job_name: "codspeed".into(), + metadata: BTreeMap::from([ + ("someKey".into(), "someValue".into()), + ("anotherKey".into(), "anotherValue".into()), + ]), + }), }; let hash = upload_metadata.get_hash(); - assert_eq!( + assert_snapshot!( hash, - "161a1a3eeea6d988909142e1e7bae3339b3698aaeb025641aa63809895336ae7" + // Caution: when changing this value, we need to ensure that + // the related backend snapshot remains the same + @"f827f6a834c26d39900c0a9e2dddfaaf22956494c8db911fc06fef72878b0c70" ); assert_json_snapshot!(upload_metadata); }