chore: Cleanup code before release and update deps
This commit is contained in:
parent
3d0ae32734
commit
f829580087
6 changed files with 264 additions and 220 deletions
453
Cargo.lock
generated
453
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -79,6 +79,7 @@ rayon = { version = "1", optional = true }
|
||||||
regex = { version = "1", optional = true }
|
regex = { version = "1", optional = true }
|
||||||
requestty = { version = "0.5", features = ["macros", "termion"] }
|
requestty = { version = "0.5", features = ["macros", "termion"] }
|
||||||
shadow-rs = { version = "0.38", default-features = false }
|
shadow-rs = { version = "0.38", default-features = false }
|
||||||
|
thiserror = "2"
|
||||||
urlencoding = "2"
|
urlencoding = "2"
|
||||||
yaml-rust2 = { version = "0.9", optional = true }
|
yaml-rust2 = { version = "0.9", optional = true }
|
||||||
|
|
||||||
|
|
@ -102,7 +103,6 @@ tempfile.workspace = true
|
||||||
tokio = { workspace = true, optional = true }
|
tokio = { workspace = true, optional = true }
|
||||||
bon.workspace = true
|
bon.workspace = true
|
||||||
users.workspace = true
|
users.workspace = true
|
||||||
thiserror = "2.0.7"
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# Top level features
|
# Top level features
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ use cached::proc_macro::cached;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use comlexr::{cmd, pipe};
|
use comlexr::{cmd, pipe};
|
||||||
use log::{debug, info, trace, warn};
|
use log::{debug, info, trace, warn};
|
||||||
use miette::{bail, miette, IntoDiagnostic, Result};
|
use miette::{bail, IntoDiagnostic, Result};
|
||||||
use oci_distribution::Reference;
|
use oci_distribution::Reference;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use semver::Version;
|
use semver::Version;
|
||||||
|
|
@ -292,7 +292,7 @@ impl BuildDriver for DockerDriver {
|
||||||
Ok((system.join()?, buildx.join()?))
|
Ok((system.join()?, buildx.join()?))
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.map_err(|e| miette!("{e:?}"))?;
|
.map_err(|e| miette::miette!("{e:?}"))?;
|
||||||
|
|
||||||
if !system?.success() {
|
if !system?.success() {
|
||||||
bail!("Failed to prune docker system");
|
bail!("Failed to prune docker system");
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ use std::{
|
||||||
|
|
||||||
use blue_build_process_management::ASYNC_RUNTIME;
|
use blue_build_process_management::ASYNC_RUNTIME;
|
||||||
use blue_build_recipe::ModuleTypeVersion;
|
use blue_build_recipe::ModuleTypeVersion;
|
||||||
|
use blue_build_utils::constants::{
|
||||||
|
CUSTOM_MODULE_SCHEMA, IMPORT_MODULE_SCHEMA, JSON_SCHEMA, STAGE_SCHEMA,
|
||||||
|
};
|
||||||
use bon::bon;
|
use bon::bon;
|
||||||
use cached::proc_macro::cached;
|
use cached::proc_macro::cached;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
|
|
@ -222,15 +225,15 @@ fn process_anyof_error(err: &ValidationError<'_>) -> Option<Vec<ValidationError<
|
||||||
) => {
|
) => {
|
||||||
trace!("FOUND MODULE ANYOF ERROR at {instance_path}");
|
trace!("FOUND MODULE ANYOF ERROR at {instance_path}");
|
||||||
if instance.get("source").is_some() {
|
if instance.get("source").is_some() {
|
||||||
Uri::parse("json-schema:///module-custom-v1.json".to_string()).ok()?
|
Uri::parse(CUSTOM_MODULE_SCHEMA.to_string()).ok()?
|
||||||
} else if instance.get("from-file").is_some() {
|
} else if instance.get("from-file").is_some() {
|
||||||
Uri::parse("json-schema:///import-v1.json".to_string()).ok()?
|
Uri::parse(IMPORT_MODULE_SCHEMA.to_string()).ok()?
|
||||||
} else {
|
} else {
|
||||||
let typ = instance.get("type").and_then(Value::as_str)?;
|
let typ = instance.get("type").and_then(Value::as_str)?;
|
||||||
let typ = ModuleTypeVersion::from(typ);
|
let typ = ModuleTypeVersion::from(typ);
|
||||||
trace!("Module type: {typ}");
|
trace!("Module type: {typ}");
|
||||||
Uri::parse(format!(
|
Uri::parse(format!(
|
||||||
"json-schema:///modules/{}-{}.json",
|
"{JSON_SCHEMA}/modules/{}-{}.json",
|
||||||
typ.typ(),
|
typ.typ(),
|
||||||
typ.version().unwrap_or("latest")
|
typ.version().unwrap_or("latest")
|
||||||
))
|
))
|
||||||
|
|
@ -245,9 +248,9 @@ fn process_anyof_error(err: &ValidationError<'_>) -> Option<Vec<ValidationError<
|
||||||
trace!("FOUND STAGE ANYOF ERROR at {instance_path}");
|
trace!("FOUND STAGE ANYOF ERROR at {instance_path}");
|
||||||
|
|
||||||
if instance.get("from-file").is_some() {
|
if instance.get("from-file").is_some() {
|
||||||
Uri::parse("json-schema:///import-v1.json".to_string()).ok()?
|
Uri::parse(IMPORT_MODULE_SCHEMA.to_string()).ok()?
|
||||||
} else {
|
} else {
|
||||||
Uri::parse("json-schema:///stage-v1.json".to_string()).ok()?
|
Uri::parse(STAGE_SCHEMA.to_string()).ok()?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => return None,
|
_ => return None,
|
||||||
|
|
@ -317,11 +320,11 @@ async fn cache_retrieve(uri: &Uri<&str>) -> miette::Result<Value> {
|
||||||
|
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
{
|
{
|
||||||
const BASE_SCHEMA_URL: &str = "https://schema.blue-build.org";
|
use blue_build_utils::constants::SCHEMA_BASE_URL;
|
||||||
|
|
||||||
let uri = match scheme.as_str() {
|
let uri = match scheme.as_str() {
|
||||||
"json-schema" => {
|
"json-schema" => {
|
||||||
format!("{BASE_SCHEMA_URL}{path}")
|
format!("{SCHEMA_BASE_URL}{path}")
|
||||||
}
|
}
|
||||||
"https" => uri.to_string(),
|
"https" => uri.to_string(),
|
||||||
scheme => miette::bail!("Unknown scheme {scheme}"),
|
scheme => miette::bail!("Unknown scheme {scheme}"),
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ license.workspace = true
|
||||||
atty = "0.2"
|
atty = "0.2"
|
||||||
base64 = "0.22"
|
base64 = "0.22"
|
||||||
blake2 = "0.10"
|
blake2 = "0.10"
|
||||||
|
constcat = "0.5"
|
||||||
directories = "6"
|
directories = "6"
|
||||||
docker_credential = "1"
|
docker_credential = "1"
|
||||||
format_serde_error = "0.3"
|
format_serde_error = "0.3"
|
||||||
|
|
@ -28,7 +29,6 @@ serde_json.workspace = true
|
||||||
serde_yaml.workspace = true
|
serde_yaml.workspace = true
|
||||||
syntect.workspace = true
|
syntect.workspace = true
|
||||||
bon.workspace = true
|
bon.workspace = true
|
||||||
constcat = "0.5.1"
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
syntect = "5"
|
syntect = "5"
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,12 @@ pub const MODULE_V1_SCHEMA_URL: &str = concat!(SCHEMA_BASE_URL, "/module-v1.json
|
||||||
pub const MODULE_STAGE_LIST_V1_SCHEMA_URL: &str =
|
pub const MODULE_STAGE_LIST_V1_SCHEMA_URL: &str =
|
||||||
concat!(SCHEMA_BASE_URL, "/module-stage-list-v1.json");
|
concat!(SCHEMA_BASE_URL, "/module-stage-list-v1.json");
|
||||||
|
|
||||||
|
// JSON Schema
|
||||||
|
pub const JSON_SCHEMA: &str = "json-schema://";
|
||||||
|
pub const CUSTOM_MODULE_SCHEMA: &str = concat!(JSON_SCHEMA, "/module-custom-v1.json");
|
||||||
|
pub const IMPORT_MODULE_SCHEMA: &str = concat!(JSON_SCHEMA, "/import-v1.json");
|
||||||
|
pub const STAGE_SCHEMA: &str = concat!(JSON_SCHEMA, "/stage-v1.json");
|
||||||
|
|
||||||
// Messages
|
// Messages
|
||||||
pub const BUG_REPORT_WARNING_MESSAGE: &str =
|
pub const BUG_REPORT_WARNING_MESSAGE: &str =
|
||||||
"Please copy the above report and open an issue manually.";
|
"Please copy the above report and open an issue manually.";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue