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

feat: allow partially failing batch inserts #4083

Merged
merged 27 commits into from
Sep 17, 2024

Conversation

hperl
Copy link
Contributor

@hperl hperl commented Sep 9, 2024

When batch-inserting multiple identities, conflicts or validation errors of a subset of identities in the batch still allow the rest of the identities to be inserted. The returned JSON contains the error details that lead to the failure.

Related issue(s)

Docs PR: ory/docs#1864

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    [email protected]) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

@hperl hperl self-assigned this Sep 9, 2024
@hperl hperl force-pushed the hperl/improve-batch-patch-identities-error-messages branch from 05027a7 to 447c5d6 Compare September 10, 2024 08:22
Copy link

codecov bot commented Sep 10, 2024

Codecov Report

Attention: Patch coverage is 88.48921% with 32 lines in your changes missing coverage. Please review.

Project coverage is 78.64%. Comparing base (3215792) to head (efa05f6).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
persistence/sql/batch/create.go 81.25% 7 Missing and 8 partials ⚠️
persistence/sql/identity/persister_identity.go 84.00% 6 Missing and 6 partials ⚠️
identity/manager.go 96.00% 1 Missing and 1 partial ⚠️
persistence/sql/batch/test_persister.go 96.87% 1 Missing and 1 partial ⚠️
identity/handler.go 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4083      +/-   ##
==========================================
- Coverage   79.00%   78.64%   -0.36%     
==========================================
  Files         377      377              
  Lines       27492    26963     -529     
==========================================
- Hits        21720    21205     -515     
+ Misses       4165     4149      -16     
- Partials     1607     1609       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hperl hperl force-pushed the hperl/improve-batch-patch-identities-error-messages branch from 6fae6d9 to 0ed2ed1 Compare September 11, 2024 09:27
identity/handler_test.go Outdated Show resolved Hide resolved
identity/manager.go Outdated Show resolved Hide resolved
identity/handler.go Show resolved Hide resolved
persistence/sql/batch/create.go Outdated Show resolved Hide resolved
persistence/sql/batch/create.go Show resolved Hide resolved
persistence/sql/batch/create_test.go Outdated Show resolved Hide resolved
@hperl hperl requested a review from zepatrik September 16, 2024 13:55
Copy link
Member

@zepatrik zepatrik left a comment

Choose a reason for hiding this comment

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

Looks great now, just some small nits.

persistence/sql/batch/create.go Show resolved Hide resolved
persistence/sql/batch/create.go Outdated Show resolved Hide resolved
@hperl hperl enabled auto-merge (squash) September 17, 2024 12:52
@hperl hperl merged commit 4ba7033 into master Sep 17, 2024
22 checks passed
@hperl hperl deleted the hperl/improve-batch-patch-identities-error-messages branch September 17, 2024 15:33
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.

3 participants