Skip to content

Upgrade to XP 8#212

Merged
rymsha merged 2 commits intomasterfrom
chore/upgrade-to-xp8
May 6, 2026
Merged

Upgrade to XP 8#212
rymsha merged 2 commits intomasterfrom
chore/upgrade-to-xp8

Conversation

@rymsha
Copy link
Copy Markdown
Contributor

@rymsha rymsha commented May 5, 2026

Summary

Upgrades the lib from XP 7 (xpVersion=7.0.0) to XP 8 (xpVersion=8.0.0-B4) per the xp-app-upgrader skill workflow. Library, not an app — none of the descriptor steps (application.xml, site/, admin tools/widgets, etc.) apply here, so no xp8migrator run was required.

Build / dependency changes

  • settings.gradle: added id 'com.enonic.xp.settings' version '4.0.0-B1' (latest published — 4.0.0-B4 is not on plugins.gradle.org yet, only A3 / B1)
  • build.gradle:
    • dropped the version pin on id 'com.enonic.xp.base' (settings plugin supplies it)
    • compileOnly "com.enonic.xp:script-api:${xpVersion}"compileOnly xplibs.api.script
    • compileOnly "com.enonic.xp:core-api:${xpVersion}"compileOnly xplibs.api.core
    • kept com.enonic.xp:testing:${xpVersion} as a long-form coordinate (no xplibs.* alias for it)
  • gradle.properties: xpVersion=7.0.0xpVersion=8.0.0-B4
  • Gradle wrapper: 8.19.4.1 (required by the new XP plugin family)

Test migration

XP 8's ScriptTestSupport uses JUnit 5 lifecycle annotations (@BeforeEach / @AfterEach), so the JUnit 4 test suite needed migrating:

  • junit:junit:4.13.2org.junit.jupiter:junit-jupiter:5.11.4 + junit-jupiter-engine + junit-platform-launcher (latter required by Gradle 9)
  • Added test { useJUnitPlatform() }
  • Replaced @org.junit.Test|Before|After|Ignore|Rule and org.junit.Assert.* with their org.junit.jupiter.api equivalents
  • @Test(timeout = 20000)@Test + @Timeout(20)
  • @Rule TemporaryFolder@TempDir Path (using tempFolder.resolve(name).toFile() instead of tempFolder.newFile(name))
  • assertTrue/False(message, condition)assertTrue/False(condition, message) (JUnit 5 message-arg position swap)

Test fixture update

XP 8's /lib/xp/testing.js assertJsonEquals runs JSON.stringify with a replaceJava reviver that converts com.google.common.io.ByteSource to {} (instead of dropping it as in XP 7). Since ResponseMapper writes gen.value("bodyStream", bodySource), the response now stringifies with a "bodyStream": {} field. Added that field to every expected JSON in request-test.js, secure-request-test.js, and the shipped lib/examples/http-client/request.js doc example. No Java/runtime behavior change.

Not performed

  • Runtime/deployment verification (sandbox is ephemeral; explicitly out of scope per the upgrade brief).
  • xp8migrator: skipped — this is a lib with no descriptors to convert.

🤖 Generated with Claude Code

- settings.gradle: add com.enonic.xp.settings plugin 4.0.0-B1
- build.gradle: drop xp.base version pin, switch script-api/core-api to xplibs.api.* aliases
- gradle.properties: bump xpVersion 7.0.0 -> 8.0.0-B4
- Bump Gradle wrapper 8.1 -> 9.4.1
- Migrate tests from JUnit 4 to JUnit 5 (XP 8 ScriptTestSupport uses Jupiter)
- Add bodyStream: {} to test/example fixtures (XP 8 lib/xp/testing serializes ByteSource as {})

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.42%. Comparing base (4e65bb6) to head (44bd2db).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #212   +/-   ##
=========================================
  Coverage     91.42%   91.42%           
  Complexity      156      156           
=========================================
  Files             9        9           
  Lines           513      513           
  Branches         58       58           
=========================================
  Hits            469      469           
  Misses           23       23           
  Partials         21       21           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rymsha rymsha merged commit 672cc9d into master May 6, 2026
2 checks passed
@rymsha rymsha deleted the chore/upgrade-to-xp8 branch May 6, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant