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

Change Document controller m* routes returns & fix SDK functional tests #1476

Merged
merged 71 commits into from Oct 10, 2019

Conversation

@Aschen
Copy link
Contributor

commented Sep 24, 2019

What does this PR do ?

Breaking change: document:mCreate, document:mCreateOrReplace, document:mReplace, document:mUpdate, bulk:mWrite and bulk:import

  • no more partial errors when some action fail
  • returns successful writes in the successes array (instead of hits)
  • returns failed writes in the errors array

Breaking change: document:mDelete

  • does not return a partial error anymore
  • returns an object containing 2 arrays: successes (contain deleted ids) and errors (contain error objects)

Breaking change: document:mGet

  • does not return a partial error anymore
  • returns an object containing 2 arrays: successes (contain document) and errors (contain not found document IDs)

New feature:: security:updateXXXMappings

  • returns the updated mappings

This PR also contain fix for Kuzzle that I found by running the JS SDK functional tests.

Other changes

  • updates external links to ES 5.6 to 7.3
  • add check on the validation document format
Aschen added 11 commits Sep 19, 2019
wip
wip
@@ -24,7 +24,6 @@ print_something() {
echo "#"

This comment has been minimized.

Copy link
@Aschen

Aschen Sep 24, 2019

Author Contributor

Changes from #1475

if (errors.length > 0) {
request.setError(errorsManager.get('deletion_failed', errors));
}

// @todo should be done in clientAdapter ?

This comment has been minimized.

Copy link
@kuzzle

kuzzle Sep 24, 2019

Contributor

INFO Complete the task associated to this TODO comment. rule

@Aschen Aschen changed the title Fix Kuzzle according to JS SDK functional tests Change Document controller m* routes returns Sep 24, 2019
@codecov

This comment has been minimized.

Copy link

commented Sep 24, 2019

Codecov Report

Merging #1476 into 2-dev will increase coverage by 0.16%.
The diff coverage is 86.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##            2-dev    #1476      +/-   ##
==========================================
+ Coverage   92.64%   92.81%   +0.16%     
==========================================
  Files          98       98              
  Lines        6637     6663      +26     
==========================================
+ Hits         6149     6184      +35     
+ Misses        488      479       -9
Impacted Files Coverage Δ
lib/api/controllers/collectionController.js 90.32% <ø> (ø) ⬆️
lib/api/core/models/repositories/repository.js 97.67% <ø> (-0.02%) ⬇️
lib/config/httpRoutes.js 100% <ø> (ø) ⬆️
lib/api/core/models/repositories/roleRepository.js 92.85% <0%> (ø) ⬆️
lib/util/esWrapper.js 45.9% <0%> (+30.38%) ⬆️
lib/api/core/storage/clientAdapter.js 95.12% <100%> (+0.38%) ⬆️
lib/api/controllers/bulkController.js 96.87% <100%> (+2.13%) ⬆️
lib/api/controllers/documentController.js 96.72% <100%> (-0.18%) ⬇️
lib/api/core/storage/storageEngine.js 98.61% <100%> (-0.04%) ⬇️
.../api/core/models/repositories/profileRepository.js 98.83% <100%> (ø) ⬆️
... and 7 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 afd3ca6...bf98f50. Read the comment docs.

npm install --unsafe-perm
# We only need to rebuild for tests against differents version of Node.js
if [ ! -z "$TRAVIS" ]; then
if [ ! -z "$TRAVIS" ] || [ ! -z "$REBUILD" ]; then

This comment has been minimized.

Copy link
@Aschen

Aschen Sep 24, 2019

Author Contributor

Do not systematically install and rebuild npm module

@Aschen Aschen changed the title Change Document controller m* routes returns Change Document controller m* routes returns & fix SDK functional tests Sep 24, 2019
nit
@Aschen Aschen changed the base branch from 2-stable to 2-dev Sep 24, 2019
Aschen added 2 commits Sep 25, 2019
Aschen and others added 7 commits Oct 7, 2019
Co-Authored-By: Nicolas Juelle <n.juelle@gmail.com>
…e into fix-sdk-functionnal-tests
@Njuelle
Njuelle approved these changes Oct 7, 2019
Aschen added 3 commits Oct 7, 2019
@@ -1431,38 +1485,39 @@ class ElasticSearch extends Service {
{
const
query = { ids: { values: [] } },
toGet = [],
validIds = [],
partialErrors = [];

// @todo should be done in clientAdapter

This comment has been minimized.

Copy link
@kuzzle

kuzzle Oct 7, 2019

Contributor

INFO Complete the task associated to this TODO comment. rule

Aschen and others added 13 commits Oct 8, 2019
…e into fix-sdk-functionnal-tests
@kuzzle

This comment has been minimized.

Copy link
Contributor

commented Oct 10, 2019

SonarQube analysis reported 6 issues

  • INFO 6 info

Watch the comments in this conversation to review them.

4 extra issues

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. INFO documentController.js#L480: Complete the task associated to this TODO comment. rule
  2. INFO repository.js#L69: Complete the task associated to this TODO comment. rule
  3. INFO elasticsearch.js#L1541: Complete the task associated to this TODO comment. rule
  4. INFO elasticsearch.js#L1619: Complete the task associated to this TODO comment. rule
@Aschen Aschen merged commit e5a574d into 2-dev Oct 10, 2019
4 checks passed
4 checks passed
LGTM analysis: JavaScript No new or fixed alerts
Details
codecov/project 92.81% (+0.16%) compared to afd3ca6
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
sonarqube SonarQube reported 6 issues, no criticals or blockers
@Aschen Aschen deleted the fix-sdk-functionnal-tests branch Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.