diff --git a/cartridge/lua-api/boxinfo.lua b/cartridge/lua-api/boxinfo.lua index 3439db8e3..1d3209fac 100644 --- a/cartridge/lua-api/boxinfo.lua +++ b/cartridge/lua-api/boxinfo.lua @@ -21,6 +21,8 @@ local function set_webui_prefix(prefix) vars.webui_prefix = prefix end +local rocks_cache = {} + --- Retrieve `box.cfg` and `box.info` of a remote server. -- @function get_info -- @local @@ -126,6 +128,16 @@ local function get_info(uri) listen = box_cfg.listen.uri or box_cfg.listen[1].uri end + if next(rocks_cache) == nil then + local rocks = box.internal.feedback_daemon:generate_feedback().rocks + rocks.cartridge = nil + rocks.ddl = nil + rocks.vshard = nil + for rock_name, rock_version in pairs(rocks) do + table.insert(rocks_cache, ("%s == %s"):format(rock_name, rock_version)) + end + end + local ret = { general = { version = (package and (package .. ' ') or '') .. box_info.version, @@ -197,6 +209,7 @@ local function get_info(uri) version = require('cartridge').VERSION, vshard_version = vshard_version, ddl_version = ddl_version, + rocks = rocks_cache, state = server_state, error = server_error, }, diff --git a/cartridge/webui/gql-boxinfo.lua b/cartridge/webui/gql-boxinfo.lua index 5ca31a4e4..98e5af99d 100644 --- a/cartridge/webui/gql-boxinfo.lua +++ b/cartridge/webui/gql-boxinfo.lua @@ -365,6 +365,10 @@ local boxinfo_schema = { kind = gql_types.string, description = 'DDL version', }, + rocks = { + kind = gql_types.list(gql_types.string), + description = 'List of rocks and their versions', + }, } }).nonNull, membership = gql_types.object({ diff --git a/doc/schema.graphql b/doc/schema.graphql index a950b7c77..7f241d9ba 100644 --- a/doc/schema.graphql +++ b/doc/schema.graphql @@ -1,5 +1,5 @@ # source: http://127.0.0.1:8081/admin/api -# timestamp: Wed May 15 2024 19:16:51 GMT+0300 (Moscow Standard Time) +# timestamp: Thu Aug 22 2024 19:23:56 GMT+0300 (Moscow Standard Time) """Custom scalar specification.""" directive @specifiedBy( @@ -739,6 +739,9 @@ type ServerInfoCartridge { """DDL version""" ddl_version: String + + """List of rocks and their versions""" + rocks: [String] } type ServerInfoGeneral { diff --git a/webui/src/generated/graphql-typing-flow.js b/webui/src/generated/graphql-typing-flow.js index e1654dcd3..db2c9a54e 100644 --- a/webui/src/generated/graphql-typing-flow.js +++ b/webui/src/generated/graphql-typing-flow.js @@ -617,6 +617,8 @@ export type ServerInfoCartridge = {| vshard_version?: $ElementType, /** DDL version */ ddl_version?: $ElementType, + /** Rocks Versions */ + rocks?: ?Array>, |}; export type ServerInfoGeneral = {| @@ -1065,7 +1067,7 @@ export type ServerDetailsFieldsFragment = ({ ...{ __typename?: 'ServerInfo' }, ...{| cartridge: ({ ...{ __typename?: 'ServerInfoCartridge' }, - ...$Pick + ...$Pick }), membership: ({ ...{ __typename?: 'ServerInfoMembership' }, ...$Pick @@ -1122,7 +1124,7 @@ export type InstanceDataQuery = ({ ...{ __typename?: 'ServerInfo' }, ...{| cartridge: ({ ...{ __typename?: 'ServerInfoCartridge' }, - ...$Pick + ...$Pick }), membership: ({ ...{ __typename?: 'ServerInfoMembership' }, ...$Pick @@ -1228,7 +1230,7 @@ export type BoxInfoQuery = ({ ...{ __typename?: 'ServerInfo' }, ...{| cartridge: ({ ...{ __typename?: 'ServerInfoCartridge' }, - ...$Pick + ...$Pick }), membership: ({ ...{ __typename?: 'ServerInfoMembership' }, ...$Pick diff --git a/webui/src/generated/graphql-typing-ts.ts b/webui/src/generated/graphql-typing-ts.ts index 37d594878..23a64d8c7 100644 --- a/webui/src/generated/graphql-typing-ts.ts +++ b/webui/src/generated/graphql-typing-ts.ts @@ -594,6 +594,8 @@ export type ServerInfoCartridge = { vshard_version?: Maybe; /** DDL version */ ddl_version?: Maybe; + /** Rocks versions */ + rocks?: Maybe>>; }; export type ServerInfoGeneral = { @@ -1177,6 +1179,7 @@ export type ServerDetailsFieldsFragment = { version: string; vshard_version: string | null; ddl_version: string | null; + rocks: Array | null; }; membership: { __typename?: 'ServerInfoMembership'; @@ -1310,6 +1313,7 @@ export type InstanceDataQuery = { version: string; vshard_version: string | null; ddl_version: string | null; + rocks: Array | null; }; membership: { __typename?: 'ServerInfoMembership'; @@ -1476,6 +1480,7 @@ export type BoxInfoQuery = { version: string; vshard_version: string | null; ddl_version: string | null; + rocks: Array | null; }; membership: { __typename?: 'ServerInfoMembership';