Skip to content

config: add fail_if tag for roles and scripts#11510

Merged
Totktonada merged 1 commit intotarantool:masterfrom
grafin:grafin/roles-fail-if
Jun 16, 2025
Merged

config: add fail_if tag for roles and scripts#11510
Totktonada merged 1 commit intotarantool:masterfrom
grafin:grafin/roles-fail-if

Conversation

@grafin
Copy link
Member

@grafin grafin commented May 19, 2025

Closes #10987
Closes TNTP-1016

@TarantoolBot document
Title: fail_if tag for roles and scripts.

If the tag fail_if is set to an expression string role/script loading will raise an error, if fail_if expression is evaluated to be true.

The syntax for fail_if tag is the same as in config conditional.if section.

Example:

-- --- #tarantool.metadata.v1
-- fail_if: "tarantool_version < 3.1.0"
-- ...

@grafin grafin requested review from a team and Totktonada as code owners May 19, 2025 09:01
@coveralls
Copy link

coveralls commented May 19, 2025

Coverage Status

coverage: 87.504% (-0.008%) from 87.512%
when pulling f746208 on grafin:grafin/roles-fail-if
into 31b4108
on tarantool:master
.

Copy link
Contributor

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

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

Thank you! The code is OK for me.

I see that there are some repeting block of code. If you see how to reduce repetitions without ruining the readability, nice, I'm for that too. If not, OK, let's proceed as is. I don't want to spin around this on review.

Closes tarantool#10987
Closes TNTP-1016

@TarantoolBot document
Title: `fail_if` tag for roles and scripts.

If the tag `fail_if` is set to an expression string role/script
loading will raise an error, if fail_if expression is evaluated
to be `true`.

The syntax for `fail_if` tag is the same as in config `conditional.if`
section.

Example:
```lua
-- --- #tarantool.metadata.v1
-- fail_if: "tarantool_version < 3.1.0"
-- ...
```
@grafin grafin force-pushed the grafin/roles-fail-if branch from 8e249e9 to f746208 Compare June 15, 2025 12:47
@grafin grafin added the full-ci Enables all tests for a pull request label Jun 15, 2025
@grafin grafin assigned Totktonada and unassigned grafin Jun 16, 2025
@Totktonada Totktonada merged commit fbaaa14 into tarantool:master Jun 16, 2025
58 checks passed
@Totktonada Totktonada removed their assignment Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Enables all tests for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to specify min supported Tarantool version in application role code

5 participants