-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Couchbase SDK 3, Spring Data Couchbase 4 Integration #15645
Conversation
@gkysaad Can you please sign the cla? |
Whow, it looks like there's a lot of code to achieve in order to consume couchbase with spring |
@gkysaad Can you fix the conflicts please? |
Apologies for the delay on the conflicts/CLA - should be able to finish that up soon |
Hello, I tried to generate an app to test this, but I keep getting this error after generating some files, so the app is not fully generated. ERROR! Callback called multiple times
Error [ERR_MULTIPLE_CALLBACK]: Callback called multiple times
at NodeError (node:internal/errors:371:5)
at onFinish (node:internal/streams/writable:667:37)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
at runNextTicks (node:internal/process/task_queues:65:3)
at listOnTimeout (node:internal/timers:526:9)
at processTimers (node:internal/timers:500:7) {
code: 'ERR_MULTIPLE_CALLBACK'
} any one has an idea ? |
Nevermind, the issue was about using a non LTS version of node, so I installed back the latest LTS version (14.17.4), and now it is working. |
@gkysaad Can you please resolve conflicts? |
Signed the CLA, working on the rebase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be a huge work, thanks for your help. Can you check out my comment please?
...tity-server/templates/src/main/java/package/domain/Entity.java.jhi.spring_data_couchbase.ejs
Outdated
Show resolved
Hide resolved
...tity-server/templates/src/main/java/package/domain/Entity.java.jhi.spring_data_couchbase.ejs
Outdated
Show resolved
Hide resolved
generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/main/java/package/repository/AuthorityRepository.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/main/java/package/repository/AuthorityRepository.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/test/java/package/web/rest/TestUtil.java.ejs
Show resolved
Hide resolved
generators/entity-server/templates/src/main/java/package/repository/EntityRepository.java.ejs
Outdated
Show resolved
Hide resolved
import org.springframework.data.repository.core.NamedQueries; | ||
import <%= packageName %>.config.couchbase.CustomN1qlRepositoryQueryExecutor; | ||
|
||
public class CustomCouchbaseRepositoryQuery extends CouchbaseRepositoryQuery { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CouchbaseRepositoryQuery
is deprecated. Can you please explain exactly what the problem is that forces you to implement all this custom classes ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was already there on the branch that I started working from, so I'm not exactly sure. However, I didn't want to remove it so as to not break anything that depended on it. If you have any suggestions for removing or changing it, I can make those changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After testing without it, it seems that there is some broken tests in AccountResourceIT
due to this error:
java.lang.IllegalArgumentException: Authentication object cannot be null
I think we can find a more concise solution for that. But leave it for now. I'll try to look at it ASAP.
Added Couchbase tests to Github Actions and ensured they work with latest changes in the code
Only the non-reactive implementation of Couchbase was upgraded to the latest compatible SDK version
…serRepository.java.ejs Co-authored-by: Marcelo Shima <[email protected]>
…serRepository.java.ejs Co-authored-by: Marcelo Shima <[email protected]>
generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs
Outdated
Show resolved
Hide resolved
generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs
Outdated
Show resolved
Hide resolved
generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs
Outdated
Show resolved
Hide resolved
...tity-server/templates/src/main/java/package/domain/Entity.java.jhi.spring_data_couchbase.ejs
Show resolved
Hide resolved
…itory/EntityRepository.java.ejs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 3 missing tasks:
- Couchbase SDK 3, Spring Data Couchbase 4 Integration #15645 (comment)
- Couchbase SDK 3, Spring Data Couchbase 4 Integration #15645 (comment)
- Make tests succeed.
Or we can disable the tests for now and merge as it is, so work can continue in main repository.
generators/server/templates/src/main/java/package/service/UserService.java.ejs
Outdated
Show resolved
Hide resolved
I've completed the 2 tasks for those comments. As for the tests, when I made the PR, all the tests were passing and the functionality seemed to be working. There was some flakiness with some of the tests where they would not pass once but then pass when rerun. I disabled 2 that were consistently failing, but had working functionality. I think we should merge it as it is for now, then make a GitHub issue after the merge to look into the test flakiness. |
...entity-server/templates/src/main/java/package/repository/EntityRepository_couchbase.java.ejs
Outdated
Show resolved
Hide resolved
...entity-server/templates/src/main/java/package/repository/EntityRepository_couchbase.java.ejs
Outdated
Show resolved
Hide resolved
# Conflicts: # generators/server/files.js
I will cleanup the PR to merge. |
Merging.
|
This PR implements a fix for and is related to the following Issues/PRs: #14184, #11845, #13770, #13544, #12300
This adds support for this issue: #14745 and was tested with the latest stable version of Couchbase (6.6.2) and uses Spring Data Couchbase 4 (Couchbase Java SDK 3).
I have used @mraible's
fix-couchbase
branch here and in PR #14184 as a starting point for my work on this.Some notes:
UserResourceIT.getAllUsers()
andPublicUserResourceIT.getAllAuthorities()
.@N1qlJoin
support in Spring Data Couchbase 4 seems to be broken or disabled - there is little documentation or info about it online as well, so I've switched over the way document relationships are handled to use the normal@Field
annotations to embed the documents. I will create a separate issue in case anyone would like to look into this further.Please make sure the below checklist is followed for Pull Requests.
When you are still working on the PR, consider converting it to Draft (bellow reviewers) and adding
skip-ci
label, you can still see CI build result at your branch.