Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
63ea017c
Commit
63ea017c
authored
1 year ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
feat: proc_version_info
parent
0ad93b18
No related branches found
No related tags found
No related merge requests found
Pipeline
#31485
failed
1 year ago
Stage: test
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/info.rs
+42
-0
42 additions, 0 deletions
src/info.rs
src/lib.rs
+2
-0
2 additions, 0 deletions
src/lib.rs
src/luamod.rs
+1
-1
1 addition, 1 deletion
src/luamod.rs
test/int/test_basics.py
+5
-0
5 additions, 0 deletions
test/int/test_basics.py
with
50 additions
and
1 deletion
src/info.rs
0 → 100644
+
42
−
0
View file @
63ea017c
use
std
::
borrow
::
Cow
;
use
tarantool
::
proc
;
pub
const
PICODATA_VERSION
:
&
'static
str
=
std
::
env!
(
"GIT_DESCRIBE"
);
pub
const
PROC_API_VERSION
:
&
'static
str
=
"0.1.0"
;
////////////////////////////////////////////////////////////////////////////////
// VersionInfo
////////////////////////////////////////////////////////////////////////////////
#[derive(Clone,
Debug,
::serde::Serialize,
::serde::Deserialize)]
pub
struct
VersionInfo
<
'a
>
{
pub
picodata_version
:
Cow
<
'a
,
str
>
,
pub
proc_api_version
:
Cow
<
'a
,
str
>
,
}
impl
<
'a
>
tarantool
::
tuple
::
Encode
for
VersionInfo
<
'a
>
{}
impl
<
'a
>
tarantool
::
proc
::
Return
for
VersionInfo
<
'a
>
{
#[inline(always)]
fn
ret
(
self
,
ctx
:
tarantool
::
tuple
::
FunctionCtx
)
->
std
::
os
::
raw
::
c_int
{
tarantool
::
proc
::
ReturnMsgpack
(
self
)
.ret
(
ctx
)
}
}
impl
VersionInfo
<
'static
>
{
pub
fn
current
()
->
Self
{
Self
{
picodata_version
:
PICODATA_VERSION
.into
(),
proc_api_version
:
PROC_API_VERSION
.into
(),
}
}
}
////////////////////////////////////////////////////////////////////////////////
// proc_veresion_info
////////////////////////////////////////////////////////////////////////////////
#[proc]
pub
fn
proc_version_info
()
->
VersionInfo
<
'static
>
{
VersionInfo
::
current
()
}
This diff is collapsed.
Click to expand it.
src/lib.rs
+
2
−
0
View file @
63ea017c
...
...
@@ -3,6 +3,7 @@
#![allow(clippy::let_and_return)]
#![allow(clippy::needless_return)]
#![allow(clippy::unwrap_or_default)]
#![allow(clippy::redundant_static_lifetimes)]
use
serde
::{
Deserialize
,
Serialize
};
use
::
raft
::
prelude
as
raft
;
...
...
@@ -41,6 +42,7 @@ pub mod discovery;
pub
mod
error_injection
;
pub
mod
failure_domain
;
pub
mod
governor
;
pub
mod
info
;
pub
mod
instance
;
pub
mod
ipc
;
pub
mod
kvcell
;
...
...
This diff is collapsed.
Click to expand it.
src/luamod.rs
+
1
−
1
View file @
63ea017c
...
...
@@ -67,7 +67,7 @@ pub(crate) fn setup(args: &args::Run) {
"
},
{
const
_
:
()
=
assert!
(
str_eq
(
env!
(
"CARGO_PKG_VERSION"
),
"23.12.0"
));
env!
(
"GIT_DESCRIBE"
)
crate
::
info
::
PICODATA_VERSION
},
);
...
...
This diff is collapsed.
Click to expand it.
test/int/test_basics.py
+
5
−
0
View file @
63ea017c
...
...
@@ -320,3 +320,8 @@ def test_governor_notices_restarts(instance: Instance):
check_vshard_configured
(
instance
)
assert
instance
.
current_grade
()
==
dict
(
variant
=
"
Online
"
,
incarnation
=
2
)
def
test_proc_version_info
(
instance
:
Instance
):
info
=
instance
.
call
(
"
.proc_version_info
"
)
assert
info
.
keys
()
==
set
([
"
picodata_version
"
,
"
proc_api_version
"
])
# type: ignore
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment