feat: with fixes

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2023-07-30 21:12:16 +02:00
parent 51e3ea3e2f
commit 0b66de6daf
Signed by: kjuulh
GPG Key ID: 9AA7BC13CE474394
4 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
use crate::command::{PleaseConfig, PleaseProjectConfig, PleaseSettingsConfig}; use crate::command::{PleaseConfig, PleaseProjectConfig};
pub mod drone; pub mod drone;

View File

@ -163,7 +163,7 @@ impl GiteaClient {
let branch: String = branch.into(); let branch: String = branch.into();
let mut found_commit = false; let mut found_commit = false;
loop { loop {
let (mut new_commits, has_more) = get_commits(&owner, &repo, &branch, page)?; let (new_commits, has_more) = get_commits(&owner, &repo, &branch, page)?;
for commit in new_commits { for commit in new_commits {
if commit.sha.contains(&since_sha) { if commit.sha.contains(&since_sha) {

View File

@ -71,12 +71,12 @@ mod tests {
use semver::Version; use semver::Version;
use tracing_test::traced_test; use tracing_test::traced_test;
use crate::{environment::get_from_environment, gitea_client::Commit};
#[test] #[test]
#[traced_test] #[traced_test]
fn is_prerelease() { fn is_prerelease() {
let mut version = Version::parse("0.0.0-alpha.1").unwrap(); let version = Version::parse("0.0.0-alpha.1").unwrap();
let commits = vec![ let commits = vec![
"feat: something", "feat: something",
@ -93,7 +93,7 @@ mod tests {
#[test] #[test]
#[traced_test] #[traced_test]
fn is_patch() { fn is_patch() {
let mut version = Version::parse("0.0.1").unwrap(); let version = Version::parse("0.0.1").unwrap();
let commits = vec![ let commits = vec![
"fix: something", "fix: something",
@ -111,7 +111,7 @@ mod tests {
#[test] #[test]
#[traced_test] #[traced_test]
fn is_minor() { fn is_minor() {
let mut version = Version::parse("0.1.0").unwrap(); let version = Version::parse("0.1.0").unwrap();
let commits = vec![ let commits = vec![
"feat: something", "feat: something",
@ -128,7 +128,7 @@ mod tests {
#[test] #[test]
#[traced_test] #[traced_test]
fn is_major() { fn is_major() {
let mut version = Version::parse("0.1.0").unwrap(); let version = Version::parse("0.1.0").unwrap();
let commits = vec![ let commits = vec![
"feat: something", "feat: something",
@ -148,7 +148,7 @@ mod tests {
#[test] #[test]
#[traced_test] #[traced_test]
fn chore_is_patch() { fn chore_is_patch() {
let mut version = Version::parse("0.1.0").unwrap(); let version = Version::parse("0.1.0").unwrap();
let commits = vec!["chore: something"]; let commits = vec!["chore: something"];
@ -159,7 +159,7 @@ mod tests {
#[test] #[test]
#[traced_test] #[traced_test]
fn refactor_is_patch() { fn refactor_is_patch() {
let mut version = Version::parse("0.1.0").unwrap(); let version = Version::parse("0.1.0").unwrap();
let commits = vec!["refactor: something"]; let commits = vec!["refactor: something"];
@ -170,7 +170,7 @@ mod tests {
#[test] #[test]
#[traced_test] #[traced_test]
fn unknown_commits_are_patch() { fn unknown_commits_are_patch() {
let mut version = Version::parse("0.1.0").unwrap(); let version = Version::parse("0.1.0").unwrap();
let commits = vec!["blablabla some commit"]; let commits = vec!["blablabla some commit"];
@ -181,7 +181,7 @@ mod tests {
#[test] #[test]
#[traced_test] #[traced_test]
fn nothing_returns_none() { fn nothing_returns_none() {
let mut version = Version::parse("0.1.0").unwrap(); let version = Version::parse("0.1.0").unwrap();
let commits: Vec<&str> = Vec::new(); let commits: Vec<&str> = Vec::new();

View File

@ -1,6 +1,6 @@
use std::cmp::Reverse; use std::cmp::Reverse;
use crate::gitea_client::{Commit, Tag}; use crate::gitea_client::{Tag};
use semver::Version; use semver::Version;
pub fn get_most_significant_version<'a>(tags: Vec<&'a Tag>) -> Option<&'a Tag> { pub fn get_most_significant_version<'a>(tags: Vec<&'a Tag>) -> Option<&'a Tag> {