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

MLIBZ-2122: Allow data validation upfront #248

Merged
merged 3 commits into from Oct 24, 2017

Conversation

Projects
None yet
3 participants
@heyzooi
Contributor

heyzooi commented Oct 13, 2017

Description

Allow data validation strategies upfront before return the lazy results

Changes

  • Introduces an optional validation in the FindOperation

Tests

  • Coming soon after we agree with the solution

@heyzooi heyzooi self-assigned this Oct 13, 2017

@heyzooi heyzooi requested a review from tejasranade Oct 13, 2017

@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io Oct 13, 2017

Codecov Report

Merging #248 into develop will increase coverage by 2.27%.
The diff coverage is 95.16%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #248      +/-   ##
===========================================
+ Coverage    87.69%   89.96%   +2.27%     
===========================================
  Files           65       66       +1     
  Lines         7443     8114     +671     
===========================================
+ Hits          6527     7300     +773     
+ Misses         916      814     -102
Flag Coverage Δ
#Mac 87.79% <95.16%> (+0.09%) ⬆️
#iOS 88.88% <95.16%> (?)
Impacted Files Coverage Δ
Kinvey/Kinvey/DataStore.swift 98.98% <100%> (+0.02%) ⬆️
Kinvey/Kinvey/AggregateOperation.swift 90.8% <100%> (+0.1%) ⬆️
Kinvey/Kinvey/PullOperation.swift 100% <100%> (ø) ⬆️
Kinvey/Kinvey/GetOperation.swift 100% <100%> (ø) ⬆️
Kinvey/Kinvey/ReadOperation.swift 100% <100%> (ø) ⬆️
Kinvey/Kinvey/CountOperation.swift 91.17% <100%> (+0.26%) ⬆️
Kinvey/Kinvey/FindOperation.swift 92.46% <100%> (+0.51%) ⬆️
Kinvey/Kinvey/ValidationStrategy.swift 80% <80%> (ø)
Kinvey/Kinvey/User.swift 92.28% <0%> (-3.25%) ⬇️
... and 14 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 12c3bc1...d606f4b. Read the comment docs.

codecov-io commented Oct 13, 2017

Codecov Report

Merging #248 into develop will increase coverage by 2.27%.
The diff coverage is 95.16%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #248      +/-   ##
===========================================
+ Coverage    87.69%   89.96%   +2.27%     
===========================================
  Files           65       66       +1     
  Lines         7443     8114     +671     
===========================================
+ Hits          6527     7300     +773     
+ Misses         916      814     -102
Flag Coverage Δ
#Mac 87.79% <95.16%> (+0.09%) ⬆️
#iOS 88.88% <95.16%> (?)
Impacted Files Coverage Δ
Kinvey/Kinvey/DataStore.swift 98.98% <100%> (+0.02%) ⬆️
Kinvey/Kinvey/AggregateOperation.swift 90.8% <100%> (+0.1%) ⬆️
Kinvey/Kinvey/PullOperation.swift 100% <100%> (ø) ⬆️
Kinvey/Kinvey/GetOperation.swift 100% <100%> (ø) ⬆️
Kinvey/Kinvey/ReadOperation.swift 100% <100%> (ø) ⬆️
Kinvey/Kinvey/CountOperation.swift 91.17% <100%> (+0.26%) ⬆️
Kinvey/Kinvey/FindOperation.swift 92.46% <100%> (+0.51%) ⬆️
Kinvey/Kinvey/ValidationStrategy.swift 80% <80%> (ø)
Kinvey/Kinvey/User.swift 92.28% <0%> (-3.25%) ⬇️
... and 14 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 12c3bc1...d606f4b. Read the comment docs.

@heyzooi heyzooi added the enhancement label Oct 18, 2017

@@ -103,7 +105,13 @@ open class DataStore<T: Persistable> where T: NSObject {
- Returns: An instance of `DataStore` which can be a new instance or a cached instance if you are passing a `tag` parameter.
*/
@available(*, deprecated: 3.0.22, message: "Please use `collection()` instead")
open class func getInstance(_ type: StoreType = .cache, deltaSet: Bool? = nil, client: Client = sharedClient, tag: String = defaultTag) -> DataStore {
open class func getInstance(

This comment has been minimized.

@tejasranade

tejasranade Oct 20, 2017

Member

Needs a reference doc for the new validationStrategy parameter.

@tejasranade

tejasranade Oct 20, 2017

Member

Needs a reference doc for the new validationStrategy parameter.

This comment has been minimized.

@heyzooi

heyzooi Oct 20, 2017

Contributor

done

@heyzooi

heyzooi Oct 20, 2017

Contributor

done

autoPagination: Bool = false,
client: Client = sharedClient,
tag: String = defaultTag,
validationStrategy: ValidationStrategy? = nil

This comment has been minimized.

@tejasranade

tejasranade Oct 20, 2017

Member

Same as above. Needs reference doc.

@tejasranade

tejasranade Oct 20, 2017

Member

Same as above. Needs reference doc.

This comment has been minimized.

@heyzooi

heyzooi Oct 20, 2017

Contributor

done

@heyzooi

heyzooi Oct 20, 2017

Contributor

done

Show outdated Hide outdated Kinvey/Kinvey/ValidationStrategy.swift Outdated
Show outdated Hide outdated Kinvey/Kinvey/ValidationStrategy.swift Outdated
Show outdated Hide outdated Kinvey/Kinvey/ValidationStrategy.swift Outdated

@heyzooi heyzooi merged commit 9e3bb0e into develop Oct 24, 2017

2 of 3 checks passed

codebeat 2 issues resolved and 23 introduced
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@heyzooi heyzooi deleted the feature/MLIBZ-2122-fatal_error branch Oct 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment