From 0dad3025bb3a6fb713229cf9e2f88c0e9d23ef1d Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Wed, 18 Mar 2026 12:10:24 +1100 Subject: [PATCH 1/4] LDEV-6157 update CI: build once, test against Lucee 6.2 and 7.0, gate deploy to master --- .github/workflows/main.yml | 81 +++++++++++++++++++++++++++----------- 1 file changed, 59 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f00fa12..d01e0f0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,12 +1,24 @@ name: Java CI Combined -on: [push, pull_request, workflow_dispatch] +on: + push: + pull_request: + workflow_dispatch: + inputs: + lucee-versions: + description: 'JSON array of Lucee versions to test' + default: '["7.0/snapshot/light","7.0/stable/light","6.2/snapshot/light","6.2/stable/light"]' + dry-run: + description: 'Dry run - skip deploy to Maven' + type: boolean + default: false jobs: setup: runs-on: ubuntu-latest outputs: version: ${{ steps.extract-version.outputs.VERSION }} + lucee-matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -31,6 +43,16 @@ jobs: VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + - name: Set Lucee test matrix + id: set-matrix + run: | + DEFAULT='["7.0/snapshot/light","7.0/stable/light","6.2/snapshot/light","6.2/stable/light"]' + MATRIX="${{ inputs.lucee-versions || '' }}" + if [ -z "$MATRIX" ]; then + MATRIX="$DEFAULT" + fi + echo "matrix=$MATRIX" >> $GITHUB_OUTPUT + - name: Cache Lucee files uses: actions/cache@v4 with: @@ -43,23 +65,9 @@ jobs: env: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - build-and-test: + build: runs-on: ubuntu-latest needs: setup - env: - testLabels: image - testAdditional: ${{ github.workspace }}/tests - LUCEE_TEST_VERSIONS_JAKARTA: ${{ vars.LUCEE_TEST_VERSIONS_JAKARTA }} - strategy: - fail-fast: false - matrix: - lucee: ${{ fromJSON(vars.LUCEE_TEST_VERSIONS_JAKARTA) }} - java: [ 11, 21 ] - services: - minio: - image: fclairamb/minio-github-actions - ports: - - 9000:9000 steps: - uses: actions/checkout@v4 @@ -69,6 +77,14 @@ jobs: java-version: '11' distribution: 'adopt' + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build and Install with Maven run: | echo "------- Maven Install -------"; @@ -77,9 +93,31 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@v4 with: - name: image-lex-${{ matrix.lucee.version }}-${{ matrix.java }} + name: image-lex path: target/*.lex + test: + runs-on: ubuntu-latest + needs: [setup, build] + strategy: + fail-fast: false + matrix: + lucee: ${{ fromJSON(needs.setup.outputs.lucee-matrix) }} + java: [ 11, 21 ] + services: + minio: + image: fclairamb/minio-github-actions + ports: + - 9000:9000 + steps: + - uses: actions/checkout@v4 + + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: image-lex + path: target + - name: Checkout Lucee uses: actions/checkout@v4 with: @@ -97,8 +135,7 @@ jobs: with: webroot: ${{ github.workspace }}/lucee/test execute: /bootstrap-tests.cfm - luceeVersion: ${{ matrix.lucee.version }} - luceeVersionQuery: ${{ matrix.lucee.query }} + luceeVersion: ${{ matrix.lucee }} extensionDir: ${{ github.workspace }}/target env: testLabels: image @@ -108,8 +145,8 @@ jobs: deploy: runs-on: ubuntu-latest - needs: [setup, build-and-test] - if: always() && needs.build-and-test.result == 'success' + needs: [setup, test] + if: always() && needs.test.result == 'success' && github.ref == 'refs/heads/master' && !inputs.dry-run steps: - name: Checkout repository uses: actions/checkout@v4 @@ -146,4 +183,4 @@ jobs: else echo "------- Maven Deploy release on ${{ github.event_name }} -------"; mvn -B -e -f pom.xml clean deploy -DperformRelease=true --settings maven-settings.xml - fi \ No newline at end of file + fi From 77a0dd07b330d49974175db8c42b3dea1b5308d7 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Wed, 18 Mar 2026 12:40:00 +1100 Subject: [PATCH 2/4] LDEV-6157 add test to repro jakarta bytecode error on Lucee 6 --- tests/LDEV6157.cfc | 22 ++++++++++++++++++++++ tests/LDEV6157/LDEV6157.cfm | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 tests/LDEV6157.cfc create mode 100644 tests/LDEV6157/LDEV6157.cfm diff --git a/tests/LDEV6157.cfc b/tests/LDEV6157.cfc new file mode 100644 index 0000000..56640ee --- /dev/null +++ b/tests/LDEV6157.cfc @@ -0,0 +1,22 @@ +component extends="org.lucee.cfml.test.LuceeTestCase" labels="image" { + + function run( testResults, testBox ) { + describe( "LDEV-6157 cfimage jakarta/javax compat", function() { + + it( title="cfimage action=writeToBrowser should not throw jakarta error on Lucee 6", body=function() { + local.result = _internalRequest( + template: "#createURI( 'LDEV6157' )#/LDEV6157.cfm" + ); + expect( result.filecontent.trim() ).toInclude( " + From 436cb75dc2d9f6d5af7fd1469982506963c1f167 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Wed, 18 Mar 2026 12:56:19 +1100 Subject: [PATCH 3/4] LDEV-6157 use reflection for getHttpServletRequest to avoid jakarta/javax bytecode binding --- .../src/org/lucee/extension/image/tag/jakarta/Image.java | 7 +++++-- .../src/org/lucee/extension/image/tag/javax/Image.java | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/source/java/src/org/lucee/extension/image/tag/jakarta/Image.java b/source/java/src/org/lucee/extension/image/tag/jakarta/Image.java index 7c29dac..1c3c5e2 100644 --- a/source/java/src/org/lucee/extension/image/tag/jakarta/Image.java +++ b/source/java/src/org/lucee/extension/image/tag/jakarta/Image.java @@ -405,8 +405,11 @@ private String touchDestination() throws IOException, PageException { destination = folder.getRealResource(name); cleanOld(folder); - // create path - String cp = pageContext.getHttpServletRequest().getContextPath(); + // create path (use reflection to avoid jakarta/javax bytecode binding) + Object req = eng.getClassUtil().callMethod(pageContext, + eng.getCastUtil().toKey("getHttpServletRequest"), new Object[] {}); + String cp = (String) eng.getClassUtil().callMethod(req, + eng.getCastUtil().toKey("getContextPath"), new Object[] {}); if (eng.getStringUtil().isEmpty(cp)) cp = ""; return cp + "/lucee/graph.cfm?img=" + name + "&type=" diff --git a/source/java/src/org/lucee/extension/image/tag/javax/Image.java b/source/java/src/org/lucee/extension/image/tag/javax/Image.java index ba896d2..094e4b1 100644 --- a/source/java/src/org/lucee/extension/image/tag/javax/Image.java +++ b/source/java/src/org/lucee/extension/image/tag/javax/Image.java @@ -365,8 +365,11 @@ private String touchDestination() throws IOException, PageException { destination = folder.getRealResource(name); cleanOld(folder); - // create path - String cp = pageContext.getHttpServletRequest().getContextPath(); + // create path (use reflection to avoid jakarta/javax bytecode binding) + Object req = eng.getClassUtil().callMethod(pageContext, + eng.getCastUtil().toKey("getHttpServletRequest"), new Object[] {}); + String cp = (String) eng.getClassUtil().callMethod(req, + eng.getCastUtil().toKey("getContextPath"), new Object[] {}); if (eng.getStringUtil().isEmpty(cp)) cp = ""; return cp + "/lucee/graph.cfm?img=" + name + "&type=" + (eng.getListUtil().last(ImageUtil.getMimeTypeFromFormat(format), "/", true).trim()); } From 7919b1eec736557c3877269ba3007dec44115a43 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Wed, 18 Mar 2026 13:11:04 +1100 Subject: [PATCH 4/4] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7d46262..210a52a 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ WEB-INF *.iml *.ipr *.iws +test-output/