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

Spaces filters #2946

Merged
merged 5 commits into from
Jan 16, 2022
Merged

Spaces filters #2946

merged 5 commits into from
Jan 16, 2022

Conversation

micbar
Copy link
Contributor

@micbar micbar commented Jan 11, 2022

Description

This adds two possible filter terms (driveType, id) to the /me/drives endpoint on the graph api. These can be used with the odata query parameter "$filter".

We only support the "eq" operator for now.

This is leveraging the spaces-registry branch and needs to be rebased after that one has been merged.

Examples

Filter by Id

curl -L -X GET "https://localhost:9200/graph/v1.0/me/drives?$filter=id eq 'f98b7cc7-15ba-4715-9d16-23a746dfe648'" \
-H "Authorization: Basic YWRtaW46YWRtaW4="

Filter by type

curl -L -X GET "https://localhost:9200/graph/v1.0/me/drives?$filter=driveType eq 'project'" \
-H "Authorization: Basic YWRtaW46YWRtaW4="

Motivation and Context

How Has This Been Tested?

  • curl
  • needs API tests

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@micbar
Copy link
Contributor Author

micbar commented Jan 11, 2022

@butonic @kobergj I think I found a bug.

Regardless of the filters, the shared jail (driveType=="virtual") is always present.

@ownclouders
Copy link
Contributor

ownclouders commented Jan 11, 2022

💥 Acceptance test localApiTests-apiSpaces-ocis failed. Further test are cancelled...

@micbar
Copy link
Contributor Author

micbar commented Jan 11, 2022

@kobergj let me add some API tests

Copy link
Contributor

@dragotin dragotin left a comment

Choose a reason for hiding this comment

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

Maybe not so nitpicky nitpicks.

graph/pkg/service/v0/drives.go Outdated Show resolved Hide resolved
graph/pkg/service/v0/drives.go Outdated Show resolved Hide resolved
graph/pkg/service/v0/drives.go Show resolved Hide resolved
@micbar micbar requested a review from dragotin January 11, 2022 22:42
Copy link
Contributor

@dragotin dragotin left a comment

Choose a reason for hiding this comment

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

Nice from my POV

Copy link
Member

@butonic butonic left a comment

Choose a reason for hiding this comment

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

The test could be less redundant.

@sonarcloud
Copy link

sonarcloud bot commented Jan 16, 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

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@micbar micbar merged commit c09c5ed into master Jan 16, 2022
@delete-merged-branch delete-merged-branch bot deleted the spaces-filters branch January 16, 2022 20:38
@micbar micbar mentioned this pull request Feb 16, 2022
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants