Skip to content

Commit

Permalink
Merge pull request #375 from primeos-work/prepare-0.5.0-release
Browse files Browse the repository at this point in the history
Final changes to prepare the release of butido 0.5.0
  • Loading branch information
primeos-work authored Apr 30, 2024
2 parents 8122c97 + d928991 commit 187e26f
Show file tree
Hide file tree
Showing 16 changed files with 96 additions and 52 deletions.
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,52 @@ is too old (i.e., must be updated).

## Upcoming

## v0.5.0

### Major/Breaking changes

* The configuration must be updated, see `CHANGELOG.toml` for details.
* The `compatibility` setting is now independent of the butido version and
will be used to output the required configuration changes
* Butido now rejects unknown fields in its configuration source(s)
(`config.toml` files and environment variables) and package definitions
(`pkg.toml` files). This is done to detect typos/mistakes and requires
changes if such unknown/misspelled fields are present.
* The "merging" of `patches` arrays in `pkg.toml` files has been fixed (the old
logic silently ignored a patch if a patch with the same name was declared in
an upper level/layer `pkg.toml` file)

### Highlights

* Lots of dependency updates (including security updates)
* All dependencies are up-to-date now (except for the `config` crate due to
breaking changes in `0.14.x` that currently prevent us from updating)
* Some deprecated/unmaintained crates have been replaced or dropped
* CLI improvements and fixes (partly due to the clap update from version 3 to 4)
* Better / more consistent argument parsing
* Output tweaks/improvements
* Improved error messages (e.g., for dependency cycles and unsupported
version specifications)
* Support for short build image names
* More filtering options for DB commands
* Build dependencies are now marked with a star (`*`) in the `tree-of` output
* A new "release list" subcommand ("db releases" alias for convenience)
* Fixed the default log level (info -> warn)
* Source download improvements (warnings when downloading HTML files, no more
empty source files after failed downloads, a check for the HTTP status code
to avoid downloading "404 Not Found" HTML responses, and the User-Agent
header is now set)
* The included example configuration and packages repo have been fixed (and new
CI tests should ensure that they remain valid)
* It is now possible to depend on packages whose name starts with a number
* The tracing has been improved (some spans and structured fields are now used)
and the `--tracing-chrome` flag has been added to generate `chrome://tracing`
compatible JSON files
* Butido no longer crashes when `..` is used in paths of `patches` (`pkg.toml`)
* Lots of cleanups, refactorings, new tests (+ CI improvements), and minor fixes
* Various minor improvements (additional directory/filesystem checks, handling
of multiple release stores, etc.)
* Minor documentation improvements (typos, fixes, additional comments, etc.)

## v0.4.0

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "butido"
version = "0.4.0"
version = "0.5.0"
authors = [
# Only for the current/active maintainers (sorted alphabetically by the surname)
# All other authors are listed in the "Authors" section of README.md
Expand Down Expand Up @@ -71,8 +71,8 @@ tokio = { version = "1", features = ["macros", "fs", "process", "io-util", "time
tokio-stream = "0.1"
toml = "0.8"
tracing = "0.1"
tracing-chrome = "0.7"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tracing-chrome = "0.7.1"
typed-builder = "0.18"
unindent = "0.2"
url = { version = "2", features = ["serde"] }
Expand Down
48 changes: 24 additions & 24 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub fn cli() -> Command {
.after_help(indoc::indoc!(r#"
The following environment variables can be passed to butido:
RUST_LOG - to enable logging, for exact usage see the rust cookbook
RUST_LOG - to enable logging, for exact usage see the Rust cookbook
"#))

.arg(Arg::new("version")
Expand All @@ -73,7 +73,7 @@ pub fn cli() -> Command {
.action(ArgAction::SetTrue)
.required(false)
.long("tracing-chrome")
.help("Generate a chrome compatible trace file")
.help("Generate a Chrome compatible trace file (trace-*.json)")
)

.arg(Arg::new("hide_bars")
Expand All @@ -90,7 +90,7 @@ pub fn cli() -> Command {
.help("Override the database host")
.long_help(indoc::indoc!(r#"
Override the database host set via configuration.
Can also be overriden via environment variable 'BUTIDO_DATABASE_HOST', but this setting has precedence.
Can also be overridden via environment variable 'BUTIDO_DATABASE_HOST', but this setting has precedence.
"#))
)
.arg(Arg::new("database_port")
Expand All @@ -100,7 +100,7 @@ pub fn cli() -> Command {
.help("Override the database port")
.long_help(indoc::indoc!(r#"
Override the database port set via configuration.
Can also be overriden via environment 'BUTIDO_DATABASE_PORT', but this setting has precedence.
Can also be overridden via environment 'BUTIDO_DATABASE_PORT', but this setting has precedence.
"#))
)
.arg(Arg::new("database_user")
Expand All @@ -110,7 +110,7 @@ pub fn cli() -> Command {
.help("Override the database user")
.long_help(indoc::indoc!(r#"
Override the database user set via configuration.
Can also be overriden via environment 'BUTIDO_DATABASE_USER', but this setting has precedence.
Can also be overridden via environment 'BUTIDO_DATABASE_USER', but this setting has precedence.
"#))
)
.arg(Arg::new("database_password")
Expand All @@ -121,7 +121,7 @@ pub fn cli() -> Command {
.help("Override the database password")
.long_help(indoc::indoc!(r#"
Override the database password set via configuration.
Can also be overriden via environment 'BUTIDO_DATABASE_PASSWORD', but this setting has precedence.
Can also be overridden via environment 'BUTIDO_DATABASE_PASSWORD', but this setting has precedence.
"#))
)
.arg(Arg::new("database_name")
Expand All @@ -131,7 +131,7 @@ pub fn cli() -> Command {
.help("Override the database name")
.long_help(indoc::indoc!(r#"
Override the database name set via configuration.
Can also be overriden via environment 'BUTIDO_DATABASE_NAME', but this setting has precedence.
Can also be overridden via environment 'BUTIDO_DATABASE_NAME', but this setting has precedence.
"#))
)
.arg(Arg::new("database_connection_timeout")
Expand All @@ -141,7 +141,7 @@ pub fn cli() -> Command {
.help("Override the database connection timeout")
.long_help(indoc::indoc!(r#"
Override the database connection timeout set via configuration.
Can also be overriden via environment 'BUTIDO_DATABASE_CONNECTION_TIMEOUT', but this setting has precedence.
Can also be overridden via environment 'BUTIDO_DATABASE_CONNECTION_TIMEOUT', but this setting has precedence.
"#))
)

Expand Down Expand Up @@ -511,7 +511,7 @@ pub fn cli() -> Command {
)
.subcommand(Command::new("dependencies-of")
.alias("depsof")
.about("List the depenendcies of a package")
.about("List the dependencies of a package")
.arg(Arg::new("package_name")
.required(true)
.index(1)
Expand All @@ -522,7 +522,7 @@ pub fn cli() -> Command {
.required(false)
.index(2)
.value_name("VERSION_CONSTRAINT")
.help("A version constraint to search for (optional), E.G. '=1.0.0'")
.help("A version constraint to search for (optional), e.g., '=1.0.0'")
)
.arg(Arg::new("dependency_type")
.required(false)
Expand Down Expand Up @@ -564,7 +564,7 @@ pub fn cli() -> Command {
.required(true)
.index(2)
.value_name("VERSION_CONSTRAINT")
.help("A version constraint to search for (optional), E.G. '=1.0.0'")
.help("A version constraint to search for (optional), e.g., '=1.0.0'")
)
)

Expand All @@ -580,21 +580,21 @@ pub fn cli() -> Command {
.required(false)
.index(2)
.value_name("VERSION_CONSTRAINT")
.help("A version constraint to search for (optional), E.G. '=1.0.0'")
.help("A version constraint to search for (optional), e.g., '=1.0.0'")
)
.arg(Arg::new("no_script_filter")
.action(ArgAction::SetTrue)
.long("no-script-filter")
.short('S')
.required(false)
.help("Don't check for script equality. Can cause unexact results.")
.help("Don't check for script equality. Can cause inexact results.")
)
.arg(Arg::new("staging_dir")
.required(false)
.long("staging-dir")
.value_name("PATH")
.value_parser(dir_exists_validator)
.help("Also consider this staging dir when searching for artifacts")
.help("Also consider this staging directory when searching for artifacts")
)
.arg(Arg::new("env_filter")
.required(false)
Expand Down Expand Up @@ -626,7 +626,7 @@ pub fn cli() -> Command {
.required(false)
.index(2)
.value_name("VERSION_CONSTRAINT")
.help("A version constraint to search for (optional), E.G. '=1.0.0'")
.help("A version constraint to search for (optional), e.g., '=1.0.0'")
)

.arg(Arg::new("terse")
Expand Down Expand Up @@ -825,18 +825,18 @@ pub fn cli() -> Command {
)
)
.subcommand(Command::new("of")
.about("Get the pathes of the sources of a package")
.about("Get the paths of the sources of a package")
.arg(Arg::new("package_name")
.required(false)
.index(1)
.value_name("PKG")
.help("Get the source file pathes for this package")
.help("Get the source file paths for this package")
)
.arg(Arg::new("package_version")
.required(false)
.index(2)
.value_name("VERSION")
.help("Get the source file pathes for the package in this version")
.help("Get the source file paths for the package in this version")
)
)
)
Expand Down Expand Up @@ -927,15 +927,15 @@ pub fn cli() -> Command {
.action(ArgAction::SetTrue)
.required(false)
.long("non-interactive")
.help("Dont be interactive (only with --update at the moment)")
.help("Don't be interactive (only with --update at the moment)")
.requires("package_do_update")
)
.arg(Arg::new("quiet")
.action(ArgAction::SetTrue)
.required(false)
.long("quiet")
.short('q')
.help("Don't print pathes to released filesfiles after releases are complete")
.help("Don't print the paths to released files after releases are complete")
)
)

Expand All @@ -953,7 +953,7 @@ pub fn cli() -> Command {
.required(false)
.index(2)
.value_name("VERSION_CONSTRAINT")
.help("A version constraint to search for (optional), E.G. '=1.0.0'")
.help("A version constraint to search for (optional), e.g., '=1.0.0'")
)
)

Expand All @@ -969,7 +969,7 @@ pub fn cli() -> Command {
.required(false)
.index(2)
.value_name("VERSION_CONSTRAINT")
.help("A version constraint to search for (optional), E.G. '=1.0.0'")
.help("A version constraint to search for (optional), e.g., '=1.0.0'")
)
.arg(Arg::new("image")
.required(false)
Expand Down Expand Up @@ -1005,7 +1005,7 @@ pub fn cli() -> Command {
)

.subcommand(Command::new("endpoint")
.about("Endpoint maintentance commands")
.about("Endpoint maintenance commands")
.arg(Arg::new("endpoint_name")
.required(false)
.index(1)
Expand Down Expand Up @@ -1251,7 +1251,7 @@ fn env_pass_validator(s: &str) -> Result<String, String> {
Err(s)
}
Ok((k, v)) => {
debug!("Env pass valiation: '{}={}'", k, v);
debug!("Env pass validation: '{}={}'", k, v);
Ok(s.to_owned())
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pub async fn build(
})
.collect::<Vec<_>>();
{
// Because we're loading always sequencially, to have a bit more spread over the endpoints,
// Because we're loading always sequentially, to have a bit more spread over the endpoints,
// shuffle the endpoints here. Not a perfect solution, but a working one.
use rand::seq::SliceRandom;
let mut rng = rand::thread_rng();
Expand Down
2 changes: 1 addition & 1 deletion src/commands/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ fn job(
let parsed_log = crate::log::ParsedLog::from_str(&data.0.log_text)?;
trace!("Parsed log = {:?}", parsed_log);
let success = parsed_log.is_successfull();
trace!("log successfull = {:?}", success);
trace!("log successful = {:?}", success);

if csv {
let hdrs = crate::commands::util::mk_header(vec![
Expand Down
2 changes: 1 addition & 1 deletion src/commands/find_artifact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub async fn find_artifact(
((a, None), (b, None)) => a.cmp(b),
}
})
.unique_by(|tpl| tpl.0.clone()) // TODO: Dont clone()
.unique_by(|tpl| tpl.0.clone()) // TODO: Don't clone()
.try_for_each(|(path, releasetime)| {
if let Some(time) = releasetime {
writeln!(std::io::stdout(), "[{}] {}", time, path.display())
Expand Down
6 changes: 3 additions & 3 deletions src/config/container_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ pub struct ContainerConfig {
#[getset(get = "pub")]
allowed_env: Vec<EnvironmentVariableName>,

/// Pass the current git author to the container
/// This can be used to the the "packager" name in a package, for example
/// Pass the current Git author to the container
/// This can be used for the "packager" name in a package, for example
#[getset(get = "pub")]
git_author: Option<EnvironmentVariableName>,

/// Pass the current git hash to the container
/// Pass the current Git hash to the container
#[getset(get = "pub")]
git_commit_hash: Option<EnvironmentVariableName>,
}
2 changes: 1 addition & 1 deletion src/db/find_artifacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ use crate::util::EnvironmentVariableName;
///
/// If the artifact was released, the return value contains a Some(NaiveDateTime), marking the date
/// of the release.
/// Releases are returned prefferably, if multiple equal pathes for an artifact are found.
/// Releases are returned preferably, if multiple equal paths for an artifact are found.
#[derive(typed_builder::TypedBuilder)]
pub struct FindArtifacts<'a> {
config: &'a Configuration,
Expand Down
4 changes: 2 additions & 2 deletions src/endpoint/configured.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl Endpoint {
.with_context(|| anyhow!("Getting API version of endpoint: {}", ep.name))?;

if !v.contains(&avail.api_version) {
Err(anyhow!("Incompatible Docker API version on endpoint {}: Exepected: {}, Available: [{}]",
Err(anyhow!("Incompatible Docker API version on endpoint {}: Expected: {}, Available: [{}]",
ep.name(), avail.api_version, v.join(", ")))
} else {
Ok(())
Expand Down Expand Up @@ -653,7 +653,7 @@ impl<'a> PreparedContainer<'a> {
.copy_file_into(destination, &buf)
.await
.map_err(Error::from)
.inspect(|_| trace!("Copying patch {} successfull", patch.display()))
.inspect(|_| trace!("Copying patch {} successful", patch.display()))
.with_context(|| {
anyhow!(
"Copying patch {} to container {}",
Expand Down
4 changes: 2 additions & 2 deletions src/filestore/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ impl StoreRoot {
/// Unpack a tar archive in this location
///
/// This function unpacks the provided tar archive "butido-style" in the location pointed to by
/// `self` and returns the written pathes.
/// `self` and returns the written paths.
///
/// The function filteres out the "/output" directory (that's what is meant by "butido-style").
/// The function filters out the "/output" directory (that's what is meant by "butido-style").
pub(in crate::filestore) fn unpack_archive_here<R>(
&self,
mut ar: tar::Archive<R>,
Expand Down
3 changes: 0 additions & 3 deletions src/job/runnable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ pub struct RunnableJob {
}

impl RunnableJob {
// TODO: Drop the following clippy exception once we don't need to check against rustc 1.75
// anymore (a fix was already merged but it likely won't be backported to 1.75):
#[allow(clippy::map_identity)]
pub fn build_from_job(
job: &Job,
source_cache: &SourceCache,
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async fn main() -> Result<()> {

let repo = git2::Repository::open(PathBuf::from(".")).map_err(|e| match e.code() {
git2::ErrorCode::NotFound => {
eprintln!("Butido must be executed in the top-level of the git repository");
eprintln!("Butido must be executed in the top-level of the Git repository");
std::process::exit(1)
}
_ => Error::from(e),
Expand Down
Loading

0 comments on commit 187e26f

Please sign in to comment.