Skip to content

Commit eb1130f

Browse files
authored
Merge branch 'main' into fix-4.0.1-opa-authorizer
2 parents 7bc3a22 + fbb084f commit eb1130f

File tree

9 files changed

+188
-65
lines changed

9 files changed

+188
-65
lines changed

.scripts/update_readme_badges.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ for _ in $(seq 0 $((COLS - 1))); do
3030
done
3131
echo "|" >> "$BADGES_TMP"
3232

33-
for BUILD_WORKFLOW_FILE in .github/workflows/build_*.yaml; do
33+
for BUILD_WORKFLOW_FILE in $(find .github/workflows/ -name 'build_*.yaml' | sort -d); do
3434
CURRENT_COLUMN=$(( (CURRENT_COLUMN + 1) % COLS ))
3535

3636
BUILD_WORKFLOW_NAME=$(yq -r '.name' "$BUILD_WORKFLOW_FILE")

Cargo.lock

Lines changed: 43 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ time = { version = "0.3.41", features = ["parsing", "formatting"] }
2626
tokio = { version = "1.46.1", features = ["rt", "macros", "process"] }
2727
toml = "0.9.2"
2828
tracing = "0.1.41"
29-
tracing-indicatif = "0.3.9"
29+
tracing-indicatif = "0.3.13"
3030
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
3131
url = { version = "2.5.4", features = ["serde"] }
32+
33+
[workspace.lints.clippy]
34+
unwrap_in_result = "deny"
35+
unwrap_used = "deny"
36+
panic = "deny"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This repository contains Dockerfiles and scripts to build base images for use wi
88
| [![Build Airflow]][build_airflow.yaml] | [![Build Druid]][build_druid.yaml] | [![Build Hadoop]][build_hadoop.yaml] | [![Build HBase]][build_hbase.yaml] |
99
| [![Build Hive]][build_hive.yaml] | [![Build Java Base]][build_java-base.yaml] | [![Build Java Development]][build_java-devel.yaml] | [![Build Kafka Testing Tools]][build_kafka-testing-tools.yaml] |
1010
| [![Build Kafka]][build_kafka.yaml] | [![Build Krb5]][build_krb5.yaml] | [![Build NiFi]][build_nifi.yaml] | [![Build Omid]][build_omid.yaml] |
11-
| [![Build OPA]][build_opa.yaml] | [![Build OpenSearch]][build_opensearch.yaml] | [![Build OpenSearch Dashboards]][build_opensearch_dashboards.yaml] | [![Build Spark Connect Client]][build_spark-connect-client.yaml] |
11+
| [![Build OPA]][build_opa.yaml] | [![Build OpenSearch Dashboards]][build_opensearch_dashboards.yaml] | [![Build OpenSearch]][build_opensearch.yaml] | [![Build Spark Connect Client]][build_spark-connect-client.yaml] |
1212
| [![Build Spark K8s]][build_spark-k8s.yaml] | [![Build Stackable Base]][build_stackable-base.yaml] | [![Build Superset]][build_superset.yaml] | [![Build Testing Tools]][build_testing-tools.yaml] |
1313
| [![Build Tools]][build_tools.yaml] | [![Build Trino CLI]][build_trino-cli.yaml] | [![Build Trino]][build_trino.yaml] | [![Build Vector]][build_vector.yaml] |
1414
| [![Build ZooKeeper]][build_zookeeper.yaml] | | | |
@@ -78,10 +78,10 @@ preflight check container oci.stackable.tech/sdp/<IMAGE>:<VERSION>-stackable<REL
7878
[build_omid.yaml]: https://github.com/stackabletech/docker-images/actions/workflows/build_omid.yaml
7979
[Build OPA]: https://github.com/stackabletech/docker-images/actions/workflows/build_opa.yaml/badge.svg
8080
[build_opa.yaml]: https://github.com/stackabletech/docker-images/actions/workflows/build_opa.yaml
81-
[Build OpenSearch]: https://github.com/stackabletech/docker-images/actions/workflows/build_opensearch.yaml/badge.svg
82-
[build_opensearch.yaml]: https://github.com/stackabletech/docker-images/actions/workflows/build_opensearch.yaml
8381
[Build OpenSearch Dashboards]: https://github.com/stackabletech/docker-images/actions/workflows/build_opensearch_dashboards.yaml/badge.svg
8482
[build_opensearch_dashboards.yaml]: https://github.com/stackabletech/docker-images/actions/workflows/build_opensearch_dashboards.yaml
83+
[Build OpenSearch]: https://github.com/stackabletech/docker-images/actions/workflows/build_opensearch.yaml/badge.svg
84+
[build_opensearch.yaml]: https://github.com/stackabletech/docker-images/actions/workflows/build_opensearch.yaml
8585
[Build Spark Connect Client]: https://github.com/stackabletech/docker-images/actions/workflows/build_spark-connect-client.yaml/badge.svg
8686
[build_spark-connect-client.yaml]: https://github.com/stackabletech/docker-images/actions/workflows/build_spark-connect-client.yaml
8787
[Build Spark K8s]: https://github.com/stackabletech/docker-images/actions/workflows/build_spark-k8s.yaml/badge.svg

rust/boil/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ url.workspace = true
2727

2828
[dev-dependencies]
2929
rstest.workspace = true
30+
31+
[lints]
32+
workspace = true

rust/boil/src/build/bakefile.rs

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ pub enum Error {
5959

6060
#[snafu(display("failed to locate containerfile relative to the {path:?} directory"))]
6161
NoSuchContainerfileExists { path: String },
62+
63+
#[snafu(display("failed to open scoped directory as {path}"))]
64+
OpenScopedDirectory {
65+
source: std::io::Error,
66+
path: String,
67+
},
6268
}
6369

6470
#[derive(Debug, Snafu)]
@@ -68,6 +74,9 @@ pub enum TargetsError {
6874

6975
#[snafu(display("failed to read image config"))]
7076
ReadImageConfig { source: ImageConfigError },
77+
78+
#[snafu(display("failed to resolve parent directory of image config at {path}", path = path.display()))]
79+
ResolveParentDirectory { path: PathBuf },
7180
}
7281

7382
#[derive(Debug, Default)]
@@ -111,9 +120,21 @@ impl Targets {
111120
/// Returns a map of all targets by globbing for (nested) image config files.
112121
///
113122
/// The search behaviour can be customized using the provided [`TargetsOptions`].
123+
//
124+
// SAFETY: We purposefully allow the `clippy::unwrap_in_result` lint below in this function.
125+
// We can use expect here, because the glob pattern is defined as a constant and the glob
126+
// function only returns an error if the pattern is invalid. We must ensure the pattern is
127+
// valid at compile time, because there is no need to allow an invalid pattern which would
128+
// render this tool inoperable.
129+
//
130+
// FIXME (@Techassi): This attribute can be used on individual unwrap and expect calls since
131+
// Rust 1.91.0. We should move this attribute to not contaminate an unnecessarily large scope
132+
// once we bump the toolchain to 1.91.0.
133+
// See https://github.com/rust-lang/rust-clippy/pull/15445
134+
#[allow(clippy::unwrap_in_result)]
114135
pub fn all(options: TargetsOptions) -> Result<Self, TargetsError> {
115136
let image_config_paths = glob(ImageConfig::ALL_CONFIGS_GLOB_PATTERN)
116-
.expect("glob pattern must be valid")
137+
.expect("constant glob pattern must be valid")
117138
.filter_map(Result::ok);
118139

119140
let mut targets = Self::default();
@@ -124,7 +145,9 @@ impl Targets {
124145

125146
let image_name = image_config_path
126147
.parent()
127-
.expect("there must be a parent")
148+
.with_context(|| ResolveParentDirectorySnafu {
149+
path: image_config_path.clone(),
150+
})?
128151
.to_string_lossy()
129152
.into_owned();
130153

@@ -336,7 +359,10 @@ impl Bakefile {
336359
// By using a cap-std Dir, we can ensure that the paths provided must be relative to
337360
// the appropriate image folder and wont escape it by providing absolute or relative
338361
// paths with traversals (..).
339-
let image_dir = Dir::open_ambient_dir(&image_name, ambient_authority()).unwrap();
362+
let image_dir = Dir::open_ambient_dir(&image_name, ambient_authority())
363+
.with_context(|_| OpenScopedDirectorySnafu {
364+
path: image_name.clone(),
365+
})?;
340366

341367
let dockerfile_path = if let Some(custom_path) = &image_options.dockerfile {
342368
ensure!(

rust/patchable/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ toml.workspace = true
1818
tracing.workspace = true
1919
tracing-indicatif.workspace = true
2020
tracing-subscriber.workspace = true
21+
22+
[lints]
23+
workspace = true

0 commit comments

Comments
 (0)