feat: with ultra caching
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-08-03 00:46:20 +02:00
parent c131ebdb7e
commit af821a9d3a
8 changed files with 312 additions and 45 deletions

View File

@@ -12,7 +12,7 @@ use cuddle_please_misc::{
VcsClient,
};
use tracing::Level;
use tracing_subscriber::{prelude::__tracing_subscriber_SubscriberExt, EnvFilter};
use tracing_subscriber::{EnvFilter};
use crate::{
config_command::{ConfigCommand, ConfigCommandHandler},

View File

@@ -52,7 +52,7 @@ impl ReleaseCommandHandler {
tracing::trace!("found current version: {}", current_version.to_string());
self.ui.write_str_ln(&format!(
"found current version: {}",
current_version.to_string()
current_version
));
let conventional_commit_results = parse_conventional_commits(current_version, commits)?;
@@ -66,7 +66,7 @@ impl ReleaseCommandHandler {
let (commit_strs, next_version) = conventional_commit_results.unwrap();
self.ui.write_str_ln(&format!(
"calculated next version: {}",
next_version.to_string()
next_version
));
tracing::trace!("creating changelog");
@@ -112,7 +112,7 @@ impl ReleaseCommandHandler {
next_version: &Version,
changelog_last_changes: Option<String>,
) -> Result<(), anyhow::Error> {
Ok(if !dry_run {
if !dry_run {
self.gitea_client.create_release(
owner,
repository,
@@ -122,7 +122,8 @@ impl ReleaseCommandHandler {
)?;
} else {
tracing::debug!("creating release (dry_run)");
})
};
Ok(())
}
fn create_pull_request(
@@ -202,7 +203,7 @@ impl ReleaseCommandHandler {
) -> Result<Option<Tag>, anyhow::Error> {
let tags = self.gitea_client.get_tags(owner, repository)?;
let significant_tag = get_most_significant_version(tags.iter().collect());
Ok(significant_tag.map(|t| t.clone()))
Ok(significant_tag.cloned())
}
fn check_git_remote_connection(
@@ -252,8 +253,8 @@ fn parse_conventional_commits(
}
fn get_current_version(significant_tag: Option<Tag>) -> Version {
let current_version = significant_tag
significant_tag
.map(|st| Version::try_from(st).unwrap())
.unwrap_or(Version::new(0, 0, 0));
current_version
.unwrap_or(Version::new(0, 0, 0))
}

View File

@@ -31,10 +31,8 @@ const YAML_EXTENSION: &str = "yaml";
pub fn get_config_from_config_file(current_dir: &Path) -> PleaseConfigBuilder {
let current_cuddle_path = current_dir
.clone()
.join(format!("{CUDDLE_FILE_NAME}.{YAML_EXTENSION}"));
let current_cuddle_config_path = current_dir
.clone()
.join(format!("{CUDDLE_CONFIG_FILE_NAME}.{YAML_EXTENSION}"));
let mut please_config = PleaseConfigBuilder::default();

View File

@@ -59,7 +59,7 @@ impl VcsClient {
} => {
let checkout_branch = std::process::Command::new("git")
.current_dir(source.as_path())
.args(&[
.args([
"-c",
&format!("user.name={}", username),
"-c",

View File

@@ -8,5 +8,7 @@ fn main() -> anyhow::Result<()> {
PleaseCommand::new().execute(current_dir)?;
//something else asdfa 123
Ok(())
}