Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump clap v4 #30919

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 116 additions & 102 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ skip = [
# A few crates -> `num_enum_derive` -> `proc-macro-crate` -> `toml_edit v0.19.14`.
{ name = "toml_edit", version = "0.19.14" },

# tabled_derive and enum-as-inner
{ name = "heck", version = "0.4.0" },

# There are some crates in our dependency tree that have yet to upgrade to
# `hyper 1.*`. As of now these are:
# * `aws-config`
Expand Down
2 changes: 1 addition & 1 deletion misc/bazel/cargo-gazelle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ workspace = true
anyhow = "1.0.66"
camino = "1"
cargo_toml = "0.19.1"
clap = { version = "3.2.24", features = ["derive"] }
clap = { version = "4.5.23", features = ["derive", "env"] }
convert_case = "0.6"
guppy = "0.17.5"
md-5 = "0.10.5"
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ uuid = { version = "1.7.0", features = ["v4"] }
workspace-hack = { version = "0.0.0", path = "../workspace-hack", optional = true }

[dev-dependencies]
criterion = { version = "0.4.0", features = ["async_tokio"] }
criterion = { version = "0.5.1", features = ["async_tokio"] }
datadriven = "0.8.0"

[[bench]]
Expand Down
2 changes: 1 addition & 1 deletion src/balancerd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ axum = "0.7.5"
bytes = "1.3.0"
bytesize = "1.1.0"
chrono = { version = "0.4.35", default-features = false, features = ["std"] }
clap = { version = "3.2.24", features = ["derive", "env"] }
clap = { version = "4.5.23", features = ["derive", "env"] }
domain = { version = "0.9.3", default-features = false, features = ["resolv"] }
futures = "0.3.25"
humantime = "2.1.0"
Expand Down
14 changes: 7 additions & 7 deletions src/balancerd/src/bin/balancerd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ pub struct ServiceArgs {
#[clap(
long,
value_name = "HOST:PORT",
conflicts_with = "frontegg-resolver-template"
conflicts_with = "frontegg_resolver_template"
)]
static_resolver_addr: Option<String>,
/// Frontegg resolver address template. `{}` is replaced with the user's frontegg tenant id to
/// get a DNS address. The first IP that address resolves to is the proxy destinations.
#[clap(long,
value_name = "HOST.{}.NAME:PORT",
requires_all = &["frontegg-api-token-url", "frontegg-admin-role"],
requires_all = &["frontegg_api_token_url", "frontegg_admin_role"],
)]
frontegg_resolver_template: Option<String>,
/// HTTPS resolver address template. `{}` is replaced with the first subdomain of the HTTPS SNI
Expand All @@ -90,33 +90,33 @@ pub struct ServiceArgs {
#[clap(
long,
value_name = "/path/to/configmap/dir/",
required_unless_present = "static-resolver-addr"
required_unless_present = "static_resolver_addr"
)]
cancellation_resolver_dir: Option<PathBuf>,

/// JWK used to validate JWTs during Frontegg authentication as a PEM public
/// key. Can optionally be base64 encoded with the URL-safe alphabet.
#[clap(long, env = "FRONTEGG_JWK", requires = "frontegg-resolver-template")]
#[clap(long, env = "FRONTEGG_JWK", requires = "frontegg_resolver_template")]
frontegg_jwk: Option<String>,
/// Path of JWK used to validate JWTs during Frontegg authentication as a PEM public key.
#[clap(
long,
env = "FRONTEGG_JWK_FILE",
requires = "frontegg-resolver-template"
requires = "frontegg_resolver_template"
)]
frontegg_jwk_file: Option<PathBuf>,
/// The full URL (including path) to the Frontegg api-token endpoint.
#[clap(
long,
env = "FRONTEGG_API_TOKEN_URL",
requires = "frontegg-resolver-template"
requires = "frontegg_resolver_template"
)]
frontegg_api_token_url: Option<String>,
/// The name of the admin role in Frontegg.
#[clap(
long,
env = "FRONTEGG_ADMIN_ROLE",
requires = "frontegg-resolver-template"
requires = "frontegg_resolver_template"
)]
frontegg_admin_role: Option<String>,

Expand Down
2 changes: 1 addition & 1 deletion src/catalog-debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ workspace = true
[dependencies]
anyhow = "1.0.66"
arrow = { version = "53.3.0", default-features = false }
clap = { version = "3.2.24", features = ["derive", "env"] }
clap = { version = "4.5.23", features = ["derive", "env"] }
futures = "0.3.25"
mz-adapter = { path = "../adapter" }
mz-build-info = { path = "../build-info" }
Expand Down
2 changes: 1 addition & 1 deletion src/catalog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bincode = { version = "1.3.3" }
bytes = { version = "1.3.0", features = ["serde"] }
bytesize = "1.1.0"
chrono = { version = "0.4.35", default-features = false, features = ["std"] }
clap = { version = "3.2.24", features = ["derive"] }
clap = { version = "4.5.23", features = ["derive"] }
derivative = "2.2.0"
differential-dataflow = "0.13.2"
fail = { version = "0.5.1", features = ["failpoints"] }
Expand Down
4 changes: 2 additions & 2 deletions src/catalog/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use std::string::ToString;
use std::sync::LazyLock;
use std::sync::Mutex;

use clap::clap_derive::ArgEnum;
use clap::clap_derive::ValueEnum;
use mz_compute_client::logging::{ComputeLog, DifferentialLog, LogVariant, TimelyLog};
use mz_ore::collections::HashMap;
use mz_pgrepr::oid;
Expand Down Expand Up @@ -352,7 +352,7 @@ impl Fingerprint for &BuiltinLog {

/// Allows tests to inject arbitrary amounts of whitespace to forcibly change the fingerprint and
/// trigger a builtin migration.
#[derive(Debug, Clone, ArgEnum)]
#[derive(Debug, Clone, ValueEnum)]
pub enum UnsafeBuiltinTableFingerprintWhitespace {
/// Inject whitespace into all builtin table fingerprints.
All,
Expand Down
2 changes: 1 addition & 1 deletion src/cluster/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ workspace = true
anyhow = "1.0.66"
async-trait = "0.1.83"
bytesize = "1.1.0"
clap = { version = "3.2.24", features = ["derive", "env"] }
clap = { version = "4.5.23", features = ["derive", "env"] }
crossbeam-channel = "0.5.8"
dec = { version = "0.4.8", features = ["serde"] }
differential-dataflow = "0.13.2"
Expand Down
2 changes: 1 addition & 1 deletion src/clusterd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ workspace = true
[dependencies]
anyhow = "1.0.66"
axum = "0.7.5"
clap = { version = "3.2.24", features = ["derive", "env"] }
clap = { version = "4.5.23", features = ["derive", "env"] }
fail = { version = "0.5.1", features = ["failpoints"] }
futures = "0.3.25"
hyper = "1.4.1"
Expand Down
2 changes: 1 addition & 1 deletion src/compute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ anyhow = "1.0.66"
async-stream = "0.3.3"
async-trait = "0.1.83"
bytesize = "1.1.0"
clap = { version = "3.2.24", features = ["derive", "env"] }
clap = { version = "4.5.23", features = ["derive", "env"] }
crossbeam-channel = "0.5.8"
dec = { version = "0.4.8", features = ["serde"] }
differential-dataflow = "0.13.2"
Expand Down
2 changes: 1 addition & 1 deletion src/environmentd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ base64 = "0.13.1"
bytes = "1.3.0"
bytesize = "1.1.0"
chrono = { version = "0.4.35", default-features = false, features = ["std"] }
clap = { version = "3.2.24", features = ["wrap_help", "env", "derive"] }
clap = { version = "4.5.23", features = ["wrap_help", "env", "derive"] }
derivative = "2.2.0"
fail = { version = "0.5.1", features = ["failpoints"] }
futures = "0.3.25"
Expand Down
30 changes: 15 additions & 15 deletions src/environmentd/src/environmentd/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::time::{Duration, Instant};
use std::{cmp, env, iter, thread};

use anyhow::{bail, Context};
use clap::{ArgAction, ArgEnum, Parser};
use clap::{ArgAction, Parser, ValueEnum};
use fail::FailScenario;
use http::header::HeaderValue;
use ipnet::IpNet;
Expand Down Expand Up @@ -206,7 +206,7 @@ pub struct Args {

// === Orchestrator options. ===
/// The service orchestrator implementation to use.
#[structopt(long, arg_enum, env = "ORCHESTRATOR")]
#[structopt(long, value_enum, env = "ORCHESTRATOR")]
orchestrator: OrchestratorKind,
/// Name of a non-default Kubernetes scheduler, if any.
#[structopt(long, env = "ORCHESTRATOR_KUBERNETES_SCHEDULER_NAME")]
Expand Down Expand Up @@ -239,7 +239,7 @@ pub struct Args {
long,
env = "ORCHESTRATOR_KUBERNETES_IMAGE_PULL_POLICY",
default_value = "always",
arg_enum
value_enum
)]
orchestrator_kubernetes_image_pull_policy: KubernetesImagePullPolicy,
/// The init container for services created by the Kubernetes orchestrator.
Expand Down Expand Up @@ -325,11 +325,11 @@ pub struct Args {
/// The secrets controller implementation to use.
#[structopt(
long,
arg_enum,
value_enum,
env = "SECRETS_CONTROLLER",
default_value_ifs(&[
("orchestrator", Some("kubernetes"), Some("kubernetes")),
("orchestrator", Some("process"), Some("local-file"))
default_value_ifs([
("orchestrator", "kubernetes", Some("kubernetes")),
("orchestrator", "process", Some("local-file"))
]),
default_value("kubernetes"), // This shouldn't be possible, but it makes clap happy.
)]
Expand All @@ -341,15 +341,15 @@ pub struct Args {
env = "AWS_SECRETS_CONTROLLER_TAGS",
action = ArgAction::Append,
value_delimiter = ';',
required_if_eq("secrets-controller", "aws-secrets-manager")
required_if_eq("secrets_controller", "aws-secrets-manager")
)]
aws_secrets_controller_tags: Vec<KeyValueArg<String, String>>,
/// The clusterd image reference to use.
#[structopt(
long,
env = "CLUSTERD_IMAGE",
required_if_eq("orchestrator", "kubernetes"),
default_value_if("orchestrator", Some("process"), Some("clusterd"))
default_value_if("orchestrator", "process", Some("clusterd"))
)]
clusterd_image: Option<String>,
/// A number representing the environment's generation.
Expand All @@ -365,8 +365,8 @@ pub struct Args {
long,
env = "METADATA_BACKEND_URL",
conflicts_with_all = &[
"persist-consensus-url",
"timestamp-oracle-url",
"persist_consensus_url",
"timestamp_oracle_url",
],
)]
metadata_backend_url: Option<SensitiveUrl>,
Expand Down Expand Up @@ -425,7 +425,7 @@ pub struct Args {
#[clap(
long,
env = "CLUSTER_REPLICA_SIZES",
requires = "bootstrap-default-cluster-replica-size"
requires = "bootstrap_default_cluster_replica_size"
)]
cluster_replica_sizes: String,
/// An API key for Segment. Enables export of audit events to Segment.
Expand Down Expand Up @@ -589,18 +589,18 @@ pub struct Args {
/// `unsafe_builtin_table_fingerprint_whitespace_version`.
/// This argument is meant for testing only and as the names suggests
/// should not be set in production.
#[clap(long, arg_enum, requires = "unsafe-mode")]
#[clap(long, value_enum, requires = "unsafe_mode")]
unsafe_builtin_table_fingerprint_whitespace: Option<UnsafeBuiltinTableFingerprintWhitespace>,
/// Controls the amount of whitespace injected by
/// `unsafe_builtin_table_fingerprint_whitespace`.
/// Incrementing this value can allow triggering multiple builtin
/// migrations from a single test. This argument is meant for testing only
/// and as the names suggests should not be set in production.
#[clap(long, requires = "unsafe-mode", default_value = "1")]
#[clap(long, requires = "unsafe_mode", default_value = "1")]
unsafe_builtin_table_fingerprint_whitespace_version: usize,
}

#[derive(ArgEnum, Debug, Clone)]
#[derive(ValueEnum, Debug, Clone)]
enum OrchestratorKind {
Kubernetes,
Process,
Expand Down
2 changes: 1 addition & 1 deletion src/expr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ proptest-derive = { version = "0.5.1", features = ["boxed_union"] }
workspace-hack = { version = "0.0.0", path = "../workspace-hack", optional = true }

[dev-dependencies]
criterion = { version = "0.4.0" }
criterion = { version = "0.5.1" }
datadriven = "0.8.0"
mz-expr-test-util = { path = "../expr-test-util" }
mz-ore = { path = "../ore" }
Expand Down
2 changes: 1 addition & 1 deletion src/fivetran-destination/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ workspace = true
[dependencies]
async-compression = { version = "0.4.5", features = ["gzip", "tokio", "zstd"] }
bytes = "1.3.0"
clap = { version = "3.2.24", features = ["derive", "env"] }
clap = { version = "4.5.23", features = ["derive", "env"] }
csv-async = { version = "1.2.6", default-features = false, features = ["tokio"] }
futures = "0.3.25"
itertools = "0.12.1"
Expand Down
2 changes: 1 addition & 1 deletion src/frontegg-auth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ workspace = true
[dependencies]
anyhow = "1.0.66"
base64 = "0.13.1"
clap = { version = "3.2.24", features = ["wrap_help", "env", "derive"] }
clap = { version = "4.5.23", features = ["wrap_help", "env", "derive"] }
derivative = "2.2.0"
futures = "0.3.25"
jsonwebtoken = "9.2.0"
Expand Down
10 changes: 5 additions & 5 deletions src/frontegg-auth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ pub struct FronteggCliArgs {
#[clap(
long,
env = "FRONTEGG_TENANT",
requires_all = &["frontegg-api-token-url", "frontegg-admin-role"],
requires_all = &["frontegg_api_token_url", "frontegg_admin_role"],
value_name = "UUID",
)]
frontegg_tenant: Option<Uuid>,
/// JWK used to validate JWTs during Frontegg authentication as a PEM public
/// key. Can optionally be base64 encoded with the URL-safe alphabet.
#[clap(long, env = "FRONTEGG_JWK", requires = "frontegg-tenant")]
#[clap(long, env = "FRONTEGG_JWK", requires = "frontegg_tenant")]
frontegg_jwk: Option<String>,
/// Path to JWK used to validate JWTs during Frontegg authentication as a PEM public
/// key.
#[clap(long, env = "FRONTEGG_JWK_FILE", requires = "frontegg-tenant")]
#[clap(long, env = "FRONTEGG_JWK_FILE", requires = "frontegg_tenant")]
frontegg_jwk_file: Option<PathBuf>,
/// The full URL (including path) to the Frontegg api-token endpoint.
#[clap(long, env = "FRONTEGG_API_TOKEN_URL", requires = "frontegg-tenant")]
#[clap(long, env = "FRONTEGG_API_TOKEN_URL", requires = "frontegg_tenant")]
frontegg_api_token_url: Option<String>,
/// The name of the admin role in Frontegg.
#[clap(long, env = "FRONTEGG_ADMIN_ROLE", requires = "frontegg-tenant")]
#[clap(long, env = "FRONTEGG_ADMIN_ROLE", requires = "frontegg_tenant")]
frontegg_admin_role: Option<String>,
}
2 changes: 1 addition & 1 deletion src/frontegg-mock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ axum = "0.7.5"
axum-extra = { version = "0.9.3", features = ["typed-header"] }
base64 = "0.22.0"
chrono = { version = "0.4.35", default-features = false, features = ["serde"] }
clap = { version = "3.2.24", features = ["derive", "env"] }
clap = { version = "4.5.23", features = ["derive", "env"] }
hyper = { version = "1.4.1", features = ["http1", "server"] }
jsonwebtoken = "9.2.0"
mz-frontegg-auth = { path = "../frontegg-auth" }
Expand Down
4 changes: 2 additions & 2 deletions src/interchange/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ anyhow = "1.0.66"
byteorder = "1.4.3"
bytes = "1.3.0"
chrono = { version = "0.4.35", default-features = false, features = ["std"] }
clap = { version = "3.2.24", features = ["derive"] }
clap = { version = "4.5.23", features = ["derive"] }
differential-dataflow = "0.13.2"
itertools = "0.12.1"
maplit = "1.0.2"
Expand All @@ -40,7 +40,7 @@ uuid = { version = "1.7.0", features = ["serde"] }
workspace-hack = { version = "0.0.0", path = "../workspace-hack", optional = true }

[dev-dependencies]
criterion = { version = "0.4.0", features = ["async_tokio"] }
criterion = { version = "0.5.1", features = ["async_tokio"] }
tokio = { version = "1.38.0", features = ["macros"] }

[build-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/kafka-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ aws-sigv4 = { version = "1.2.0" }
aws-types = "1.1.1"
base64 = "0.22.0"
chrono = { version = "0.4.35", default-features = false, features = ["std"] }
clap = { version = "3.2.24", features = ["derive"] }
clap = { version = "4.5.23", features = ["derive"] }
crossbeam = "0.8.2"
fancy-regex = "0.11.0"
futures = "0.3.25"
Expand Down
Loading
Loading