From 437d239acf38f1391fba3dae687d4ad03f97decc Mon Sep 17 00:00:00 2001 From: christophe mangeat Date: Fri, 31 Mar 2023 17:51:10 +0200 Subject: [PATCH 1/4] Revert "CSW / Fix escapeChar usage" This reverts commit 3756f7ea8894a6b3fca2ab54aadbe00487c2b7c0. --- .../csw/services/getrecords/es/CswFilter2Es.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2Es.java b/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2Es.java index 77086330f6..46009b9467 100644 --- a/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2Es.java +++ b/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2Es.java @@ -201,19 +201,17 @@ protected static String escapeLikeLiteral(String text) { protected static String convertLikePattern(PropertyIsLike filter) { String result = filter.getLiteral(); if (!filter.getWildCard().equals("*")) { - final String wildcardRe = - StringUtils.isNotEmpty(filter.getEscape()) - ? Pattern.quote(filter.getEscape() + filter.getWildCard()) - : filter.getWildCard(); + final String wildcardRe = "(? Date: Mon, 3 Apr 2023 14:43:16 +0200 Subject: [PATCH 2/4] heroic fix so to let mapstore query using '/' in equals --- .../kernel/csw/services/getrecords/es/CswFilter2Es.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2Es.java b/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2Es.java index 46009b9467..7cb7034cbe 100644 --- a/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2Es.java +++ b/csw-server/src/main/java/org/fao/geonet/kernel/csw/services/getrecords/es/CswFilter2Es.java @@ -363,7 +363,7 @@ public Object visit(PropertyIsEqualTo filter, Object extraData) { String dataPropertyValue = stack.pop(); String dataPropertyName = stack.pop(); - final String filterEqualTo = String.format(templateMatch, dataPropertyName, dataPropertyValue); + final String filterEqualTo = String.format(templateMatch, dataPropertyName, dataPropertyValue.replaceAll("\\/", "\\\\\\\\/")); stack.push(filterEqualTo); return this; @@ -463,7 +463,7 @@ public Object visit(PropertyIsNil filter, Object extraData) { /** * Fills out the templateSpatial. - * + * * @param shapeType For example "bbox" or "polygon". * @param coords The coordinates in the form needed by shapeType. * @param relation Spatial operation, like "intersects". From 79b3fcdb129bc2abb82529364e4faa5bcd3713d2 Mon Sep 17 00:00:00 2001 From: Pierre Mauduit Date: Thu, 5 Oct 2023 17:06:37 +0200 Subject: [PATCH 3/4] gha - adding several ways of triggering the CI --- .github/workflows/georchestra-gn4.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/georchestra-gn4.yml b/.github/workflows/georchestra-gn4.yml index 23d338ef97..2aa7a701c1 100644 --- a/.github/workflows/georchestra-gn4.yml +++ b/.github/workflows/georchestra-gn4.yml @@ -4,6 +4,8 @@ on: push: branches: - georchestra-gn4.2.x + pull_request: + workflow_dispatch: env: DOCKER_TAG: 4.2.x @@ -60,22 +62,26 @@ jobs: -DdockerImageName=georchestra/geonetwork:${DOCKER_TAG} -DskipTests - name: "publish the webapp as artifact" + if: github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/georchestra-gn4.2.x' && github.event_name != 'pull_request' uses: actions/upload-artifact@v1 with: name: geonetwork.war path: web/target/geonetwork.war - name: "Login onto docker-hub" + if: github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/georchestra-gn4.2.x' && github.event_name != 'pull_request' uses: docker/login-action@v1 with: username: '${{ secrets.DOCKER_HUB_USERNAME }}' password: '${{ secrets.DOCKER_HUB_PASSWORD }}' - name: "Pushing branch image to docker-hub" + if: github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/georchestra-gn4.2.x' && github.event_name != 'pull_request' run: | docker push georchestra/geonetwork:${DOCKER_TAG} - name: "Pushing latest image to docker-hub" + if: github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/georchestra-gn4.2.x' && github.event_name != 'pull_request' run: | docker tag georchestra/geonetwork:${DOCKER_TAG} georchestra/geonetwork:latest docker push georchestra/geonetwork:latest From 0423a62c00b098154ff627cc10917ac8d8166683 Mon Sep 17 00:00:00 2001 From: Pierre Mauduit Date: Mon, 9 Oct 2023 12:07:45 +0200 Subject: [PATCH 4/4] adding logback configuration for tests, avoids huge output --- .../src/test/resources/logback.xml | 17 +++++++++++++++++ .../src/test/resources/logback.xml | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 georchestra-integration/externalized-accounts/src/test/resources/logback.xml create mode 100644 georchestra-integration/georchestra-authnz/src/test/resources/logback.xml diff --git a/georchestra-integration/externalized-accounts/src/test/resources/logback.xml b/georchestra-integration/externalized-accounts/src/test/resources/logback.xml new file mode 100644 index 0000000000..40ee1ab076 --- /dev/null +++ b/georchestra-integration/externalized-accounts/src/test/resources/logback.xml @@ -0,0 +1,17 @@ + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + + + + + + + + + + diff --git a/georchestra-integration/georchestra-authnz/src/test/resources/logback.xml b/georchestra-integration/georchestra-authnz/src/test/resources/logback.xml new file mode 100644 index 0000000000..40ee1ab076 --- /dev/null +++ b/georchestra-integration/georchestra-authnz/src/test/resources/logback.xml @@ -0,0 +1,17 @@ + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + + + + + + + + + +