Skip to content

Commit

Permalink
New version module info & Release 0.16.0 (#426)
Browse files Browse the repository at this point in the history
* api: set version in code

Before this patch, it was assumed that version would be set
automatically with CI. Yet, current approach don't work. This patch
replaces this approach with simple manual solution.

The rules are as follows:
- bump version to X.Y.Z in release commit,
- bump version to X.Y.Z-scm in the following commit.

luarocks.core.vers comparison treats scm version as we expect them to:
- X.Y.Z-scm > X.Y.Z
- X.Y.Z+1 > X.Y.Z-scm
- X.Y+1.0 > X.Y.Z-scm
- X+1.0.0 > X.Y.Z-scm

The version approach may be reworked later, but since we need a valid
version info for tarantool/tarantool#8192, we implement this one at
least for now.

Closes #330, part of tarantool/tarantool#8192

* api: provide _VERSION module info

As a part of new module policy, each module must have version info
stored in module._VERSION. For now, metrics._VERSION a duplicate of
metrics.VERSION, but the latter is likely to be deprecated later.

* release: 0.16.0
  • Loading branch information
DifferentialOrange authored Jan 27, 2023
1 parent 61acda0 commit 8f9b667
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/push_rockspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
-e "s/branch = '.\+'/tag = '${GIT_TAG}'/g" \
-e "s/version = '.\+'/version = '${GIT_TAG}-1'/g" \
${{ env.ROCK_NAME }}-scm-1.rockspec > ${{ env.ROCK_NAME }}-${GIT_TAG}-1.rockspec
sed -i "s/local VERSION = 'scm-1'/local VERSION = '"${GIT_TAG}"-1'/g" metrics/init.lua
- uses: tarantool/rocks.tarantool.org/github-action@master
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.16.0] - 2023-01-27
### Added

- Handle to clear psutils metrics
Expand Down
3 changes: 2 additions & 1 deletion metrics/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local Gauge = require('metrics.collectors.gauge')
local Histogram = require('metrics.collectors.histogram')
local Summary = require('metrics.collectors.summary')

local VERSION = 'scm-1'
local VERSION = '0.16.0'

local registry = rawget(_G, '__metrics_registry')
if not registry then
Expand Down Expand Up @@ -156,4 +156,5 @@ return {
http_middleware = require('metrics.http_middleware'),
collect = collect,
VERSION = VERSION,
_VERSION = VERSION,
}

0 comments on commit 8f9b667

Please sign in to comment.