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

[poc] upgrade to latest XML resolver version #5461

Closed
wants to merge 108 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
d0257aa
Migrate to latest xmlresolver. Fixed tests
dizzzz Sep 30, 2024
267f5d6
Merge branch 'develop' into poc/xmlresolver
dizzzz Oct 29, 2024
f0b0512
Bump org.bouncycastle:bcprov-jdk18on from 1.78.1 to 1.79
dependabot[bot] Oct 30, 2024
672eb54
Bump org.owasp:dependency-check-maven from 11.0.0 to 11.1.0
dependabot[bot] Oct 31, 2024
5086304
Bump com.googlecode.maven-download-plugin:download-maven-plugin
dependabot[bot] Nov 1, 2024
6383874
Merge pull request #5531 from eXist-db/dependabot/maven/com.googlecod…
dizzzz Nov 1, 2024
4231b81
Merge pull request #5528 from eXist-db/dependabot/maven/org.owasp-dep…
dizzzz Nov 1, 2024
e8b4798
Merge pull request #5527 from eXist-db/dependabot/maven/org.bouncycas…
dizzzz Nov 1, 2024
e66dacc
Bump org.apache.maven.plugins:maven-surefire-plugin from 3.5.1 to 3.5.2
dependabot[bot] Nov 4, 2024
1ffe1a0
Bump net.bytebuddy:byte-buddy from 1.15.7 to 1.15.10
dependabot[bot] Nov 4, 2024
b551020
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.10.1 to 3.11.1
dependabot[bot] Nov 4, 2024
3e5cf01
Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.5.1 to 3.5.2
dependabot[bot] Nov 4, 2024
e2c3a5c
Bump org.apache.maven.plugins:maven-surefire-report-plugin
dependabot[bot] Nov 4, 2024
d1ec3b2
Merge pull request #5534 from eXist-db/dependabot/maven/org.apache.ma…
dizzzz Nov 4, 2024
3caaa61
Merge pull request #5537 from eXist-db/dependabot/maven/org.apache.ma…
dizzzz Nov 4, 2024
43ec62b
Merge pull request #5539 from eXist-db/dependabot/maven/org.apache.ma…
dizzzz Nov 4, 2024
fa4507c
Merge pull request #5538 from eXist-db/dependabot/maven/org.apache.ma…
dizzzz Nov 4, 2024
592224d
Merge pull request #5535 from eXist-db/dependabot/maven/net.bytebuddy…
dizzzz Nov 4, 2024
9641cfe
Bump com.zaxxer:HikariCP from 6.0.0 to 6.1.0
dependabot[bot] Nov 6, 2024
f24c43d
Merge pull request #5540 from eXist-db/dependabot/maven/com.zaxxer-Hi…
dizzzz Nov 6, 2024
4ed9f5f
[bugfix] Repair JNLP interface, use correct BC library
dizzzz Nov 11, 2024
f576ff3
Bump org.quartz-scheduler:quartz from 2.3.2 to 2.5.0
dependabot[bot] Nov 13, 2024
d97e63b
Merge pull request #5548 from eXist-db/dependabot/maven/org.quartz-sc…
dizzzz Nov 13, 2024
442bf0e
Bump com.googlecode.maven-download-plugin:download-maven-plugin
dependabot[bot] Nov 14, 2024
079b5a0
Bump org.codehaus.mojo:versions-maven-plugin from 2.17.1 to 2.18.0
dependabot[bot] Nov 14, 2024
7153ecf
Merge pull request #5551 from eXist-db/dependabot/maven/org.codehaus.…
dizzzz Nov 15, 2024
4a4e1ed
Merge pull request #5550 from eXist-db/dependabot/maven/com.googlecod…
dizzzz Nov 15, 2024
e731051
Bump greenmail.version from 2.1.0 to 2.1.1
dependabot[bot] Nov 18, 2024
46e97ce
Bump org.easymock:easymock from 5.4.0 to 5.5.0
dependabot[bot] Nov 18, 2024
4a50a1d
Bump com.zaxxer:HikariCP from 6.1.0 to 6.2.0
dependabot[bot] Nov 18, 2024
29e6eaf
Bump com.googlecode.maven-download-plugin:download-maven-plugin
dependabot[bot] Nov 18, 2024
6dc6a27
Merge pull request #5545 from eXist-db/bugfix/5544-bug-jnlp-for-exist…
line-o Nov 18, 2024
8a03993
Merge pull request #5556 from eXist-db/dependabot/maven/org.easymock-…
dizzzz Nov 18, 2024
1a53e3e
Merge pull request #5557 from eXist-db/dependabot/maven/com.zaxxer-Hi…
dizzzz Nov 18, 2024
f0e64c8
Merge pull request #5555 from eXist-db/dependabot/maven/greenmail.ver…
dizzzz Nov 18, 2024
6e6055c
Merge pull request #5558 from eXist-db/dependabot/maven/com.googlecod…
dizzzz Nov 18, 2024
568eed7
Bump geotools.version from 32.0 to 32.1
dependabot[bot] Nov 19, 2024
bfc5a4a
Bump com.zaxxer:HikariCP from 6.2.0 to 6.2.1
dependabot[bot] Nov 19, 2024
cd6a656
Merge pull request #5560 from eXist-db/dependabot/maven/com.zaxxer-Hi…
dizzzz Nov 19, 2024
8f94745
Merge pull request #5559 from eXist-db/dependabot/maven/geotools.vers…
dizzzz Nov 19, 2024
c1e371b
Bump commons-io:commons-io from 2.17.0 to 2.18.0
dependabot[bot] Nov 20, 2024
d6f5a0a
Bump io.github.hakky54:logcaptor from 2.9.3 to 2.10.0
dependabot[bot] Nov 20, 2024
fccd417
Bump com.googlecode.maven-download-plugin:download-maven-plugin
dependabot[bot] Nov 21, 2024
04e3c59
Bump log4j.version from 2.24.1 to 2.24.2
dependabot[bot] Nov 22, 2024
61fcba2
Merge pull request #5564 from eXist-db/dependabot/maven/io.github.hak…
dizzzz Nov 22, 2024
bc65e79
Merge pull request #5563 from eXist-db/dependabot/maven/commons-io-co…
dizzzz Nov 22, 2024
f95fa2b
Merge pull request #5566 from eXist-db/dependabot/maven/com.googlecod…
dizzzz Nov 22, 2024
863fe85
Merge pull request #5568 from eXist-db/dependabot/maven/log4j.version…
dizzzz Nov 24, 2024
dba68b1
[hotfix] fix and extend TransformFromPkgTest
line-o Dec 9, 2024
d8a9ed7
Merge pull request #5574 from line-o/hotfix/transform-test
reinhapa Dec 10, 2024
b01063e
Bump com.fifesoft:rsyntaxtextarea from 3.5.2 to 3.5.3
dependabot[bot] Dec 10, 2024
613b6a6
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.1 to 3.11.2
dependabot[bot] Dec 10, 2024
2443397
Bump greenmail.version from 2.1.1 to 2.1.2
dependabot[bot] Dec 10, 2024
2ed38c2
Merge pull request #5573 from eXist-db/dependabot/maven/com.fifesoft-…
dizzzz Dec 10, 2024
73afa2b
Merge pull request #5570 from eXist-db/dependabot/maven/greenmail.ver…
dizzzz Dec 10, 2024
f83f0d6
Bump org.owasp:dependency-check-maven from 11.1.0 to 11.1.1
dependabot[bot] Dec 10, 2024
d145f11
Merge pull request #5572 from eXist-db/dependabot/maven/org.apache.ma…
dizzzz Dec 10, 2024
34d1afb
Bump org.jline:jline from 3.27.1 to 3.28.0
dependabot[bot] Dec 11, 2024
1e63dfd
Merge pull request #5578 from eXist-db/dependabot/maven/org.jline-jli…
dizzzz Dec 11, 2024
3e76c32
Merge pull request #5571 from eXist-db/dependabot/maven/org.owasp-dep…
dizzzz Dec 11, 2024
2e5102a
[bugfix] register binary attribute in xconf schema
joewiz Aug 30, 2024
bac6441
Merge pull request #5436 from joewiz/xconf-xsd-add-text-binary
line-o Dec 11, 2024
5bc3019
[refactor] remove dead code
duncdrum Nov 2, 2024
4fb0518
[feature] add multi-arch images
duncdrum Nov 2, 2024
b1adc4f
[ignore] bump base image
duncdrum Nov 12, 2024
47fd3c1
[bugfix] workaround docker maven plugin issue
duncdrum Nov 12, 2024
495805a
[refactor] LegacyKeyValueFormat
duncdrum Nov 12, 2024
41bf2b5
[ignore] no more experimental images
duncdrum Nov 12, 2024
2d95bd1
[ignore] adress comment
duncdrum Nov 26, 2024
6770707
Merge pull request #5533 from duncdrum/feat-multi-arch-containers
dizzzz Dec 13, 2024
d1b3592
Bump net.bytebuddy:byte-buddy from 1.15.10 to 1.15.11
dependabot[bot] Dec 16, 2024
1f7a623
Bump log4j.version from 2.24.2 to 2.24.3
dependabot[bot] Dec 16, 2024
ffc6433
Merge pull request #5581 from eXist-db/dependabot/maven/log4j.version…
dizzzz Dec 16, 2024
3d43db2
Merge pull request #5580 from eXist-db/dependabot/maven/net.bytebuddy…
dizzzz Dec 16, 2024
841811d
Bump org.junit.platform:junit-platform-engine from 1.11.3 to 1.11.4
dependabot[bot] Dec 17, 2024
b238041
Merge pull request #5583 from eXist-db/dependabot/maven/org.junit.pla…
dizzzz Dec 18, 2024
6795890
Bump junit.jupiter.version from 5.11.3 to 5.11.4
dependabot[bot] Dec 18, 2024
a237eb8
Merge pull request #5582 from eXist-db/dependabot/maven/junit.jupiter…
dizzzz Dec 18, 2024
28c5538
[bugfix] allow module imports in one-off xqueries
line-o Oct 31, 2024
fc7c447
Bump org.assertj:assertj-core from 3.26.3 to 3.27.0
dependabot[bot] Dec 20, 2024
f5b5c2d
Merge pull request #5585 from eXist-db/dependabot/maven/org.assertj-a…
dizzzz Dec 22, 2024
57c22a4
[bugfix] upgradr transient library
dizzzz Dec 24, 2024
73c37ad
Bump org.apache.mina:mina-core in /extensions/debuggee
dependabot[bot] Dec 26, 2024
f7c3016
[bugfix] Fix ForClause PositionalVar empty sequence handling.
Robin6939 Dec 25, 2024
2f3f1d9
[bugfix] upgrade transient library - add rationale
dizzzz Dec 29, 2024
10053f2
Merge pull request #5590 from eXist-db/dependabot/maven/extensions/de…
dizzzz Dec 29, 2024
91931ef
Bump org.relaxng:jing from 20220510 to 20241231
dependabot[bot] Dec 30, 2024
adbb94b
[bugfix] registered import-uris have precedence
line-o Dec 10, 2024
c9d18fb
Merge pull request #5589 from Robin6939/hotfix/forclause-positionalva…
line-o Dec 30, 2024
70443c1
Merge pull request #5591 from eXist-db/dependabot/maven/org.relaxng-j…
dizzzz Dec 30, 2024
fb930ca
Merge pull request #5588 from dizzzz/fix/upgrade-beanutils
dizzzz Dec 30, 2024
0f39c7c
Bump org.assertj:assertj-core from 3.27.0 to 3.27.1
dependabot[bot] Jan 2, 2025
40adfcb
[feature] gh package snapshots...
duncdrum Jan 2, 2025
53aef8e
[bugfix] address review
duncdrum Jan 3, 2025
2b8973a
Merge pull request #5595 from eXist-db/dependabot/maven/org.assertj-a…
duncdrum Jan 3, 2025
002d327
Bump org.assertj:assertj-core from 3.27.1 to 3.27.2
dependabot[bot] Jan 6, 2025
a77353a
Merge pull request #5599 from eXist-db/dependabot/maven/org.assertj-a…
dizzzz Jan 6, 2025
1060482
Bump commons-codec:commons-codec from 1.17.1 to 1.17.2
dependabot[bot] Jan 7, 2025
ce5f2f4
Bump commons-beanutils:commons-beanutils from 1.9.4 to 1.10.0
dependabot[bot] Jan 8, 2025
64a22fb
Merge pull request #5600 from eXist-db/dependabot/maven/commons-codec…
dizzzz Jan 8, 2025
44a69e4
Merge pull request #5602 from eXist-db/dependabot/maven/commons-beanu…
dizzzz Jan 8, 2025
7dd2fda
Merge pull request #5596 from duncdrum/feat-gh-packages
dizzzz Jan 8, 2025
d79adf3
Merge pull request #5576 from line-o/hotfix/transform-import
dizzzz Jan 9, 2025
6565f57
Merge pull request #5529 from line-o/fix/5525
dizzzz Jan 9, 2025
478e4c9
Migrate to latest xmlresolver. Fixed tests
dizzzz Sep 30, 2024
0c3e8a4
Merge branch 'poc/xmlresolver' of github.com:dizzzz/exist into poc/xm…
dizzzz Jan 11, 2025
dc88631
fix build
dizzzz Jan 11, 2025
1cfc847
Improve and revise tests
dizzzz Jan 11, 2025
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
@@ -1,10 +1,11 @@
name: Deploy
name: Publish Container
on: [push, pull_request]
jobs:
build:
name: Build and Test Images
name: Test and Publish Container Images
runs-on: ubuntu-latest
# NOTE (DP): Publish on develop and master, test on PRs against these
# TODO(DP) Reinstate CRONed release builds to update stock apps regularly
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' || github.base_ref == 'develop' || github.base_ref == 'master'
steps:
- uses: actions/checkout@v4
Expand All @@ -15,6 +16,10 @@ jobs:
with:
distribution: liberica
java-version: '17'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Make buildkit default
uses: docker/setup-buildx-action@v3
id: buildx
Expand All @@ -27,7 +32,11 @@ jobs:
key: deploy-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: deploy-${{ runner.os }}-maven
- name: Install bats
run: sudo apt-get install bats
run: sudo apt-get install bats
# Hack around #5450
- name: pull base image
run: |
docker pull --platform linux/amd64 --platform linux/arm64 gcr.io/distroless/java17-debian12:latest
- name: Build images
run: mvn -V -B -q -Pdocker -DskipTests -Ddependency-check.skip=true -P !mac-dmg-on-unix,!installer,!concurrency-stress-tests,!micro-benchmarks,skip-build-dist-archives clean package
- name: Check local images
Expand Down Expand Up @@ -68,4 +77,4 @@ jobs:
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# run: mvn -q -Ddocker.tag=experimental -Ddocker.username=$DOCKER_USERNAME -Ddocker.password=$DOCKER_PASSWORD docker:build docker:push
# working-directory: ./exist-docker

30 changes: 30 additions & 0 deletions .github/workflows/ci-snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Snaphots to Github Packages

on:
push:
branches:
- develop
workflow_dispatch: # Allow manual triggering

jobs:
publish-snapshots:
name: Deploy Snapshots
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: '17'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: deploy-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: deploy-${{ runner.os }}-maven
- name: Deploy SNAPSHOT maven artefacts
run: mvn -V -B -q -DskipTests -Ddependency-check.skip=true -P !mac-dmg-on-unix,!installer,!concurrency-stress-tests,!micro-benchmarks,skip-build-dist-archives clean deploy
10 changes: 5 additions & 5 deletions exist-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
<dependency>
<groupId>org.relaxng</groupId>
<artifactId>jing</artifactId>
<version>20220510</version>
<version>20241231</version>
<exclusions>
<exclusion> <!-- conflicts with Java 17's javax.xml module -->
<groupId>xml-apis</groupId>
Expand Down Expand Up @@ -169,7 +169,7 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.78.1</version>
<version>1.79</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -221,7 +221,7 @@
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline</artifactId>
<version>3.27.1</version>
<version>3.28.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -472,13 +472,13 @@
<dependency>
<groupId>com.fifesoft</groupId>
<artifactId>rsyntaxtextarea</artifactId>
<version>3.5.2</version>
<version>3.5.3</version>
</dependency>

<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.3.2</version> <!-- Quartz 2.3.1 has an issue on Windows, see: https://github.com/quartz-scheduler/quartz/issues/448 -->
<version>2.5.0</version> <!-- Quartz 2.3.1 has an issue on Windows, see: https://github.com/quartz-scheduler/quartz/issues/448 -->
<!-- exclude Quartz SQL connectivity options -->
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public class SourceFactory {
&& ((location.startsWith("/db") && !Files.exists(Paths.get(firstPathSegment(location))))
|| (contextPath != null && contextPath.startsWith("/db") && !Files.exists(Paths.get(firstPathSegment(contextPath)))))) {
final XmldbURI pathUri;
if (contextPath == null) {
if (contextPath == null || ".".equals(contextPath)) {
pathUri = XmldbURI.create(location);
} else {
pathUri = XmldbURI.create(contextPath).append(location);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
* @author <a href="mailto:[email protected]">Juri Leino</a>
*/
public abstract class XQueryCompilationTest {

@ClassRule
public static final ExistEmbeddedServer server = new ExistEmbeddedServer(true, true);

protected static Either<XPathException, CompiledXQuery> compileQuery(final String string) throws EXistException, PermissionDeniedException {
final BrokerPool pool = server.getBrokerPool();
final XQuery xqueryService = pool.getXQueryService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class JnlpJarFiles {
"commons-logging-%latest%",
"commons-pool-%latest%",
"jargo-%latest%",
"bcprov-jdk15on-%latest%",
"bcprov-jdk18on-%latest%",
"fastutil-%latest%-min",
"j8fu-%latest%",
"jackson-core-%latest%",
Expand Down
3 changes: 2 additions & 1 deletion exist-core/src/main/java/org/exist/xquery/ForExpr.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ private void processItem(LocalVariable var, Item contextItem, Sequence in, Seque
context.proceed(this);
context.setContextSequencePosition(p, in);
if (positionalVariable != null) {
at.setValue(new IntegerValue(this, p + 1));
final int position = contextItem == AtomicValue.EMPTY_VALUE ? 0 : p + 1;
at.setValue(new IntegerValue(this, position));
}
final Sequence contextSequence = contextItem.toSequence();
// set variable value to current item
Expand Down
45 changes: 23 additions & 22 deletions exist-core/src/main/java/org/exist/xquery/XQueryContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -587,33 +587,34 @@ public Optional<ExistRepository> getRepository() {
return null;
}

// use the resolved file or return null
if (resolved != null) {

String location = "";

try {

// see if the src exists in the database and if so, use that instead
Source src = repo.get().resolveStoredXQueryModuleFromDb(getBroker(), resolved);
if (src != null) {
// NOTE(AR) set the location of the module to import relative to this module's load path - so that transient imports of the imported module will resolve correctly!
location = Paths.get(XmldbURI.create(moduleLoadPath).getCollectionPath()).relativize(Paths.get(((DBSource)src).getDocumentPath().getCollectionPath())).toString();
// use the resolved file
String location = "";
try {
// see if the src exists in the database and if so, use that instead
Source src = repo.get().resolveStoredXQueryModuleFromDb(getBroker(), resolved);
if (src == null) {
// fallback to load the source from the filesystem
src = new FileSource(resolved, false);
} else {
final String sourceCollection = ((DBSource)src).getDocumentPath().getCollectionPath();
if (".".equals(moduleLoadPath)) {
// module is a string passed to the xquery context, has therefore no location of its own
location = sourceCollection;
} else {
// else, fallback to the one from the filesystem
src = new FileSource(resolved, false);
// NOTE(AR) set the location of the module to import relative to this module's load path
// - so that transient imports of the imported module will resolve correctly!
final Path collectionPath = Paths.get(XmldbURI.create(moduleLoadPath).getCollectionPath());
final Path sourcePath = Paths.get(sourceCollection);
location = collectionPath.relativize(sourcePath).toString();
}
}

// build a module object from the source
final ExternalModule module = compileOrBorrowModule(namespace, prefix, location, src);
return module;
// build a module object from the source
return compileOrBorrowModule(namespace, prefix, location, src);

} catch (final PermissionDeniedException e) {
throw new XPathException(e.getMessage(), e);
}
} catch (final PermissionDeniedException | IllegalArgumentException e) {
throw new XPathException(e.getMessage(), e);
}

return null;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ public class XsltURIResolverHelper {
@Nullable final URIResolver defaultResolver, @Nullable final String base, final boolean avoidSelf) {
final List<URIResolver> resolvers = new ArrayList<>();

// EXpath Pkg resolver
// This resolver needs to be the first one to prevent
// HTTP requests for registered package names (e.g. http://www.functx.com/functx.xsl)
brokerPool.getExpathRepo().map(repo -> resolvers.add(new PkgXsltModuleURIResolver(repo)));

if (base != null) {
// database resolver
resolvers.add(new EXistURISchemeURIResolver(new EXistURIResolver(brokerPool, base)));
resolvers.add(new EXistURIResolver(brokerPool, base));
}

// EXpath Pkg resolver
brokerPool.getExpathRepo().map(repo -> resolvers.add(new PkgXsltModuleURIResolver(repo)));

// default resolver
if (defaultResolver != null) {
if (avoidSelf) {
Expand Down
Loading
Loading