Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add server:capabilities api action #2242

Merged
merged 19 commits into from
Feb 5, 2022
Merged

Add server:capabilities api action #2242

merged 19 commits into from
Feb 5, 2022

Conversation

clementbolin
Copy link
Contributor

What does this PR do ?

Exposing specific properties to the configuration because server:getConfig / server:info give too much info. We want a less verbose API action.

With the following information:

  • exposing Kuzzle limits
  • exposing backend for the storage and cache services (e.g. elasticsearch and redis)
  • API http routes (as in the server:publicApi action)

How should this be manually tested?

Start Kuzzle with docker-compose up, then with kourou use the capabilities action: kourou server:capabilities or send GET request to the route http:localhost:7512/_capabilities route.

@codecov
Copy link

codecov bot commented Dec 23, 2021

Codecov Report

Merging #2242 (8ee571e) into 2-dev (311d07f) will decrease coverage by 0.12%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##            2-dev    #2242      +/-   ##
==========================================
- Coverage   92.47%   92.34%   -0.13%     
==========================================
  Files         124      124              
  Lines        8190     8234      +44     
==========================================
+ Hits         7574     7604      +30     
- Misses        616      630      +14     
Impacted Files Coverage Δ
lib/api/httpRoutes.js 100.00% <ø> (ø)
lib/api/controllers/serverController.js 83.50% <33.33%> (-9.18%) ⬇️
lib/core/storage/clientAdapter.js 97.56% <0.00%> (-0.96%) ⬇️
lib/api/controllers/documentController.js 96.86% <0.00%> (-0.33%) ⬇️
lib/api/funnel.js 95.34% <0.00%> (ø)
lib/util/deprecate.js 88.46% <0.00%> (ø)
lib/core/plugin/plugin.js 82.19% <0.00%> (ø)
lib/core/network/router.js 82.69% <0.00%> (ø)
lib/core/validation/types/url.js 100.00% <0.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 311d07f...8ee571e. Read the comment docs.

lib/api/controllers/serverController.js Outdated Show resolved Hide resolved
doc/2/api/controllers/server/capabilities/index.md Outdated Show resolved Hide resolved
lib/api/controllers/serverController.js Outdated Show resolved Hide resolved
lib/api/controllers/serverController.js Outdated Show resolved Hide resolved
lib/api/controllers/serverController.js Show resolved Hide resolved
lib/api/controllers/serverController.js Show resolved Hide resolved
doc/2/api/controllers/server/capabilities/index.md Outdated Show resolved Hide resolved
Copy link
Contributor

@Shiranuit Shiranuit left a comment

Choose a reason for hiding this comment

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

Apply requested changes and this will be good to me

lib/api/controllers/serverController.js Outdated Show resolved Hide resolved
Copy link
Contributor

@Aschen Aschen left a comment

Choose a reason for hiding this comment

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

Missing functional tests

Comment on lines 80 to 81
this._info.elasticsearch = await global.kuzzle.ask('core:storage:public:info:get');
this._info.redis = await global.kuzzle.ask('core:cache:public:info:get');
Copy link
Contributor

Choose a reason for hiding this comment

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

Those promise should be made in //

features/ServerController.feature Outdated Show resolved Hide resolved
lib/api/controllers/baseController.js Outdated Show resolved Hide resolved
lib/api/controllers/serverController.js Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Feb 4, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.7% 1.7% Duplication

@Aschen Aschen merged commit 78ff2db into 2-dev Feb 5, 2022
@Aschen Aschen deleted the feat/server-capabilities branch February 5, 2022 03:29
@Aschen Aschen mentioned this pull request Feb 15, 2022
@Aschen Aschen added changelog:new-features Increase the minor version number and removed changelog:enhancements labels Feb 15, 2022
@Shiranuit Shiranuit mentioned this pull request Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x changelog:new-features Increase the minor version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new route server:capabilities
3 participants