Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev workflow: Bump version with the first PR that introduces change #357

Merged
merged 5 commits into from
Apr 28, 2021

Conversation

psrok1
Copy link
Member

@psrok1 psrok1 commented Apr 28, 2021

Your checklist for this pull request

What is the current behaviour?

Although current master branch contains new features under development, it has the same version number as latest release. That may be misleading for mwdb-core users.

It's a good practice to bump version with the first pull-request, so version number in master branch always fulfills the semantic versioning requirements.

What is the new behaviour?

  • Because version bump requires to change all the 6 files that contain the version number: added helper script dev/bump_version.py that assists in that change.
  • Added bump recommendation to CONTRIBUTING.md
  • Bumped version to 2.3.0 to apply the recommendation to current master branch, which introduces new features comparing to the current stable.

Example output from dev/bump_version.py:

$ python dev/bump_version.py 2.3.0
=== /home/psrok1/mwdb-core/setup.py
--- 
+++ 
@@ -7,7 +7,7 @@
 """
 
 setup(name="mwdb-core",
-      version="2.2.2",
+      version="2.3.0",
       description="MWDB Core malware database",
       long_description=LONG_DESCRIPTION,
       author="CERT Polska",
=== /home/psrok1/mwdb-core/mwdb/version.py
--- 
+++ 
@@ -4,5 +4,5 @@
 except IOError:
     git_revision = ""
 
-app_version = "2.2.2"
+app_version = "2.3.0"
 app_build_version = f"{app_version}+{git_revision}" if git_revision else app_version
=== /home/psrok1/mwdb-core/mwdb/web/package.json
--- 
+++ 
@@ -1,6 +1,6 @@
 {
   "name": "mwdb-web",
-  "version": "2.2.2",
+  "version": "2.3.0",
   "private": true,
   "dependencies": {
     "@fortawesome/fontawesome-svg-core": "^1.2.0-14",
=== /home/psrok1/mwdb-core/mwdb/web/package-lock.json
--- 
+++ 
@@ -1,6 +1,6 @@
 {
   "name": "mwdb-web",
-  "version": "2.2.2",
+  "version": "2.3.0",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
=== /home/psrok1/mwdb-core/mwdb/web/src/commons/package.json
--- 
+++ 
@@ -2,7 +2,7 @@
     "name": "@mwdb-web/commons",
     "main": "index.js",
     "private": true,
-    "version": "2.2.2",
+    "version": "2.3.0",
     "peerDependencies": {
         "@fortawesome/react-fontawesome": "*",
         "lodash": "*",
=== /home/psrok1/mwdb-core/docs/conf.py
--- 
+++ 
@@ -21,7 +21,7 @@
 author = 'CERT Polska'
 
 # The full version, including alpha/beta/rc tags
-release = '2.2.2'
+release = '2.3.0'
 
 
 # -- General configuration ---------------------------------------------------
[*] Check above diff ^ Is it correct? (y/n): y
[+] Changes applied!

@psrok1 psrok1 requested review from msm-code, chivay and KWMORALE April 28, 2021 12:37
Copy link
Contributor

@chivay chivay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:wew:

dev/bump_version.json Outdated Show resolved Hide resolved
@psrok1 psrok1 merged commit f590986 into master Apr 28, 2021
@psrok1 psrok1 deleted the dev/semver-version-bump branch April 28, 2021 13:30
@ITAYC0HEN
Copy link
Contributor

I think that a safer idea might be to add this to the release procedure. that means, that after a release, you will commit\pr the version bump.
So instead of waiting for some random change, it will be in the TO-DO list of the release procedure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants