Repository: cocogitto/cocogitto
Pull request #271 (2023-03-22 08:25:39)

fix(bump): bump don't throw error on no bump types commits
Related issue : https://github.com/cocogitto/cocogitto/issues/270

Wassim-AB: Hey @oknozor,

There is something I don't quite understand with the failing test :
- First we init the repository, which creates a package called ```one``` with ```public_api=true```.
- Then we create a ```chore``` commit with the corresponding ```cog.toml``` configuration.
- Finally we commit a feature to the package ```one``` 

Since we've added a ```feat``` to a ```public_api=true``` package, shouldn't It bump the global version of the mono-repository ? Because from what I understand, It didn't find any commit that triggers a bump

Thanks :) 
codecov[bot]: ## [Codecov](https://codecov.io/gh/cocogitto/cocogitto/pull/271?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cocogitto) Report
> Merging [#271](https://codecov.io/gh/cocogitto/cocogitto/pull/271?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cocogitto) (c12d6ee) into [main](https://codecov.io/gh/cocogitto/cocogitto/commit/af08a7e86c714fcdd0977d283d4887f3e98b6aa2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cocogitto) (af08a7e) will **increase** coverage by `0.03%`.
> The diff coverage is `88.88%`.

```diff
@@            Coverage Diff             @@
##             main     #271      +/-   ##
==========================================
+ Coverage   85.68%   85.72%   +0.03%     
==========================================
  Files          43       43              
  Lines        5918     5981      +63     
==========================================
+ Hits         5071     5127      +56     
- Misses        847      854       +7     
```


| [Impacted Files](https://codecov.io/gh/cocogitto/cocogitto/pull/271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cocogitto) | Coverage Δ | |
|---|---|---|
| [src/conventional/version.rs](https://codecov.io/gh/cocogitto/cocogitto/pull/271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cocogitto#diff-c3JjL2NvbnZlbnRpb25hbC92ZXJzaW9uLnJz) | `52.17% <0.00%> (+20.59%)` | :arrow_up: |
| [src/command/bump/standard.rs](https://codecov.io/gh/cocogitto/cocogitto/pull/271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cocogitto#diff-c3JjL2NvbW1hbmQvYnVtcC9zdGFuZGFyZC5ycw==) | `96.92% <50.00%> (-3.08%)` | :arrow_down: |
| [src/command/bump/monorepo.rs](https://codecov.io/gh/cocogitto/cocogitto/pull/271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cocogitto#diff-c3JjL2NvbW1hbmQvYnVtcC9tb25vcmVwby5ycw==) | `92.83% <84.61%> (-0.27%)` | :arrow_down: |
| [src/conventional/bump.rs](https://codecov.io/gh/cocogitto/cocogitto/pull/271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cocogitto#diff-c3JjL2NvbnZlbnRpb25hbC9idW1wLnJz) | `98.06% <98.11%> (-0.06%)` | :arrow_down: |
| [src/command/bump/mod.rs](https://codecov.io/gh/cocogitto/cocogitto/pull/271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cocogitto#diff-c3JjL2NvbW1hbmQvYnVtcC9tb2QucnM=) | `84.81% <100.00%> (+2.52%)` | :arrow_up: |
| [src/command/bump/package.rs](https://codecov.io/gh/cocogitto/cocogitto/pull/271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cocogitto#diff-c3JjL2NvbW1hbmQvYnVtcC9wYWNrYWdlLnJz) | `91.78% <100.00%> (+0.60%)` | :arrow_up: |
| [src/conventional/changelog/template.rs](https://codecov.io/gh/cocogitto/cocogitto/pull/271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cocogitto#diff-c3JjL2NvbnZlbnRpb25hbC9jaGFuZ2Vsb2cvdGVtcGxhdGUucnM=) | `94.68% <100.00%> (+0.86%)` | :arrow_up: |

... and [1 file with indirect coverage changes](https://codecov.io/gh/cocogitto/cocogitto/pull/271/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cocogitto)

:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cocogitto)


Patch:
diff --git a/src/command/bump/mod.rs b/src/command/bump/mod.rs
index 0addb66..c7ad114 100644
--- a/src/command/bump/mod.rs
+++ b/src/command/bump/mod.rs
@@ -91,11 +91,10 @@ impl<'a> HookRunOptions<'a> {
 }
 
 fn ensure_tag_is_greater_than_previous(current: &Tag, next: &Tag) -> Result<()> {
-    if next <= current {
+    if next < current {
         let comparison = format!("{current} <= {next}").red();
         let cause_key = "cause:".red();
         let cause = format!("{cause_key} version MUST be greater than current one: {comparison}");
-
         bail!("{}:\n\t{}\n", "SemVer Error".red().to_string(), cause);
     };
 
diff --git a/src/command/bump/monorepo.rs b/src/command/bump/monorepo.rs
index 20d3a0f..4ca58c8 100644
--- a/src/command/bump/monorepo.rs
+++ b/src/command/bump/monorepo.rs
@@ -77,6 +77,11 @@ impl CocoGitto {
         // Get package bumps
         let bumps = self.get_packages_bumps(pre_release)?;
 
+        if bumps.is_empty() {
+            print!("No conventional commits found for your packages that required a bump. Changelogs will be updated on the next bump.\nPre-Hooks and Post-Hooks have been skiped.\n");
+            return Ok(());
+        }
+
         if dry_run {
             for bump in bumps {
                 println!("{}", bump.new_version.prefixed_tag)
@@ -131,6 +136,11 @@ impl CocoGitto {
         // Get package bumps
         let bumps = self.get_packages_bumps(pre_release)?;
 
+        if bumps.is_empty() {
+            print!("No conventional commits found for your packages that required a bump. Changelogs will be updated on the next bump.\nPre-Hooks and Post-Hooks have been skiped.\n");
+            return Ok(());
+        }
+
         // Get the greatest package increment among public api packages
         let increment_from_package_bumps = bumps
             .iter()
@@ -392,6 +402,10 @@ impl CocoGitto {
 
             let mut next_version = next_version.unwrap();
 
+            if next_version == old {
+                continue;
+            }
+
             if let Some(pre_release) = pre_release {
                 next_version.version.pre = Prerelease::new(pre_release)?;
             }
diff --git a/src/command/bump/package.rs b/src/command/bump/package.rs
index 99515af..b204907 100644
--- a/src/command/bump/package.rs
+++ b/src/command/bump/package.rs
@@ -29,7 +29,13 @@ impl CocoGitto {
         let current_tag = self.repository.get_latest_package_tag(package_name);
         let current_tag = tag_or_fallback_to_zero(current_tag)?;
         let mut next_version = current_tag.bump(increment, &self.repository)?;
+        if current_tag == next_version {
+            print!("No conventional commits found for {package_name} that required a bump. Changelog will be updated on the next bump.\nPre-Hooks and Post-Hooks have been skiped.\n");
+            return Ok(());
+        }
+
         ensure_tag_is_greater_than_previous(&current_tag, &next_version)?;
+
         if let Some(pre_release) = pre_release {
             next_version.version.pre = Prerelease::new(pre_release)?;
         }
diff --git a/src/command/bump/standard.rs b/src/command/bump/standard.rs
index caab7a0..6427c59 100644
--- a/src/command/bump/standard.rs
+++ b/src/command/bump/standard.rs
@@ -27,6 +27,10 @@ impl CocoGitto {
         let current_tag = self.repository.get_latest_tag();
         let current_tag = tag_or_fallback_to_zero(current_tag)?;
         let mut tag = current_tag.bump(increment, &self.repository)?;
+        if current_tag == tag {
+            print!("No conventional commits for your repository that required a bump. Changelogs will be updated on the next bump.\nPre-Hooks and Post-Hooks have been skiped.\n");
+            return Ok(());
+        }
 
         ensure_tag_is_greater_than_previous(&current_tag, &tag)?;
 
diff --git a/src/conventional/bump.rs b/src/conventional/bump.rs
index cbfa312..1808c82 100644
--- a/src/conventional/bump.rs
+++ b/src/conventional/bump.rs
@@ -23,6 +23,7 @@ pub(crate) trait Bump {
     fn major_bump(&self) -> Self;
     fn minor_bump(&self) -> Self;
     fn patch_bump(&self) -> Self;
+    fn no_bump(&self) -> Self;
     fn auto_bump(&self, repository: &Repository) -> Result<Self, BumpError>
     where
         Self: Sized;
@@ -66,6 +67,11 @@ impl Bump for Tag {
         next.reset_metadata()
     }
 
+    fn no_bump(&self) -> Self {
+        let next = self.clone();
+        next.reset_metadata()
+    }
+
     fn auto_bump(&self, repository: &Repository) -> Result<Self, BumpError> {
         self.get_version_from_commit_history(repository)
     }
@@ -111,6 +117,7 @@ impl Tag {
             IncrementCommand::Major => Ok(self.major_bump()),
             IncrementCommand::Minor => Ok(self.minor_bump()),
             IncrementCommand::Patch => Ok(self.patch_bump()),
+            IncrementCommand::NoBump => Ok(self.no_bump()),
             IncrementCommand::Auto => self.auto_bump(repository),
             IncrementCommand::AutoPackage(package) => self.auto_package_bump(repository, &package),
             IncrementCommand::AutoMonoRepoGlobal(package_increment) => {
@@ -160,6 +167,7 @@ impl Tag {
             Increment::Major => self.major_bump(),
             Increment::Minor => self.minor_bump(),
             Increment::Patch => self.patch_bump(),
+            Increment::NoBump => self.no_bump(),
         })
     }
 
@@ -201,6 +209,7 @@ impl Tag {
             Increment::Major => self.major_bump(),
             Increment::Minor => self.minor_bump(),
             Increment::Patch => self.patch_bump(),
+            Increment::NoBump => self.no_bump(),
         })
     }
 
@@ -241,6 +250,7 @@ impl Tag {
             Increment::Major => self.major_bump(),
             Increment::Minor => self.minor_bump(),
             Increment::Patch => self.patch_bump(),
+            Increment::NoBump => self.no_bump(),
         })
     }
 
@@ -267,12 +277,18 @@ impl Tag {
                 .any(|commit| commit.message.commit_type == CommitType::BugFix)
         };
 
+        // At this point, it is not a major, minor or patch bump but we might have found conventional commits
+        // -> Must be only chore, docs, refactor ... which means commits that don't require bump but shouldn't throw error
+        let no_bump_required = !commits.is_empty();
+
         if is_major_bump() {
             Ok(Increment::Major)
         } else if is_minor_bump() {
             Ok(Increment::Minor)
         } else if is_patch_bump() {
             Ok(Increment::Patch)
+        } else if no_bump_required {
+            Ok(Increment::NoBump)
         } else {
             Err(BumpError::NoCommitFound)
         }
@@ -359,6 +375,20 @@ mod test {
         Ok(())
     }
 
+    #[sealed_test]
+    fn no_bump() -> Result<()> {
+        // Arrange
+        let repository = Repository::init(".")?;
+        let base_version = Tag::from_str("1.0.0", None)?;
+
+        // Act
+        let tag = base_version.bump(IncrementCommand::NoBump, &repository)?;
+
+        // Assert
+        assert_that!(tag.version).is_equal_to(Version::new(1, 0, 0));
+        Ok(())
+    }
+
     #[test]
     fn should_get_next_auto_version_patch() -> Result<()> {
         // Arrange
@@ -376,6 +406,42 @@ mod test {
         Ok(())
     }
 
+    #[test]
+    fn should_not_bump_versions_due_to_non_bump_commits() -> Result<()> {
+        // Arrange
+        let revert = Commit::commit_fixture(CommitType::Revert, false);
+        let perf = Commit::commit_fixture(CommitType::Performances, false);
+        let documentation = Commit::commit_fixture(CommitType::Documentation, false);
+        let chore = Commit::commit_fixture(CommitType::Chore, false);
+        let style = Commit::commit_fixture(CommitType::Style, false);
+        let refactor = Commit::commit_fixture(CommitType::Refactor, false);
+        let test = Commit::commit_fixture(CommitType::Test, false);
+        let build = Commit::commit_fixture(CommitType::Build, false);
+        let ci = Commit::commit_fixture(CommitType::Ci, false);
+
+        let base_version = Tag::from_str("1.0.0", None)?;
+
+        // Act
+        let increment = base_version.version_increment_from_commit_history(&[
+            revert,
+            perf,
+            documentation,
+            chore,
+            style,
+            refactor,
+            test,
+            build,
+            ci,
+        ]);
+
+        // Assert
+        assert_that!(increment)
+            .is_ok()
+            .is_equal_to(Increment::NoBump);
+
+        Ok(())
+    }
+
     #[test]
     fn increment_minor_version_should_set_patch_to_zero() -> Result<()> {
         // Arrange
@@ -472,7 +538,7 @@ mod test {
     }
 
     #[test]
-    fn should_fail_without_feature_bug_fix_or_breaking_change_commit() -> Result<()> {
+    fn should_not_fail_without_feature_bug_fix_or_breaking_change_commit() -> Result<()> {
         // Arrange
         let chore = Commit::commit_fixture(CommitType::Chore, false);
         let docs = Commit::commit_fixture(CommitType::Documentation, false);
@@ -482,21 +548,7 @@ mod test {
         let version = base_version.version_increment_from_commit_history(&[chore, docs]);
 
         // Assert
-        let result = version.unwrap_err().to_string();
-        let result = result.as_str();
-
-        assert_eq!(
-            result,
-            r#"failed to bump version
-
-cause: No conventional commit found to bump current version.
-    Only feature, bug fix and breaking change commits will trigger an automatic bump.
-
-suggestion: Please see https://conventionalcommits.org/en/v1.0.0/#summary for more information.
-    Alternatively consider using `cog bump <--version <VERSION>|--auto|--major|--minor>`
-
-"#
-        );
+        assert_that!(version).is_ok().is_equal_to(Increment::NoBump);
 
         Ok(())
     }
diff --git a/src/conventional/version.rs b/src/conventional/version.rs
index 6281eb5..fcafd65 100644
--- a/src/conventional/version.rs
+++ b/src/conventional/version.rs
@@ -6,6 +6,7 @@ pub enum IncrementCommand {
     Minor,
     Patch,
     Auto,
+    NoBump,
     AutoPackage(String),
     AutoMonoRepoGlobal(Option<Increment>),
     Manual(String),
@@ -16,6 +17,7 @@ pub enum Increment {
     Major,
     Minor,
     Patch,
+    NoBump,
 }
 
 impl From<Increment> for IncrementCommand {
@@ -24,6 +26,7 @@ impl From<Increment> for IncrementCommand {
             Increment::Major => IncrementCommand::Major,
             Increment::Minor => IncrementCommand::Minor,
             Increment::Patch => IncrementCommand::Patch,
+            Increment::NoBump => IncrementCommand::NoBump,
         }
     }
 }
@@ -43,6 +46,9 @@ impl PartialOrd for Increment {
             (Increment::Minor, _) => Some(Ordering::Greater),
             (_, Increment::Minor) => Some(Ordering::Less),
             (Increment::Patch, Increment::Patch) => Some(Ordering::Equal),
+            (Increment::NoBump, Increment::NoBump) => Some(Ordering::Equal),
+            (Increment::Patch, Increment::NoBump) => Some(Ordering::Greater),
+            (Increment::NoBump, Increment::Patch) => Some(Ordering::Less),
         }
     }
 }


Test patch:
diff --git a/tests/lib_tests/bump.rs b/tests/lib_tests/bump.rs
index 5ba1eec..d3037f6 100644
--- a/tests/lib_tests/bump.rs
+++ b/tests/lib_tests/bump.rs
@@ -463,3 +463,272 @@ fn bump_with_whitelisted_branch_pattern_err() -> Result<()> {
 
     Ok(())
 }
+
+#[sealed_test]
+fn bump_no_error_should_be_thrown_on_only_chore_docs_commit() -> Result<()> {
+    // Arrange
+    let mut packages = HashMap::new();
+    let jenkins = || MonoRepoPackage {
+        path: PathBuf::from("jenkins"),
+        changelog_path: Some("jenkins/CHANGELOG.md".to_owned()),
+        ..Default::default()
+    };
+
+    packages.insert("jenkins".to_owned(), jenkins());
+
+    let thumbor = || MonoRepoPackage {
+        path: PathBuf::from("thumbor"),
+        changelog_path: Some("thumbor/CHANGELOG.md".to_owned()),
+        ..Default::default()
+    };
+
+    packages.insert("thumbor".to_owned(), thumbor());
+
+    let settings = Settings {
+        packages,
+        ignore_merge_commits: true,
+        ..Default::default()
+    };
+
+    let settings = toml::to_string(&settings)?;
+
+    git_init()?;
+    run_cmd!(
+        echo Hello > README.md;
+        git add .;
+        git commit -m "first commit";
+        mkdir jenkins;
+        echo "some jenkins stuff" > jenkins/file;
+        git add .;
+        git commit -m "feat(jenkins): add jenkins stuffs";
+        mkdir thumbor;
+        echo "some thumbor stuff" > thumbor/file;
+        git add .;
+        git commit -m "feat(thumbor): add thumbor stuffs";
+        echo $settings > cog.toml;
+        git add .;
+        git commit -m "chore: add cog.toml";
+    )?;
+
+    let mut cocogitto = CocoGitto::get()?;
+
+    // Act
+    cocogitto.create_monorepo_version(IncrementCommand::Auto, None, None, None, false)?;
+
+    run_cmd!(
+        echo "chore on jenkins" > jenkins/fix;
+        git add .;
+        git commit -m "chore(jenkins): jenkins chore";
+        echo "docs on jenkins" > jenkins/fix;
+        git add .;
+        git commit -m "docs(jenkins): jenkins docs";
+    )?;
+
+    cocogitto.create_monorepo_version(IncrementCommand::Auto, None, None, None, false)?;
+
+    cocogitto.create_package_version(
+        ("jenkins", &jenkins()),
+        IncrementCommand::AutoPackage("jenkins".to_owned()),
+        None,
+        None,
+        None,
+        false,
+    )?;
+
+    run_cmd!(
+        echo "more feat on thumbor" > thumbor/feat;
+        git add .;
+        git commit -m "feat(thumbor): more feat on thumbor";
+    )?;
+
+    cocogitto.create_monorepo_version(IncrementCommand::Auto, None, None, None, false)?;
+
+    // Assert
+    assert_tag_exists("jenkins-0.1.0")?;
+    assert_tag_exists("thumbor-0.1.0")?;
+    assert_tag_exists("thumbor-0.2.0")?;
+    assert_tag_exists("0.1.0")?;
+    assert_tag_exists("0.2.0")?;
+
+    assert_tag_does_not_exist("jenkins-0.1.1")?;
+    assert_tag_does_not_exist("jenkins-0.2.0")?;
+    assert_tag_does_not_exist("jenkins-1.0.0")?;
+    Ok(())
+}
+
+#[sealed_test]
+fn error_on_no_conventionnal_commits_found_for_monorepo() -> Result<()> {
+    let settings = Settings {
+        ..Default::default()
+    };
+
+    let settings = toml::to_string(&settings)?;
+
+    git_init()?;
+
+    run_cmd!(
+        echo Hello > README.md;
+        git add .;
+        git commit -m "chore: first commit";
+
+        echo $settings > cog.toml;
+        git add .;
+
+        echo "first feature" > file;
+        git add .;
+        git commit -m "feat: feature commit";
+    )?;
+
+    let mut cocogitto = CocoGitto::get()?;
+
+    // Act
+    let first_result = cocogitto.create_version(IncrementCommand::Auto, None, None, None, false);
+
+    // Assert
+    assert_that!(first_result).is_ok();
+
+    run_cmd!(
+        echo "second feature" >> file;
+        git add .;
+    )?;
+
+    git_commit("second unconventional feature commit")?;
+
+    // Act
+    let second_result = cocogitto.create_version(IncrementCommand::Auto, None, None, None, false);
+
+    // Assert
+    assert_that!(second_result).is_err();
+
+    Ok(())
+}
+
+#[sealed_test]
+fn error_on_no_conventionnal_commits_found_for_package() -> Result<()> {
+    // Arrange
+    let mut packages = HashMap::new();
+    let jenkins = || MonoRepoPackage {
+        path: PathBuf::from("jenkins"),
+        changelog_path: Some("jenkins/CHANGELOG.md".to_owned()),
+        ..Default::default()
+    };
+
+    packages.insert("jenkins".to_owned(), jenkins());
+
+    let settings = Settings {
+        packages,
+        ignore_merge_commits: true,
+        ..Default::default()
+    };
+
+    let settings = toml::to_string(&settings)?;
+
+    git_init()?;
+    run_cmd!(
+        echo Hello > README.md;
+        git add .;
+        git commit -m "first commit";
+
+        echo $settings > cog.toml;
+        git add .;
+        git commit -m "chore: cog config";
+
+        mkdir jenkins;
+        echo "some jenkins stuff" > jenkins/file;
+        git add .;
+        git commit -m "feat(jenkins): some jenkins stuff";
+    )?;
+
+    let mut cocogitto = CocoGitto::get()?;
+
+    let first_result = cocogitto.create_package_version(
+        ("jenkins", &jenkins()),
+        IncrementCommand::AutoPackage("jenkins".to_owned()),
+        None,
+        None,
+        None,
+        false,
+    );
+
+    assert_that!(first_result).is_ok();
+
+    run_cmd!(
+        echo "some other jenkins stuff" >> jenkins/file;
+        git add .;
+        git commit -m "some other jenkins stuff";
+    )?;
+
+    let second_result = cocogitto.create_package_version(
+        ("jenkins", &jenkins()),
+        IncrementCommand::AutoPackage("jenkins".to_owned()),
+        None,
+        None,
+        None,
+        false,
+    );
+
+    assert_that!(second_result).is_err();
+
+    Ok(())
+}
+
+#[sealed_test]
+fn bump_with_unconventionnal_and_conventional_commits_found_for_packages() -> Result<()> {
+    // Arrange
+    let mut packages = HashMap::new();
+    let jenkins = || MonoRepoPackage {
+        path: PathBuf::from("jenkins"),
+        changelog_path: Some("jenkins/CHANGELOG.md".to_owned()),
+        ..Default::default()
+    };
+
+    packages.insert("jenkins".to_owned(), jenkins());
+
+    let thumbor = || MonoRepoPackage {
+        path: PathBuf::from("thumbor"),
+        changelog_path: Some("thumbor/CHANGELOG.md".to_owned()),
+        ..Default::default()
+    };
+
+    packages.insert("thumbor".to_owned(), thumbor());
+
+    let settings = Settings {
+        packages,
+        ignore_merge_commits: true,
+        ..Default::default()
+    };
+
+    let settings = toml::to_string(&settings)?;
+
+    git_init()?;
+    run_cmd!(
+        echo Hello > README.md;
+        git add .;
+        git commit -m "first commit";
+        mkdir jenkins;
+        echo "unconventional jenkins stuff" > jenkins/file;
+        git add .;
+        git commit -m "unconventional jenkins stuff";
+        mkdir thumbor;
+        echo "conventional thumbor stuff" > thumbor/file;
+        git add .;
+        git commit -m "feat(thumbor): conventional thumbor stuff";
+        echo $settings > cog.toml;
+        git add .;
+        git commit -m "chore: add cog.toml";
+    )?;
+
+    let mut cocogitto = CocoGitto::get()?;
+
+    // Act
+    let result = cocogitto.create_monorepo_version(IncrementCommand::Auto, None, None, None, false);
+
+    // Assert
+    assert_that!(result).is_ok();
+    assert_tag_exists("thumbor-0.1.0")?;
+    assert_tag_exists("0.1.0")?;
+
+    assert_tag_does_not_exist("jenkins-0.1.0")?;
+
+    Ok(())
+}