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

Migrate the collection controller #275

Merged
merged 8 commits into from
Jan 22, 2021
Merged

Conversation

Shiranuit
Copy link
Contributor

What does this PR do?

This PR adapt the collection controller to be compliant with Kuzzle V2

@Shiranuit Shiranuit self-assigned this Nov 26, 2020
@Shiranuit Shiranuit changed the base branch from master to 3-dev November 26, 2020 10:36
@codecov
Copy link

codecov bot commented Nov 26, 2020

Codecov Report

Merging #275 (f258dc4) into 3-dev (0a4a892) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            3-dev     #275      +/-   ##
==========================================
+ Coverage   89.71%   89.74%   +0.02%     
==========================================
  Files         241      242       +1     
  Lines        4034     4045      +11     
==========================================
+ Hits         3619     3630      +11     
  Misses        365      365              
  Partials       50       50              
Impacted Files Coverage Δ
collection/delete.go 100.00% <100.00%> (ø)

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 0a4a892...f258dc4. Read the comment docs.

@scottinet scottinet changed the title 262 adapt collection controller Migrate the collection controller Dec 3, 2020
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.

Ok after those 2 minor fixes

Comment on lines 23 to 29
if index == "" {
return types.NewError("Collection.Delete: index required", 400)
}

if collection == "" {
return types.NewError("Collection.Delete: collection required", 400)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You should let Kuzzle handle the errors if an index or collection name is empty

Suggested change
if index == "" {
return types.NewError("Collection.Delete: index required", 400)
}
if collection == "" {
return types.NewError("Collection.Delete: collection required", 400)
}

Copy link
Member

Choose a reason for hiding this comment

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

All the other controller actions have this kind of double check on input args. I think we should create an issue for those changes. What do you think @Aschen?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes we should remove every double check from the Go SDK 👍

@Shiranuit Shiranuit merged commit 9251462 into 3-dev Jan 22, 2021
@Yoann-Abbes Yoann-Abbes mentioned this pull request Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants