• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / tarantool / 5531420381
86%
master: 88%

Build:
Build:
LAST BUILD BRANCH: gh-12343
DEFAULT BRANCH: master
Ran 12 Jul 2023 12:27PM UTC
Jobs 1
Files 476
Run time 14s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Jul 2023 11:51AM UTC coverage: 85.777% (-0.004%) from 85.781%
5531420381

push

github

igormunkin
compat: add is_new and is_old to options

It used to be somewhat complicated to check the effective value
of a compat option, because `<option_name>.current` could contain
'default' state.
This patch introduces helper functions that take care of that.

The following alternatives were considered:
* `compat.<option_name>.effective` - it is excessive in the presence
  if `current` and `default`, and is visible in serialization
* `compat.<option_name>.get()` - while it is a function, it does only
  half of the work required, user still has to compare result to 'new'

Closes #8807

@TarantoolBot document
Title: Add `:is_new/old()` helpers to tarantool.compat options

`compat.<option_name>.current` can be 'new', 'old' or 'default',
thus when it is default there must be an additional check if
`compat.<option_name>.default` is 'new'. It is handier to have a
helper to deal with that instead of complicated `if`:
* check if effective value is 'new' before the patch:
  ```lua
  if compat.<option_name>.current == 'new' or
          (compat.<option_name>.current == 'default' and
           compat.<option_name>.default == 'new') then
      ...
  end
  ```
* after the patch:
  ```lua
  if compat.<option_name>:is_new() then
      ...
  end
  ```

Please update [tutorial on using compat], maybe add an example to
[Listing options details].

[tutorial on using compat]: https://www.tarantool.io/en/doc/latest/reference/reference_lua/compat/compat_tutorial/
[Listing options details]: https://www.tarantool.io/en/doc/latest/reference/reference_lua/compat/compat_tutorial/#listing-options-details

(cherry picked from commit 5f6d367c5)

62190 of 114064 branches covered (54.52%)

93162 of 108610 relevant lines covered (85.78%)

2872914.63 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5531420381.1 12 Jul 2023 12:27PM UTC 0
85.78
GitHub Action Run
Source Files on build 5531420381
Detailed source file information is not available for this build.
  • Back to Repo
  • 380956f4 on github
  • Prev Build on release/2.11 (#5477016912)
  • Next Build on release/2.11 (#5541148861)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc