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 authored and alilleybrinker committed Dec 16, 2024
1 parent e10644a commit 65cf310
Show file tree
Hide file tree
Showing 13 changed files with 946 additions and 5 deletions.
17 changes: 12 additions & 5 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"
4 changes: 4 additions & 0 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,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 +64,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 65cf310

Please sign in to comment.