Giter Site home page Giter Site logo

convco / convco Goto Github PK

View Code? Open in Web Editor NEW
222.0 222.0 26.0 328 KB

Conventional commits, changelog, versioning, validation

Home Page: https://convco.github.io/

License: MIT License

Rust 95.83% Dockerfile 1.91% Handlebars 1.05% HCL 1.20%
changelog commits conventional conventional-commits semantic-versioning

convco's Introduction

Convco

GitHub Workflow Status Crates.io

A Conventional commit cli.

Documentation: https://convco.github.io.

convco gives tools to work with Conventional Commits.

It provides the following commands:

  • convco changelog: Create a changelog file.
  • convco check: Checks if a range of commits is following the convention.
  • convco commit: Helps to make conventional commits.
  • convco version: Finds out the current or next version.

Installation

cargo install convco

Building from source

Rust 1.60 or newer is required.

Building with cargo depends on git2 and cmake due to linking with zlib-ng. You can optionally disable this by changing the defaults for a build:

cargo build --no-default-features

Configuration

convco uses follows the conventional-changelog-config-spec.

The configuration file is loaded in the following order

  1. Load the internal defaults
  2. Then override with values from the command line, convco -c|--config path/to/.convco
  3. Or, if not specified via -c|--config, load ${PWD}/.convco if it exists (or ${PWD}/.versionrc for compatibility with conventional-changelog).

To get the final derived configuration run convco config.

The host: ..., owner: ... and repository: ... when not supplied via custom or the .versionrc are loaded from the git remote origin value.

Docker usage

# build the convco image
docker build -t convco .
# run it on any codebase
docker run -v "$PWD:/tmp" --workdir /tmp --rm convco

or use it from the Docker Hub:

docker run -v "$PWD:/tmp" --workdir /tmp --rm convco/convco

Use it in .gitlab-ci.yml

If you've created an image and pushed it into your private registry

convco:check:
  stage: test
  image:
    name: convco/convco:latest
  script:
    - check

Tools

Changelog

A changelog can be generated using the conventional commits. It is inspired by conventional changelog and the configuration file allows changes to the generated the output.

convco changelog > CHANGELOG.md

Check

Check a range of revisions for compliance.

It returns a non zero exit code if some commits are not conventional. This is useful in a pre-push hook.

convco check $remote_sha..$local_sha

Commit

Helps to make conventional commits. A scope, description, body, breaking change and issues will be prompted. Convco will recover the previous message in case git failed to create the commit.

convco commit --feat

convco commit can also be used as git core.editor. In this case convco commit will not invoke git commit, but git will invoke convco commit

e.g.:

GIT_EDITOR='convco commit' git commit -p

When persisting the git editor also set sequence.editor when editing the todo list of an interactive rebase.

Or configure a git alias:

git config --global alias.convco '!GIT_EDITOR="convco commit" git commit'

Version

When no options are given it will return the current version. When --bump is provided, the next version will be printed out. Conventional commits are used to calculate the next major, minor or patch. If needed one can provide --major, --minor or --patch to overrule the convention.

convco version --bump

It is useful to use it with release tools, such as cargo-release:

cargo release $(convco version --bump)

convco's People

Contributors

bluebrown avatar ccopsey avatar da-moon avatar dependabot[bot] avatar hdevalke avatar jbergstroem avatar kianmeng avatar koozz avatar liufuyang avatar lukany avatar nainterceptor avatar ngryman avatar ruzickap avatar satlank avatar t-mw avatar truenaho avatar vigohe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

convco's Issues

template for commit message

The commit message form created by convco commit should be configurable.

Specifically, we intend to put ticket references into the summary line rather than into a footer field.

check should fail on unrecognized types

convco check parses the commit information in CommitParser, which verifies the correct message format.

However, the parsed type is never verified to be one of the configured types in Config.

Auto pass commit message generated by `git revert` or github PR revert feature

Is your feature request related to a problem? Please describe.

Hi there, we use convco in our build system it mostly work well, but sometimes we thought it might be nice to still use github UI's button to revert a PR, as the git revert creates a message like
Revert "chore(xx): some old commits"

So we get errors like this:

[convco-check] FAIL  c2ea809  first line doesn't match `<type>[optional scope]: <description>`  Revert "chore(cloud-run): reduce pod cpu...

Describe the solution you'd like

  • It would be nice, perhaps by default a message like Revert "chore(xx): some old commits"
    can also pass the check? Or make some way of turning on this config very easily?

As this commit is generated by running git revert or by clicking github Revert PR button. We build CI with github PRs so we hope to allow fast rollback when things go wrong via clicking the github Revert PR button.

Currently looking at the convco config doc I am confused and not sure how we could just allow this special Revert "<some_good_old_commit>" to pass check as well.


Describe alternatives you've considered

Seems no way to hack git/github to generate a revert commit message in the conventional commit message format.


Additional context

Step 1: clicking this on github:
image
And CI failed:
image

`convco version` output for unreleased project

Is your feature request related to a problem? Please describe.
I would like to use convco to detect whether a change worthy of a release happened. The idea would be to compare the value of convco version and convco version --bump, if it is different, then a release should happen.

For an unreleased repo with no semver tags, the output of convco version is always 0.1.0, whatever the options passed.

This prevents me from having logic that can be applied all the time, as i need to have special handling for the initial release.

Describe the solution you'd like
I think for an unreleased project, the following commands should output the following results:

  • convco version : unreleased
  • convco version --bump : 0.1.0 (assuming existing behaviour to start at that version)
  • convco version --major : 1.0.0
  • convco version --minor : 0.1.0
  • convco version --patch : 0.0.1

Describe alternatives you've considered
Special handling for initial release by checking the tags from git directly.

Request for Changelog

Is your feature request related to a problem? Please describe.
There was a recent change to git (involving safe directory) that I wanted to investigate, so I came to examine what changed with the last release. To my dismay, there was no CHANGELOG.md.

Describe the solution you'd like
I would like to see a CHANGELOG.md file in the repo

Describe alternatives you've considered
I ended up just looking at the most recent release.

Additional context
It is quite ironic that a tool that makes a changelog does not have a changelog. 😄

Immutable Development Environments

PROGRAMMING TASK

Description of Task

  • Add required dotfiles and Dockerfile for creating a unified development environment for all contributors

Reason or Need for Change

  • To ensure all contributors have the same set of tools, toolchain version, and toolchain configuration and lower barrier to entry and eliminate it works on my machine problems, it would be best to set up a Docker backed and maybe even a Vagrant backed environments, pre-provisioned with the Toolchain version and all the other tools used when developing Convco.

Design / Proposal

  • create a Dockerfile to be used as a development environment. Make it based on alpine, As it is easier to make statically linked binaries on Alpine and add all the tools that is used when working on Convco's development
  • Visual Studio Code is a very popular code editor. add .devcontainer/devcontainer.json config file so that contributors can use the Dockerized dev environment with Visual Studio Code Remote - Containers to quickly bring up a workspace
  • add .vscode/setting.json, .vscode/extensions.json and .vscode/tasks.json to predefined language server configuration, required extensions, and tasks for developers using VSCode to work on Convco.
  • Gitpod is another popular service, which enables programmers to quickly spin up a work environment, backed by their k8s cluster and start working either right in their browser or, ssh into the created container and use Vim or use the Gitpod container as a backend for Visual Studio Code Remote - SSH extension. this needs :
    • a Docker image, specific to Gitpod, with Dropbear and Chisel installed
    • .gitpod.yml file that uses the Gitpod specific Docker image and also starts up Dropbear and Chisel to enable developers to SSH into the environment for work, in case they do not like to use their browser as a code editor.

pre-push docs example doesn't work

Describe the bug

The pre-push example on https://convco.github.io/check/ doesn't work, because:

  1. convco can't just check one commit (see #18).
  2. (with the above fixed,) pushing a new branch would only check the latest commit, not all of them

To Reproduce
Steps to reproduce the behavior:

  1. Create a new branch
  2. Make 2 or more commits
  3. Push

Expected behavior
All 2+ commits are checked

Generate changelog for last x feature releases

convco changelog has the parameter --max-versions.

When using semantic versioning, version numbers are split into major, minor and patch versions for breaking releases, feature releases, and pure bugfix releases.

When releasing 2 feature releases and then 5 bug fix releases, --max-versions 5 would only list the bugfix releases.

Depending on release workflows, parallel supported versions, and actual releases, it can make sense and be preferable to include the last x major or minor releases, and all related bugfix releases.

Personally, I would like to generate a changelog for 3 minor releases, while including any bugfix releases that happened in between/after them.

Is this something you would be willing to add?
Although it adds interpretation of version numbers, semantic versioning is quite popular, and possibly not listing the last feature release when using --max-versions seems like a significant issue to me - a hole in/for such a use case.

Malformed Commit Message

Describe the bug

convco commit generates a commit message that has an exclamation mark (!) after scope in case there are any whitespaces in optional BREAKING change step.

To Reproduce
Steps to reproduce the behavior:

  1. run convco commit
  2. put in empty spaces when asked for input in optional BREAKING change stage

output is in the form of

<type>(<scope>)!: <message>

Expected behavior

  • commit header should be in form of <type>(<scope>): <message>

System (please complete the following information):

  • OS: ArchLinux

Generated changelog does not include merge commits

The generated changelog does not include merge commits.

In our workflow we often have multiple commits in a work branch. We then put them up for review in a merge request.
The merge request receives a title which includes a ticket reference, and description.

After review, commits as they make sense are merged into the target branch with a merge commit.
The MR title and description become the merge commits message (summary/title with ticket reference and description).

A generated changelog in this workflow should include the merge commit messages, but not the merged commits.

At the moment, convco generates a changelog only from individual commits including merged commits, but excluding merge commits.

I would consider merge commits missing a bug, and I guess being able to include merge commits while excluding merged commits would be a feature request.

Support leading zeroes in version numbers

I would like to use v<yy>.<MM>.<nr> version labels to have date/age and date order speaking version labels.
(We only have one version in production and no (sw/lib) users that would depend on the major minor patch split.)

convco supports the three digit semver format, but semver does not allow leading zeroes for an integer version number (which occurs for MM). convco seems to follow this requirement, and if MM has a leading 0 will not identify the version (and skip the label, even with a matching prefix).

Is this something you would consider supporting or out of scope?

It could be supported by adjusting the semver parsing into being more lenient (accepting leading zeroes despite spec demanding they do not exist - but they do not break the semantic meaning of major minor or patch).

Or possibly through a fallback behavior that accepts it "not called semver", or through additional configuration(?).

Allow custom scope regex

Scope is not well defined, as suggested in #7, allowing the user to define a scope regex, would make convco more usable in projects not following a scope matching the default regex.
It would also allow projects to limit the scope to some specific identifiers only.

Handle pre-release channels

Is your feature request related to a problem? Please describe.
I can't properly create the beta versions of my project.

Describe the solution you'd like
Manage pre-release depending on the current branch and a list of the pre-release branches in a config file.

Describe alternatives you've considered
Instead of getting the pre-release channel (for example beta) with the config and the current branch, the user could give the channel in the version sub-command.

Additional context
Here is how semantic-release handle it: https://github.com/semantic-release/semantic-release/blob/cd6136d67ee83b262a34dd7a230e1e3ae4799ed0/docs/usage/workflow-configuration.md#pre-release-branches

The advantage of this tool over semantic-release (in my opinion) is that you just calculate the next version and change-log file when semantic-release goes to far.

Support http repository host in changelog links

The generated changelog creates links to version tags, commits, and tag-diff-commit-list.

The host and repository path seem to be determined in host_info_from_url, which prepends https to the host.

This means the produced changelog always uses https links even when that is not available - when http is used.

It would be nice if convco would support http-hosted GitLab too.

(At the users discretion, HTTP instead of HTTPS may be excusable for intranets of trusted parties or read-only viewing of these version and commit information.)

Allow generating a changelog, starting with configured tag.

Is your feature request related to a problem? Please describe.

When creating a changelog for an existing project (not using conventional commits so far) it creates a changelog with empty sections.

Describe the solution you'd like

  • Allow to disable generating empty releases until the first release with content was found (might be a reasonable default)
  • Allow to configure the starting point manually

Describe alternatives you've considered

None.

Additional context

Changelog: commit hashes don't have a link with default template, closed issues are not referenced

Describe the bug
I am trying to generate the changelog for https://github.com/junrar/junrar but the generated changelog doesn't have links for commit hashes.

I noticed the default template has a {{~#if @root.linkReferences}} but that doesn't seem to be working. Searching for linkReferences in the codebase yields no results.

To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/junrar/junrar
  2. Run convco changelog -s -m 2
  3. The changelog contains:
# Changelog

## [v7.5.0](https://github.com/junrar/junrar/compare/v7.4.1...v7.5.0) (2022-03-20)


### Features

* parse extended time
 d5cc784

* use thread pool for getInputStream
 a3383b0


### Fixes

* crc errors on audio data decompression
 15f4afa

* NPE on audio data decompression
 952436b


### [v7.4.1](https://github.com/junrar/junrar/compare/v7.4.0...v7.4.1) (2022-01-27)


#### Fixes

* invalid subheader type would throw npe and make the extract loop
 7b16b3d

Expected behavior
I would expect something closer to:

# [7.5.0](https://github.com/junrar/junrar/compare/v7.4.1...v7.5.0) (2022-03-20)

### Features

* parse extended time ([d5cc784](https://github.com/junrar/junrar/commit/d5cc784c937f461be1e71a7a92b4018af8aef8c7))
* use thread pool for getInputStream ([a3383b0](https://github.com/junrar/junrar/commit/a3383b0dc4db5c5c29334abadd42688fa5ea583b))

### Bug Fixes

* crc errors on audio data decompression ([15f4afa](https://github.com/junrar/junrar/commit/15f4afa23eff69c2e0f3c906815777abf5ac267c))
* NPE on audio data decompression ([952436b](https://github.com/junrar/junrar/commit/952436b204614a747fe8a401d213196cd326d818))

## [7.4.1](https://github.com/junrar/junrar/compare/v7.4.0...v7.4.1) (2022-01-27)


### Bug Fixes

* invalid subheader type would throw npe and make the extract loop ([7b16b3d](https://github.com/junrar/junrar/commit/7b16b3d90b91445fd6af0adfed22c07413d4fab7)), closes [#73](https://github.com/junrar/junrar/issues/73)

Note the commit hashes have links, and the closes issues are also referenced.

System (please complete the following information):

  • OS: Mac
  • Version: 10.15.7

Additional context
convco installed by Home Brew, version 0.3.9

Ignore leading comments and empty lines when parsing commit via stdin

Is your feature request related to a problem? Please describe.
I just implemented commit-msg git hook linting with convco: https://github.com/fedimint/fedimint/pull/1573/files

I had to do some extra work, because the commit message can actually be prefixed with newlines and comment lines which git will happily throw away before turning the whole message into a actual commit, but convco will complain about.

Describe the solution you'd like
Not sure if should be the default behavior altogether, or just when parsing from stdin, or maybe an option, but it would be easier if convco could take care of it (ignore leading newlines and comments).

fails on revspec I suspect the issue is a hard coded `origin/master` that fails to take into account `origin/main` is a thing.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
[sage] building binary and generating Makefiles...
[convco-check] checking git commits...
[format-yaml] formatting Yaml files...
[format-markdown] formatting Markdown files...
[convco-check] revspec 'origin/master' not found; class=Reference (4); code=NotFound (-3)
[convco-check] exit status 1
make: *** [Makefile:52: default] Error 1

Expected behavior
no error

System (please complete the following information):

https://github.com/einride/sage

Additional context
nothing in the makefile or sage seems to be referring to origin/master directly
https://github.com/einride/sage

Custom template directory

A custom template directory should be possible to be provided.

Ideally this should be in some predefined directory in the repository, a global config directory of the user, or provided by a command line option.

The fallback is the hard coded templates in the binary.

Malformed Changelog

Describe the bug

  • convco changelog generates a changelog that is slightly malformed. a lot of entries are on the same line

To Reproduce

1 - cargo install convco
2 - convco changelog

Expected behavior

  • changelog entries should be on separate lines

System (please complete the following information):

  • OS: Arch Linux

Additional context

this is an example output of version 0.3.6

# Changelog

### v0.5.2 (2021-08-19)#### Build System

* **justfile:** add LXC helper targets ee6c463#### Chore

* **contrib/lxd:** added LXD profile to provision development environment in LXD container 99bbc08* **contrib/docker:** cleaned up and removed devcontainer Docker file 9d226f3* **justfile:** added 'gitpod-' prefix to gitpod targets 74fd08a* **repo:** update to go 1.17 ffc3585

expected output

# Changelog

### v0.5.2 (2021-08-19)

#### Build System

* **justfile:** add LXC helper targets ee6c463

#### Chore

* **contrib/lxd:** added LXD profile to provision development environment in LXD container 99bbc08
* **contrib/docker:** cleaned up and removed devcontainer Docker file 9d226f3
* **justfile:** added 'gitpod-' prefix to gitpod targets 74fd08a
* **repo:** update to go 1.17 ffc3585

Allow limiting the history

Is your feature request related to a problem? Please describe.

I want to automatically create the changelog for a github release. As information, I do have the current tag only.

Describe the solution you'd like

I would like to have a way to limit the generation up until (excluding) the previous tag.

So assuming I am running as the release, and have the current release in $TAG. I would like to run e.g:

convco changelog ..$TAG --max-tags 1

Which would limit the output to one tag, starting with the tag provided.

Describe alternatives you've considered

  • Actually query the GitHub releases API: that might be more correct than just checking for the "previous" tag, but also more complicated and limited
  • Additionally there could be an "ignore refs" pattern, which could allow ignoring tags in the process of counting tags.

Additional context

None

Build on windows 2022

Describe the bug
Windows build fails in github action using windows latest (2022).
see: https://github.com/convco/convco/runs/5385743790

To Reproduce
run cargo build on windows-2022

Expected behavior
Build the binary for windows

System (please complete the following information):

  • OS: windows
  • Version: 2022

Additional context

error: failed to run custom build command for `libz-sys v1.1.3`
Error: failed to run custom build command for `libz-sys v1.1.3`
Caused by:
  process didn't exit successfully: `D:\a\convco\convco\target\debug\build\libz-sys-3992bd7e2[60](https://github.com/convco/convco/runs/5385743790?check_suite_focus=true#step:4:60)16673\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=LIBZ_SYS_STATIC
  cargo:rerun-if-changed=build.rs
  CMAKE_TOOLCHAIN_FILE_x86_64-pc-windows-msvc = None
  CMAKE_TOOLCHAIN_FILE_x86_64_pc_windows_msvc = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-pc-windows-msvc = None
  CMAKE_GENERATOR_x86_64_pc_windows_msvc = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-pc-windows-msvc = None
  CMAKE_PREFIX_PATH_x86_64_pc_windows_msvc = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-pc-windows-msvc = None
  CMAKE_x86_64_pc_windows_msvc = None
  HOST_CMAKE = None
  CMAKE = None

  --- stderr
  thread 'main' panicked at '

  couldn't determine visual studio generator
  if VisualStudio is installed, however, consider running the appropriate vcvars script before building this crate
  ', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc[62](https://github.com/convco/convco/runs/5385743790?check_suite_focus=true#step:4:62)99db9ec823\cmake-0.1.48\src\lib.rs:8[78](https://github.com/convco/convco/runs/5385743790?check_suite_focus=true#step:4:78):25
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
Warning: error: build failed
Error: The process 'C:\Users\runneradmin\.cargo\bin\cargo.exe' failed with exit code [101](https://github.com/convco/convco/runs/5385743790?check_suite_focus=true#step:4:101)

Failed to run cargo install convco (v0.3.5)

Describe the bug
When I run cargo install convco to install convco, the following error occurred.

error: failed to run custom build command for `libz-sys v1.1.3`

Caused by:
  process didn't exit successfully: `/var/folders/p4/mhzrn31n6j31ldp3tvr5xxxm0000gn/T/cargo-installpfb54Y/release/build/libz-sys-299b266716357534/build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=LIBZ_SYS_STATIC
  cargo:rerun-if-changed=build.rs
  running: "cmake" "/Users/foo/.cargo/registry/src/github.com-1ecc6299db9ec823/libz-sys-1.1.3/src/zlib-ng" "-DBUILD_SHARED_LIBS=OFF" "-DZLIB_COMPAT=ON" "-DWITH_GZFILEOP=ON" "-DCMAKE_INSTALL_PREFIX=/var/folders/p4/mhzrn31n6j31ldp3tvr5xxxm0000gn/T/cargo-installpfb54Y/release/build/libz-sys-e5fc368d3db7f0a2/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"

  --- stderr
  thread 'main' panicked at '
  failed to execute command: No such file or directory (os error 2)
  is `cmake` not installed?

  build script failed, must exit now', /Users/foo/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.45/src/lib.rs:894:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `convco v0.3.5`, intermediate artifacts can be found at `/var/folders/p4/mhzrn31n6j31ldp3tvr5xxxm0000gn/T/cargo-installpfb54Y`

Caused by:
  build failed

To Reproduce
Steps to reproduce the behavior:

  1. open terminal
  2. run cargo install convco

Expected behavior

Convco should install without errors

System (please complete the following information):

  • OS: max OSX
  • Version: 11.4

Additional context
Might be related to #15

Trying cargo install convco --locked I get:

error: failed to run custom build command for `libz-sys v1.1.2`

Caused by:
  process didn't exit successfully: `/var/folders/p4/mhzrn31n6j31ldp3tvr5xxxm0000gn/T/cargo-installIbmnui/release/build/libz-sys-29038b0b4da25648/build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=LIBZ_SYS_STATIC
  cargo:rerun-if-changed=build.rs
  running: "cmake" "/Users/foo/.cargo/registry/src/github.com-1ecc6299db9ec823/libz-sys-1.1.2/src/zlib-ng" "-DBUILD_SHARED_LIBS=OFF" "-DZLIB_COMPAT=ON" "-DWITH_GZFILEOP=ON" "-DCMAKE_INSTALL_PREFIX=/var/folders/p4/mhzrn31n6j31ldp3tvr5xxxm0000gn/T/cargo-installIbmnui/release/build/libz-sys-155e17569a11cd7c/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"

  --- stderr
  thread 'main' panicked at '
  failed to execute command: No such file or directory (os error 2)
  is `cmake` not installed?

  build script failed, must exit now', /Users/foo/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.45/src/lib.rs:894:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `convco v0.3.5`, intermediate artifacts can be found at `/var/folders/p4/mhzrn31n6j31ldp3tvr5xxxm0000gn/T/cargo-installIbmnui`

Caused by:
  build failed

`Check` returns `empty commit message` in version 0.3.13

Describe the bug
The command convco check started return empty commit message in version 0.3.13. When running the same command with version 0.3.12 the tool finds the commit, and validates it properly. I haven't found any documentation about any behavior change with the check command, hence this bug report.

To Reproduce
Steps to reproduce the behavior:

  1. Clone convco repo: https://github.com/convco/convco.git
  2. Ensure local convco version 0.3.13 with convco --version
  3. Run convco check
  4. See error empty commit message

Expected behavior
Expect output to be the same as with version 0.3.12, i.e:

FAIL  38be02d  wrong type: doc  doc: clarify cmake is needed to build
FAIL  8c4dbb6  wrong type: doc  doc: improve gitlab section in `README.m...
FAIL  ffcf34a  scope does not match regex: changelog|check|commit|version  ci(docker): Add a dockerfile
FAIL  724bb2b  first line doesn't match `<type>[optional scope]: <description>`  release v0.3.0
FAIL  155e652  scope does not match regex: changelog|check|commit|version  build(deps): bump versions

5/167 failed

System (please complete the following information):

  • OS: ubuntu
  • Version: 20.04

Additional context
Not sure if this is a bug or an actual change of behavior, couldn't find any changes in the documentation though, so I assume that it indeed a bug. If this behavior change is as intended, it would be good to update the documentation and then you can just close this bug.

Failed to run `cargo install convco`.

Describe the bug
When I run cargo install convco to install convco, the following error occurred.

➜  ~ cargo install convco
    Updating `https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git` index
  Downloaded convco v0.3.4 (registry `https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git`)
  Downloaded 1 crate (27.1 KB) in 2.80s
  Installing convco v0.3.4
error: failed to compile `convco v0.3.4`, intermediate artifacts can be found at `/var/folders/3v/92vgctp51576pfbydr3672g40000gn/T/cargo-installaXxrnQ`

Caused by:
  failed to select a version for the requirement `zeroize = "^0.9.3"`
  candidate versions found which didn't match: 1.3.0, 1.2.0, 1.1.1, ...
  location searched: `https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git` index (which is replacing registry `https://github.com/rust-lang/crates.io-index`)
  required by package `dialoguer v0.7.1`
      ... which is depended on by `convco v0.3.4`
  perhaps a crate was updated and forgotten to be re-vendored?

To Reproduce
Steps to reproduce the behavior:

  1. open terminal
  2. run cargo install convco

Expected behavior
Convco should be installed.

System (please complete the following information):

  • OS: macOS Catalina
  • Version: 10.15.7

Additional context
I think this is the same issue as this one.

Add release (PRs,MRs) workflows

It could be interesting if convco supports release PRs workflow like googleapis/release-please but which support more provide than GitHub. Like GitLab, Bitbucket.

Naiv example, to run in GitLab CI:

convco release \
   --provider gitlab \
   --url https://<API URL>

Like release-please for GitHub the above command creates:

  • Create/Update a new branch (release-branch)
  • Create/Update an MR on GitLab.
  • Create/Update the changelog in the MR description issue.

screen


NOTICE: I working for aerys and we would be interested to improve convco with you.

changelog parameter to include hidden sections

We intend to use convco changelog to generate a changelog for a new version / upcoming changes.

The primary intention is to use the generated changelog as the basis for user-facing release notes. We have hidden development-centric sections in the configuration.

However, it could be useful to generate a changelog with these hidden sections too, as insight and a listing for developers.

An additional parameter like --include-hidden-sections on changelog could allow generating a changelog of all sections instead of only the configured non-hidden sections.

Overall it would be a parameter useful outside of the primary, configured, and possibly continuous changelog generating workflow.

Partial changelog

Is your feature request related to a problem? Please describe.
convco changelo will output the complete changelog. This is nice, but difficult to integrate into release notes for example.

Describe the solution you'd like
A command line parameter for the changelog command, to start the changelog from.

For example, if the version bumped is 7.2.0:

  • convco changelog --from 7.1.0 should show only the changes between 7.1.0 and 7.2.0
  • convco changelog --latest should show only the last changelog entry (between current and last version)

Describe alternatives you've considered
Other tools, but the more i look at this, the more i want to use it!

Template commit subjects have added linebreaks (Markdown + LF line breaks)

Using a --template template.hbs, commit title seems to have newlines added (with \n markdown + unix newline) on width excedding 86(?) characters.

For a template with \r\n (CR LF) newlines, the added \n newlines lead to mixed EOL of the text document.

Adding the Markdown two-space-line-break prevents template customization from being potentially useful for alternative output formats.

Writing the template file I would not have expected newlines to be added.

Reading the changelog as text, the broken line continuing without indentation makes it subjectively harder to read - even if/while rendered Markdown renders it indented.

Git commit summaries are supposed to be short when creating them. If they are designed and written by the author in a narrowed environment, it seems unnecessary to impose own, potentially different length rules that lead to different output.


I adjusted the template to be a list of commit summaries. It may be more obvious in this case over the default template with additional information.

* commit 1
* commit 2 aaaaaaaaa aaaaaaaaa aaaaaaaaa aaaaaaaaa 
aaaaaaaaa (Ticket)
* commit 3

I suggest filling commits subject without adding line breaks to them. I see no downsides in rendering as-is. But as argued, I see various downsides of different degrees in adding newlines.

`BREAKING CHANGE:` footer doesn't cause major version bump

Describe the bug
When there is a commit with a BREAKING CHANGE: footer but no ! after the type/scope, this doesn't cause a major version bump (or minor in the case of a 0.x.y version). However, according to point 11 of the Conventional Commits specification, it should because a breaking change can be indicated either by a ! or a BREAKING CHANGE: footer.

To Reproduce
Steps to reproduce the behavior: Run

git init
git commit --allow-empty -m "chore: initial"
git tag v1.0.0
git commit --allow-empty -F- <<EOF
feat: feature with breaking change

BREAKING CHANGE: some breaking change
EOF
convco version --bump

This outputs 1.1.0. When you change feat: into feat!:, it (correctly) outputs 2.0.0.

Expected behavior
It should output 2.0.0 even without the ! as a BREAKING CHANGE: footer already declares a breaking change on its own.

System:

  • OS: ubuntu
  • Version: 20.04

changelog --max-minors does not work with gaps

--max-minors does not seem to work. The generated changelog for --max-minors 1 includes all versions.

--max-majors, --max-patches, and --max-versions works fine, limiting the versions as expected.

convco v0.3.15

Allow ignoring pre-releases

Is your feature request related to a problem? Please describe.

Automating releases, using pre-releases (RCs) like -alpha.1 doesn't allow to properly generate change logs that make sense to the user.

Assuming you have: 1.0.0-rc.1, 1.0.0-rc.2, 1.0.0

Then for the rc versions, I want to see the changes up to he previous version, including rcs.

When releasing the proper 1.0.0, I want all changes up to the previous proper release.

Describe the solution you'd like

I guess what I want is --ignore-pre-releases. By default (=false) a patch release (using --max-patch-releases) includes pre-releases. And so it would stop after x patch releases.

Enabling the switch (--ignore-pre-releases) would ignore the tag information, and continue to scoop up log entries until the next (non-pre-release) version is found.

Describe alternatives you've considered

Additional context

Follow up from: #59

Parser doesn't parse multiple reference on the same line

Describe the bug
When parsing a commit like so:

fix: correct minor typos in code

closes #1, closes #2

the resulting Commit should have 2 Footer: [Footer { key: "closes", value: "1" }, Footer { key: "closes", value: "2" }] }

With the current code it has a single Footer: [Footer { key: "closes", value: "1, closes #2" }] }

Another accepted form is also closes #1, #2, which should also work.

Additional context

revert: let us never again speak of the noodle incident

Refs: 676104e, a215868

Add --safe-directory flag

Is your feature request related to a problem? Please describe.
My team has been struggling to get the newest release (0.3.12) to work inside of a Jenkins environment, that then launches the convco container with docker.

Running this command:

docker run -v "$PWD:/tmp" --workdir /tmp --rm convco

We have been seeing the error:

Error: Git(Error { code: -3, klass: 7, message: "config value 'safe.directory' was not found" })

While this would regularly be overcome easily with the command git config --add safe.directory *, this is unfortunately not an option for the docker container as far as we have figured out.

Describe the solution you'd like
I would like an easy way to add a safe-directory. I believe this could be achieved with convco updating the configuration of git, and therefore suggest adding an optional flag that would temporarily add a specified safe directory.

Describe alternatives you've considered
Our workaround to this was to create a gitconfig file, and mount that as a volume.

# gitconfig
[safe]
  directory=/tmp

Working command:
docker run --rm -v "$PWD:/tmp" -v "$PWD/gitconfig:/etc/gitconfig" -w /tmp convco version

Additional context
If this is not possible for the time being, a note in the README indicating this workaround would be nice.

Check text on stdin

Is your feature request related to a problem? Please describe.

I'd like to check the commit message in commit-msg git hook, which ideally would just invoke echo "$1" | convco check --stdin or something like that.

Yes, I know there's convco commit but not everyone will necessarily use it in my team, while git hooks are set up automatically.

Describe the solution you'd like
echo "$1" | convco check --stdin should validate the input.

Describe alternatives you've considered
Joining monastery and dedicating my life towards study of scriptures and meditation.

Additional context
That's really all I have. Thank you for making this project.

max-minors lists too many commits in last listed tag

When I use --max-minors 1 I see a lot more commits within the latest tag changes than I expect. There seems to be a logic issue. It lists commits of previous tags.

Looking at the output for values 1 2 and 3, it looks like it always lists commits that should be ommitted in the last displayed tag.

If it makes a difference, I am using a tag.. range parameter too.

convco changelog ^
  --max-minors 1 ^
  --merges ^
  --first-parent ^
  --include-hidden-sections ^
  v8.14.0.. ^
  > CHANGELOG.md

System (please complete the following information):

  • OS: Windows 10
  • Version: convco 0.3.12

Pass commit message with `convco commit -m`

Hi there,
lovely tool, I use it a lot. There is one thing I always assume it does, but doesn't.
You can already pass --message or -m to git commit and it will fill in the message instead of opening the editor.

Do you think this would be complicated to add?

Statically Linked Binary and MultiArch Docker images for ARM64 and AMD64 Architectures

Is your feature request related to a problem? Please describe.

  • Convco, Is distributed as a deb package. this can make it difficult to use in non-Debian environments, such as Alpine based Docker images, which is the base image I use most often with Visual Studio Code Remote - Containers to set up my development environment
  • Many laptop manufacturers are moving to use aarch64 as their CPU architecture, especially after Apple released the M1 chip. I have a Surface Pro X and it is based on aarch64 and I have to compile Convco from the source there, which as you know, is a CPU-intensive task.

Describe the solution you'd like

  • static builds for both aarch64 and amd64 architecture
  • Multi-Arch Docker images with Convco statically built. I would like to be able to use COPY directive in my own Dockerfiles, like COPY --from=convco/convco:latest /usr/bin/convco /usr/local/bin/convco to add Convco to my image.

Describe alternatives you've considered

  • I have my own docker image in which I am cross-compiling and statically linking Convco

Configuration for major version zero bump

Is your feature request related to a problem? Please describe.
I see in the doc:

Major version zero (0.y.z) has the following rules:

A commit of type fix will increase the PATCH version.
A commit of type feat will increase the PATCH version.
A commit with a breaking change increases the MINOR version.

This is the first time i see this among all the tools that handle conventional commits.

I would like to use the normal bumping behavior, even for version zero.

Describe the solution you'd like
A configuration key to use the normal bumping behavior even for major version zero.

Describe alternatives you've considered
Using another tool, but this one looks simple and nice!

Take version date of the tag, or the last commit of a version

Describe the bug
The version date prints is now the one of the last visible change in the changelog.

Expected behavior
The version should take the date of the tag if it is annotated, or else of the last commit in the version, regardless if it is visible or not.

Prefix not working

Not sure If I have misuderstood, but the "--prefix" flag doesn't seem to be operating as I would expect.

Describe the bug

The prefix is not added to the displayed version.

To Reproduce

  • Install comvco v0.3.10 (2022-04-24)
  • run convco version --prefix "HELLO-"
  • run convco version --prefix "HELLO-" --bump

Expected behavior

A clear and concise description of what you expected to happen.

Current version should be

HELLO-0.0.0

Next version should be

HELLO-0.0.1

System (please complete the following information):

  • OS: Debian
  • Version: Bullseye

I'm also having the same issue in GitLab CI and was able to reproduce locally.

Additional context

Here is an example git commit history of a repo I'm using

Author: Git Bot <[email protected]>
Date:   Fri Jun 24 04:43:59 2022 +0000

    fix: Fixed a bug in the widget collector

commit a1d032cb7485a535254f180f5488484110be1623
Author: Git Bot <[email protected]>
Date:   Fri Jun 24 01:40:55 2022 +0000

    fix(api)!: Fixed a bug

commit 49ee67ce3f9b1d8403e15b8fca9fa7b0db6923e5
Author: Git Bot <[email protected]>
Date:   Fri Jun 24 01:30:48 2022 +0000

    chore: did a thing

commit ed3a69fa066d33a3314116e081e7c517e1c4bc3e
Author: Git Bot <[email protected]>
Date:   Fri Jun 24 01:10:51 2022 +0000

    feat: Initial release

Check skips merge commits

It seems that convco check will follow a merge and check all the merged commits, but not the merge commit itself.

I verified this with the number of commits it reports as checked.

For a merge commit merging 3 commits:

check sha1..sha1 => 0
check sha1~1..sha1 => 3

Unable to get `convco check` to check a single commit

Describe the bug
Based on my understanding of the tool/project it should be possible to run convco check to check either a range of commits or a single commit. While checking a range of commits appears functional I have yet to be able to get the tool to be able to check a single commit, regardless of what type of commit-ish is used.

To Reproduce
Steps to reproduce the behavior:

  1. run convco check commit-ish-here
  2. get the given reference name 'commit-ish-here' is not valid; class=Reference (4)

Expected behavior
Expected behavior is that the tool would verify the commit message of the specified commit-ish

System (please complete the following information):

  • OS: MacOS
  • Version: 11.4

quit part way through `convco commit`

Describe the bug
inside a convco commit after selection of a type, in the field for entering "scope", or the next "description"
you cannot exit (cancel) with ^C or ^D

To Reproduce
Steps to reproduce the behavior:

❯ convco commit
✔ type · feat
? scope () › ^C^C^C^C^C

Expected behavior
The ability to Control-C quit part way through

System (please complete the following information):

  • OS: [ubuntu]
  • Version: [22.04]

Workaround

  1. open new terminal and killall convco ; or
  2. background and kill
❯ convco commit
✔ type · fix
? scope () › ^Z
zsh: suspended  convco commit

✦ ❯ jobs
[1]  + suspended  convco commit

✦ ❯ kill %1
[1]  + terminated  convco commit     

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.