Skip to content

Commit

Permalink
feat: add manifest xtask to parse GitHub Release API output
Browse files Browse the repository at this point in the history
This commit is an initial part of a larger effort to develop an `xtask`
command to automate plugin download manifest file updates when new
plugin releases are made. This commit simply calls the GitHub release
API for hipcheck, and parses and manipulates the returned JSON into
DownloadManifestEntry objects that can be compared against the entries
in existing download manifest files.

Signed-off-by: jlanson <[email protected]>
  • Loading branch information
j-lanson committed Dec 6, 2024
1 parent f7d1d6f commit c025708
Show file tree
Hide file tree
Showing 13 changed files with 967 additions and 13 deletions.
33 changes: 20 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,21 @@ toml = "0.8.19"
xshell = "0.2.7"
which = "7.0.0"
convert_case = "0.6.0"
serde_json = "1.0.133"
url = { version = "2.5.4", features = ["serde"] }
kdl = "4.7.0"
regex = "1.11.1"
ureq = { version = "2.10.1", default-features = false, features = [
"json",
"tls",
] }
# Exactly matching the version of rustls used by ureq
# Get rid of default features since we don't use the AWS backed crypto
# provider (we use ring) and it breaks stuff on windows.
rustls = { version = "0.23.10", default-features = false, features = [
"logging",
"std",
"tls12",
"ring",
] }
rustls-native-certs = "0.8.0"
7 changes: 7 additions & 0 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ use clap::Parser as _;
use clap_verbosity_flag::{InfoLevel, Verbosity};
use std::process::ExitCode;

#[cfg(test)]
use task::manifest::remote::*;

fn main() -> ExitCode {
let args = Args::parse();

Expand All @@ -27,6 +30,7 @@ fn main() -> ExitCode {
Commands::Site(args) => match args.command {
SiteCommand::Serve(args) => task::site::serve::run(args),
},
Commands::Manifest => task::manifest::run(),
};

match result {
Expand Down Expand Up @@ -63,6 +67,9 @@ enum Commands {
Site(SiteArgs),
/// Lint the Hipcheck plugin gRPC definition.
Buf,
/// Update the plugin download manifests in the local repo based on
/// output from the GitHub Releases API
Manifest,
}

#[derive(Debug, clap::Args)]
Expand Down
Loading

0 comments on commit c025708

Please sign in to comment.