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

Reactivate Couchbase for SB3 #27972

Merged
merged 26 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f55a004
fix #27490 - remove old walkaround
kamilkrzywanski Nov 23, 2024
de7aebf
fix #27490 - remove old walkaround
kamilkrzywanski Nov 23, 2024
0a4c9b6
fix #27490 - remove old walkaround
kamilkrzywanski Nov 23, 2024
58b85b7
fix #27490 - remove old walkaround
kamilkrzywanski Nov 23, 2024
f1f7375
fix #27490 - remove old walkaround
kamilkrzywanski Nov 24, 2024
60ecd11
Merge branch 'jhipster:main' into main
kamilkrzywanski Nov 24, 2024
bd038b6
fix #27490 - remove old walkaround and fix tests
kamilkrzywanski Nov 24, 2024
d4d3152
fix #27490 - remove old walkaround and fix tests
kamilkrzywanski Nov 24, 2024
ee94cc6
fix #27490 - remove old walkaround and fix tests
kamilkrzywanski Nov 24, 2024
84a332b
docker: adjust couchbase healthcheck
mshima Nov 25, 2024
4633d6d
Merge branch 'jhipster:main' into main
kamilkrzywanski Nov 25, 2024
2bca5a0
fix #27490 - remove old walkaround and fix tests
kamilkrzywanski Nov 25, 2024
2ba00c5
spring-boot: don't sort uuids
mshima Nov 25, 2024
0ab4f02
spring-boot: test adjusts
mshima Nov 25, 2024
43bbdd1
spring-boot: adjusts
mshima Nov 25, 2024
7c6407a
spring-boot: fix
mshima Nov 25, 2024
43930d7
ci: enable couchbase ms sample
mshima Nov 25, 2024
e99c2b8
ci: enable couchbase search sample
mshima Nov 25, 2024
7dbf114
Merge branch 'jhipster:main' into main
kamilkrzywanski Nov 25, 2024
ec135ff
fix #27490 - remove old walkaround and fix tests
Nov 25, 2024
7c6dbd4
fix #27490 - remove old walkaround and fix tests
kamilkrzywanski Nov 25, 2024
8345e10
spring-boot: fix
mshima Nov 25, 2024
ca97bb9
fix #27490 - remove old walkaround and fix tests - npm update-snapshots
kamilkrzywanski Nov 25, 2024
f0fbec6
add .blueprint to update-snapshots
mshima Nov 25, 2024
6a0b48d
fix #27490 - remove old walkaround and fix tests - npm update-snapshots
kamilkrzywanski Nov 25, 2024
f119a58
Merge branch 'jhipster:main' into main
kamilkrzywanski Nov 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,45 @@ exports[`generator - github-build-matrix with angular should match matrix value
"jhipster-bom-branch": "main",
"jhipster-bom-cicd-version": "0.0.0-CICD"
},
{
"job-name": "ng-couchbase (n[1]/j[0])",
"sample": "ng-couchbase",
"os": "ubuntu-latest",
"node-version": "[1]",
"java-version": "[0]",
"npm-version": "NPM-VERSION",
"default-environment": "prod",
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
"skip-backend-tests": "false",
"skip-frontend-tests": "false",
"name": "ng-couchbase",
"app-sample": "ng-couchbase",
"entity": "couchbase",
"workspaces": "false",
"build-jhipster-bom": true,
"jhipster-bom-branch": "main",
"jhipster-bom-cicd-version": "0.0.0-CICD"
},
{
"job-name": "ng-gradle-couchbase-search (n[0]/j[1])",
"sample": "ng-gradle-couchbase-search",
"os": "ubuntu-latest",
"node-version": "[0]",
"java-version": "[1]",
"npm-version": "NPM-VERSION",
"default-environment": "prod",
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
"skip-backend-tests": "false",
"skip-frontend-tests": "false",
"gradle-cache": true,
"name": "ng-gradle-couchbase-search",
"app-sample": "ng-gradle-couchbase-search",
"entity": "couchbase",
"workspaces": "false",
"build-jhipster-bom": true,
"jhipster-bom-branch": "main",
"jhipster-bom-cicd-version": "0.0.0-CICD"
},
{
"job-name": "ng-gradle-fr (n[2]/j[3])",
"sample": "ng-gradle-fr",
Expand Down Expand Up @@ -272,6 +311,25 @@ exports[`generator - github-build-matrix with angular should match matrix value
"jhipster-bom-branch": "main",
"jhipster-bom-cicd-version": "0.0.0-CICD"
},
{
"job-name": "ng-webflux-couchbase (n[1]/j[3])",
"sample": "ng-webflux-couchbase",
"os": "ubuntu-latest",
"node-version": "[1]",
"java-version": "[3]",
"npm-version": "NPM-VERSION",
"default-environment": "prod",
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
"skip-backend-tests": "false",
"skip-frontend-tests": "false",
"name": "ng-webflux-couchbase",
"app-sample": "webflux-couchbase",
"entity": "couchbase",
"workspaces": "false",
"build-jhipster-bom": true,
"jhipster-bom-branch": "main",
"jhipster-bom-cicd-version": "0.0.0-CICD"
},
{
"job-name": "ms-ng-oauth2-mongodb-caffeine (n[1]/j[1])",
"sample": "ms-ng-oauth2-mongodb-caffeine",
Expand Down Expand Up @@ -911,6 +969,29 @@ exports[`generator - github-build-matrix with vue should match matrix value 1`]
"jhipster-bom-branch": "main",
"jhipster-bom-cicd-version": "0.0.0-CICD"
},
{
"job-name": "ms-vue-eureka-jwt-couchbase-hazelcast (n[0]/j[0])",
"sample": "ms-vue-eureka-jwt-couchbase-hazelcast",
"os": "ubuntu-latest",
"node-version": "[0]",
"java-version": "[0]",
"npm-version": "NPM-VERSION",
"default-environment": "prod",
"jwt-secret-key": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=",
"skip-backend-tests": "false",
"skip-frontend-tests": "false",
"gradle-cache": true,
"name": "ms-vue-eureka-jwt-couchbase-hazelcast",
"jdl-samples": "ms-vue-eureka-jwt-couchbase-hazelcast",
"generatorOptions": {
"workspaces": true,
"monorepository": true
},
"workspaces": "true",
"build-jhipster-bom": true,
"jhipster-bom-branch": "main",
"jhipster-bom-cicd-version": "0.0.0-CICD"
},
{
"job-name": "ms-mf-vue-consul-oauth2-mysql-memcached (n[2]/j[2])",
"sample": "ms-mf-vue-consul-oauth2-mysql-memcached",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1092,12 +1092,10 @@ jhipster:
- BUCKET=mscouchbase
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8091/ui/index.html
- CMD-SHELL
- curl -f "http://localhost:8091/ui/index.html" && sleep 20
interval: 5s
timeout: 5s
timeout: 25s
retries: 10

msmariadb:
Expand Down Expand Up @@ -1832,12 +1830,10 @@ jhipster:
- BUCKET=mscouchbase
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8091/ui/index.html
- CMD-SHELL
- curl -f "http://localhost:8091/ui/index.html" && sleep 20
interval: 5s
timeout: 5s
timeout: 25s
retries: 10

msmariadb:
Expand Down
4 changes: 2 additions & 2 deletions generators/docker/templates/docker/couchbase.yml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ services:
environment:
- BUCKET=<%= baseName %>
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:8091/ui/index.html']
test: ['CMD-SHELL', 'curl -f "http://localhost:8091/ui/index.html" && sleep 20']
interval: 5s
timeout: 5s
timeout: 25s
retries: 10
# volumes:
# - ~/volumes/jhipster/<%= baseName.toLowerCase() %>/couchbase/:/opt/couchbase/var
7 changes: 6 additions & 1 deletion generators/spring-boot/templates/build.gradle.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,15 @@ task cleanResources(type: Delete) {
delete "build/resources"
}

<%_ if (embeddableLaunchScript) { _%>
<%_ if ( embeddableLaunchScript || databaseTypeCouchbase ) { _%>

bootJar {
<%_ if ( databaseTypeCouchbase ) { _%>
loaderImplementation = org.springframework.boot.loader.tools.LoaderImplementation.CLASSIC
<%_ } _%>
<%_ if ( embeddableLaunchScript ) { _%>
launchScript()
<%_ } _%>
}
<%_ } _%>

Expand Down
3 changes: 3 additions & 0 deletions generators/spring-boot/templates/pom.xml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,9 @@
</executions>
<configuration>
<mainClass>${start-class}</mainClass>
<%_ if (databaseTypeCouchbase) { _%>
<loaderImplementation>CLASSIC</loaderImplementation>
<%_ } _%>
<%_ if (embeddableLaunchScript) { _%>
<executable>true</executable>
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,12 @@ class UserResourceIT {

// Get all the users
<%_ if (reactive) { _%>
<%= user.adminUserDto %> foundUser = webTestClient.get().uri("/api/admin/users?sort=id,desc")
<%= user.adminUserDto %> foundUser = webTestClient.get().uri("/api/admin/users<% if (user.primaryKey.typeNumeric) { %>?sort=id,desc<% } %>")
.accept(MediaType.APPLICATION_JSON)
.exchange()
.expectStatus().isOk()
.expectHeader().contentType(MediaType.APPLICATION_JSON)
.returnResult(<%= user.adminUserDto %>.class).getResponseBody().blockFirst();

.returnResult(<%= user.adminUserDto %>.class).getResponseBody()<% if (!user.primaryKey.typeNumeric) { %>.filter(e -> DEFAULT_LOGIN.equals(e.getLogin()))<% } %>.blockFirst();
assertThat(foundUser.getLogin()).isEqualTo(DEFAULT_LOGIN);
assertThat(foundUser.getFirstName()).isEqualTo(DEFAULT_FIRSTNAME);
assertThat(foundUser.getLastName()).isEqualTo(DEFAULT_LASTNAME);
Expand All @@ -513,7 +512,7 @@ class UserResourceIT {
<%_ } _%>
assertThat(foundUser.getLangKey()).isEqualTo(DEFAULT_LANGKEY);
<%_ } else { _%>
restUserMockMvc.perform(get("/api/admin/users<% if (databaseTypeSql) { %>?sort=id,desc<% } %>")
restUserMockMvc.perform(get("/api/admin/users<% if (user.primaryKey.typeNumeric) { %>?sort=id,desc<% } %>")
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
Expand Down Expand Up @@ -541,7 +540,7 @@ class UserResourceIT {
<%_ } _%>
<%_ if (cacheProviderAny) { _%>

assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNull();
assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin(), <%= user.persistClass %>.class)).isNull();
<%_ } _%>

// Get the user
Expand Down Expand Up @@ -578,7 +577,7 @@ class UserResourceIT {
assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNotNull();
}
<%_ } else if (cacheProviderAny) { _%>
assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNotNull();
assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin(), <%= user.persistClass %>.class)).isNotNull();
<%_ } _%>
}

Expand Down Expand Up @@ -882,7 +881,7 @@ class UserResourceIT {
<%_ } _%>
<%_ if (cacheProviderAny) { _%>

assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin())).isNull();
assertThat(cacheManager.getCache(UserRepository.USERS_BY_LOGIN_CACHE).get(user.getLogin(), <%= user.persistClass %>.class)).isNull();
<%_ } _%>

// Validate the database is empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ _%>
<%= persistInstance %>.set<%= primaryKey.nameCapitalized %>(<%- field.fieldJavaValueGenerator %>);
<%_ } _%>
<%_ } _%>
inserted<%= persistClass %> = <%= entityInstance %>Repository.<%= saveMethod %>(<%= persistInstance %>)<%= callBlock %>;
<%_ if (!databaseTypeCouchbase) { _%> inserted<%= persistClass %> = <%_ } _%><%= entityInstance %>Repository.<%= saveMethod %>(<%= persistInstance %>)<%= callBlock %>;
<%_ if (searchEngineElasticsearch) { _%>
<%= entityInstance %>Repository.save(<%= persistInstance %>)<%= callBlock %>;
<%= entityInstance %>SearchRepository.save(<%= persistInstance %>)<%= callBlock %>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public interface <%= entityClass %>Repository extends JHipsterCouchbaseRepositor
%> ", OBJECT_ADD(`<%= relationship.relationshipFieldName %>`, 'id', meta(`<%= relationship.relationshipFieldName %>`).id) AS `<%= relationship.relationshipFieldName %>`" + <%
}
} %>
" FROM #{#n1ql.bucket} b";
" FROM #{#n1ql.bucket}.#{#n1ql.scope}.#{#n1ql.collection} b";

String JOIN = <%
notEmbeddedRelationships.forEach(function (relationship, index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,6 @@ public class DatabaseConfiguration extends AbstractCouchbaseConfiguration {
return new CouchbaseCustomConversions(converters);
}

@Override
public MappingCouchbaseConverter mappingCouchbaseConverter(CouchbaseMappingContext couchbaseMappingContext, CouchbaseCustomConversions couchbaseCustomConversions) {
MappingCouchbaseConverter mappingCouchbaseConverter = super.mappingCouchbaseConverter(couchbaseMappingContext, couchbaseCustomConversions);
((GenericConversionService) mappingCouchbaseConverter.getConversionService()).addConverter(StringToObjectConverter.INSTANCE);
return mappingCouchbaseConverter;
}

@Bean
public Couchmove couchmove(Cluster cluster) {
LOG.debug("Configuring Couchmove");
Expand Down Expand Up @@ -307,18 +300,4 @@ public class DatabaseConfiguration extends AbstractCouchbaseConfiguration {
}

}

public enum StringToObjectConverter implements GenericConverter {
INSTANCE;

@Override
public Set<ConvertiblePair> getConvertibleTypes() {
return Collections.singleton(new ConvertiblePair(String.class, Object.class));
}

@Override
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ _%>
@ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS)
public interface JHipsterCouchbaseRepository<T, ID> extends <% if (reactive) { %>Reactive<% } %>CouchbaseRepository<T, ID> {

String FIND_IDS_QUERY = "SELECT meta().id as __id, 0 as __cas FROM #{#n1ql.bucket} WHERE #{#n1ql.filter}";
String FIND_IDS_QUERY = "SELECT meta().id as __id, 0 as __cas FROM #{#n1ql.bucket}.#{#n1ql.scope}.#{#n1ql.collection} WHERE #{#n1ql.filter}";

static String pageableStatement(Pageable pageable, String prefix) {
Sort sort = Sort.by(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"pretest": "npm run lint && npm run check-types",
"test": "npm run mocha-test test generators cli .blueprint",
"update-snapshot": "esmocha --no-insight --no-parallel --update-snapshot --",
"update-snapshots": "esmocha lib/jdl generators cli --update-snapshot --no-insight --forbid-only"
"update-snapshots": "esmocha lib/jdl generators cli .blueprint --update-snapshot --no-insight --forbid-only"
},
"dependencies": {
"@eslint/js": "9.15.0",
Expand Down
3 changes: 0 additions & 3 deletions test-integration/workflow-samples/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@
},
{
"name": "ng-couchbase",
"disabled": "needs adjusts for sb3",
"app-sample": "ng-couchbase",
"entity": "couchbase"
},
{
"name": "ng-gradle-couchbase-search",
"disabled": "needs adjusts for sb3",
"app-sample": "ng-gradle-couchbase-search",
"entity": "couchbase"
},
Expand Down Expand Up @@ -96,7 +94,6 @@
},
{
"name": "ng-webflux-couchbase",
"disabled": "needs adjusts for sb3",
"app-sample": "webflux-couchbase",
"entity": "couchbase"
},
Expand Down
1 change: 0 additions & 1 deletion test-integration/workflow-samples/vue.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
},
{
"name": "ms-vue-eureka-jwt-couchbase-hazelcast",
"disabled": "needs adjusts for sb3",
"jdl-samples": "ms-vue-eureka-jwt-couchbase-hazelcast",
"generatorOptions": {
"workspaces": true,
Expand Down
Loading