From 8f9b667f9db59ceff8e5d26e458244e2d67838da Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Fri, 27 Jan 2023 12:34:49 +0300 Subject: [PATCH] New version module info & Release 0.16.0 (#426) * 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 --- .github/workflows/push_rockspec.yml | 1 - CHANGELOG.md | 1 + metrics/init.lua | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_rockspec.yml b/.github/workflows/push_rockspec.yml index 5aa9c16b..74d1a23e 100644 --- a/.github/workflows/push_rockspec.yml +++ b/.github/workflows/push_rockspec.yml @@ -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: diff --git a/CHANGELOG.md b/CHANGELOG.md index 1755dc1d..77753f69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/metrics/init.lua b/metrics/init.lua index 56eae4ec..93c68995 100644 --- a/metrics/init.lua +++ b/metrics/init.lua @@ -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 @@ -156,4 +156,5 @@ return { http_middleware = require('metrics.http_middleware'), collect = collect, VERSION = VERSION, + _VERSION = VERSION, }