arnaud-deprez / gsemver Goto Github PK
View Code? Open in Web Editor NEWgsemver uses git commit convention to automate the generation of your next semver version
License: MIT License
gsemver uses git commit convention to automate the generation of your next semver version
License: MIT License
Using the CLI, it's currently not possible to override the regex pattern for major and minor commit match.
We should allow this via command line parameters
This is a subtask of #4
Given most CI tools do git fetch in detached mode, gsemver
cannot directly inspect what is the current branch.
Instead you can set an environment variable GIT_BRANCH
to let gsemver
knows which branch it should use to match against a bumpStrategy.
As most CI tools provides the current branch context in some environment variables, it is possible to determine in which CI tool the build is running and then get the correct branch information from env variables.
Out of my head CI tools to support:
GIT_BRANCH
should still be used as a fallback solution for the not yet supported CI tools.
The quality of the project is not really measurable.
We should add testing coverage report to improve the quality.
https://codecov.io seems to be widely used.
Currently we can only pre-release with a name (alpha, beta, whatever...).
It should be possible to use unqualified pre-release like 1.0.0-0
, 1.0.0-1
, ...
This is a sub-task of #4
We should some examples on how to integrate gsemver with well known build tools such as:
Any other suggestion is welcome.
Alternatively it might be good to develop some plugin for these build tools.
For each of these examples, we should create an issue and refer to this epic and then check the box when the implementation is merged.
Conventional commits supports !
to draw attention to breaking change.
Eg:
feat!: send an email to the customer when a product is shipped
# or
feat(api)!: send an email to the customer when a product is shipped
gsemver
should bump MAJOR when it finds such a commitgit-chglog
supports this notation too for gsemver
release itselfCurrently verbose
and log-level
options are not used because we don't log anything.
So when gsemver fails, it can be hard to know why and where.
We should add optional verbose logs at each steps to give some insights in case of failure
In order to fully validate gsemver
we should setup some integration tests with a real git repository
Some unit tests exist but they don't allow to validate complex scenario with history.
Before publish the first release, we should generate release notes for it based on our conventional commits history.
Some tools to consider:
Once #20 is done, we need a simple way to bootstrap a custom configuration.
Add command to initialise custom configuration file by asking first some question to the end user.
A very simple approach would be able to view the current configuration with a command that prints the current file on the console.
Then we can just redirect the standard output to a file so that we can manually customise it.
Note that it is not incompatible with this solution and might be easier to it first.
There can be some commits that should not produce a new release - and thus bump to a new version - in some scenario, like for example if you fix a type in a README, it might not make sense to create a release.
The goal is to give the ability to the user to not bump version on some commit that match a pattern.
In traditional development workflow, we have release branches from where we release our application and development branches (feature, bug, ...) where the work is on going.
The gsemver bump [auto]
should automatically detects if it's a release branch or "under work" branch and use build metadata in the later.
This initial implementation should consider master and release/* branches as release branches and the rest as "under work" branches.
In future version, it would be nice if this could be configurable.
i have a submule for separating rpc client module for other team, which is under th help of submodule tag.
u can refer to this: https://github.com/golang/go/wiki/Modules#publishing-a-release
hope to bump patch successfully.
git version
[e.g. 2.22.0](⎈|test-ctx:ticket-system)➜ ticket_system git:(feature/update-ticket-msg) gsemver version
version.BuildInfo{Version:"0.1.0", GitCommit:"", GitTreeState:"", BuildDate:"", GoVersion:"go1.17", Compiler:"gc", Platform:"darwin/arm64"}
From gsemver 0.3.x, it will be possible to use different bump strategy per branch.
While it is possible to configure via command line parameter and some json, it's not convenient.
It should be possible to store configuration in a file and use it when bumping the version.
Ideally, it should also be possible to use one global file (user file), and specific file stored in some default location or given location via a parameter where the later take precedence over the former in this list.
Moreover, command line arguments should always take precedence over file configuration.
This is a sub-task of #4
Based on Angular commit convention:
Therefore, for the given commit types:
feat
, chore
, build
, ci
, refactor
, perf
-> gsemver
should bump MINOR
fix
, docs
, test
-> gsemver
should bump PATCH
Currently gsemver only match tags prefixed with v
.
Some project does not use this standard.
gsemver should match tag with and without v
prefix
This is a sub-task of #4
It would be nice to try github actions to see if it better integrates with github.
We may want to run github actions in parallel with travis for a few times before choosing between travis and github actions
When project starts getting mature, it's common to use a branch for a pre-release which should later become a release when it is fully merged into master.
It should be possible to define different bump strategy per branch or set of branches.
This is a sub-task of #4
For build-metadata
we might want to use some information like the current branch, the number of commits since the latest version, etc.
We might want to the same for pre-release
even if it's less common.
Using go template with a context containing all the necessary information should give the needed flexibility.
This is a sub-task of #4
Currently gsemver bump [auto]
uses:
v
prefix to find the latest version.A lot of project do not use these conventions but others such as:
bug/*
branch, a feature in feature/*
, a breaking change in major/*
or so. While it's not possible in git to retrieve the original branch, you can leverage a merge commit that contains the name of that branch and configure regular expression to match it.We may want to leverage go template to define the version format in non release branches for example to reuse the current branch name, the commit id, the number of commits from the latest tag, etc.
So this feature should probably be split into smaller issues.
when i use A feature branch, the patch has already been up to 1.0.100.But when changing the B branch , the patch version will be 0.0.1.
➜ ticket_system git:(feature/jwt) gsemver bump patch
0.0.2% ➜ ticket_system git:(feature/jwt) git checkout feature/ticket_system
Switched to branch 'feature/ticket_system'
Your branch is up to date with 'origin/feature/ticket_system'.
➜ ticket_system git:(feature/ticket_system) gsemver bump patch
1.0.343%
@arnaud-deprez hope to get yr early reply
Add a version sub-command to known what version of the tool we have.
gsemver version
output the version of gsemver
This is to complement #27
Add a command to view the current merged configuration with a command that prints the current file on the console.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.