tarantool / tarantool/doc

Module version

Open
#4,650 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
15
Forks
49
Avg merge
1d 13h
Merged PRs (30d)
3

Description

Since: Tarantool 3.3.0

Overview

The version module is intended to create and compare version objects.
It supports schema version (e.g. dd_version) and full SemVer-like
versions (see Tarantool's versioning policy:
https://www.tarantool.io/en/doc/latest/release/policy/#versioning-policy).

Tarantool's versions use the following format:
x.y.z-typeN-commit-ghash

  • x.y.z - major, minor, patch release numbers;
  • typeN - pre-release name and its optional number: alpha1, rc10. Optional;
  • commit - number of commits since the latest release. Optional;
  • ghash - latest commit hash in format g. Optional.

Note, that ghash itself and everything after it (e.g. -dev suffix) is
ignored and doesn't affect comparing of the version objects. Only
x.y.z-typeN-commit part is parsed and validated. However, if anything
is present after version string it must be prefixed with '-' symbol:
3.3.0-rc1-20-dev and not 3.3.0-rc1-20dev or 3.3.0-rc1-20.dev.

API Reference

Below is list of all version function and members:

  • version.new() - Create a version object
  • version.fromstr() - Get a converted from string version object
  1. version.new(major, minor, patch, prerelease, commit)
-- Get current schema
tarantool> t = box.space._schema:get('version')
tarantool> version.new(t[2], t[3], t[4])
---
- 3.3.0
...
tarantool> version.new(3, 3, 0, 'alpha2', 45)
---
- 3.3.0-alpha2-45
...

Parameters:
Everything is unsigned integer except of prerelease, which
can have one of the following values: 'entrypoint', 'alpha',
'beta', 'rc' or nil. It may also include number in the end.
Return:
version object
Return type:
cdata

  1. version.__call() - same as version.fromstr().

  2. version.fromstr(version_str)
    Creates version object from string. Note, that all excess symbols in
    the string are ignored.

tarantool> version.fromstr('1.2.5-entrypoint1-45-gc9981a567')
---
- 1.2.5-entrypoint1-45
...
  1. version_object supports comparing with other version objects or with
    strings. It has cdata type and the following fields: major, minor,
    patch, prerelease, commit.
    Requested by @Serpentian in https://github.com/tarantool/tarantool/commit/466733731cb9e11d73f49ad6fb3adc2332bfddb8.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue describes the version module API, including version.new(), version.__call(), version.fromstr(), and version-object fields and comparisons. Start by locating the documentation entry point for this module and compare its existing coverage with the supplied API reference. Done means the documented signatures, parameters, return values, supported formats, and examples match the requested behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.