Skip to content

chore: Volto 19 support - #114

Open
avoinea wants to merge 17 commits into
developfrom
volto19
Open

avoinea wants to merge 17 commits into
developfrom
volto19

Conversation

@avoinea

@avoinea avoinea commented Oct 16, 2026

Copy link
Copy Markdown
Member

Volto 19 support: CI/test configuration and dependency updates. The branch is green on both the Volto 18 and the Volto 19 Jenkins integrations.

avoinea and others added 17 commits August 12, 2026 16:48
The jest setup targeted the abandoned `src/addons/**` layout, so `testMatch`
resolved to nothing and all 8 test files were never executed. Adopt the
vitest.config.mjs already shared by the migrated addons and port the test
bodies to the `vi.*` API.

Tests:
- add vitest.config.mjs (byte-identical to the 18-addon fleet template)
- convert jest.setup.js to vitest.setup.jsx, enable it via VITEST_USE_SETUP
- drop the jest-only `virtual: true` third argument from vi.mock calls
- rewrite index.test.js as ESM (require() is unavailable under Vitest)
- add .github/workflows/unit.yml so tests run standalone against both
  Volto 18.35.1 and 19.3.0

Stale `src/addons/**` layout assumptions, which resolved three levels up and
therefore outside the repository, leaving eslint and i18n broken:
- .eslintrc.js: projectRootPath now two levels up
- Makefile: replace $(NODE_MODULES) paths with `pnpm exec`
- .husky/pre-commit: yarn -> pnpm

38 tests across 8 files now pass. `make lint` runs for the first time and
reports one pre-existing warning in components/variations/default/View.jsx
(restricted semantic-ui-react Image import), left untouched here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
First accurate extraction since `make i18n` was repaired: the Makefile pointed
at ../../../node_modules, so the target had been failing with exit 127 and the
catalogs had drifted.

Drops two stale entries whose source was deleted long ago — "Unknown Block"
and "delete", both attributed to components/EditBlockWrapper, which no longer
exists in src/. No message currently defined in the source is removed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Replaces the GitHub Actions workflow added in the previous commit. CI for these
addons lives in Jenkins, and the standalone workflow could not have worked
anyway: `pnpm add @plone/volto` does not pull @plone/volto-slate, which
vitest.config.mjs resolves at config-load time, so it failed on startup.

Jenkins already invokes `make test-ci` inside a full Volto image, where every
@plone/* package is present. The blocker was that the whole Docker/Jenkins
layout still assumed the abandoned src/addons/<name> tree:

- Jenkinsfile: /app/src/addons/$GIT_NAME -> /app/packages/$GIT_NAME (24 sites);
  coverage reportDir drops the now-absent lcov-report subdir; Volto matrix
  moves from 18-yarn/17 to 19/18
- Dockerfile: install the addon as a pnpm workspace package under
  /app/packages/, replacing /setupAddon + `yarn add jest-junit` + `yarn install`
- docker-compose.yml: mount at /app/packages/, default VOLTO_VERSION 19, drop
  RAZZLE_JEST_CONFIG
- Makefile: test-ci runs vitest via pnpm with v8 coverage and a junit reporter;
  ADDON_NAME is read from package.json rather than assembled from the directory
- add volto.config.js, required by the Dockerfile to register the addon

The Jenkinsfile is now structurally identical to the migrated addons; the only
remaining differences are GIT_NAME, SONARQUBE_TAGS and DEPENDENCIES.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Unblocks the Jenkins ES lint stage, which runs `make lint --max-warnings=0` and
failed on the `no-restricted-imports` rule for `Image` from semantic-ui-react.
The warning is not new; it was simply unreachable while eslint pointed outside
the repository.

Semantic's Image injects its own `image` class, which Volto's does not, and
less/menu.less styles the asset thumbnail via `.asset-position .image.icon`
/ `.tile` / `.thumb`. Add `image` to the className so those rules keep matching.

Verified by rendering AssetTab: the img keeps `ui image tile aligned`, the same
src and alt, and still matches `.asset-position .image.tile`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Restore the Cypress end-to-end coverage instrumentation: babel-plugin-istanbul plus a coverage babel config that instruments only the add-on sources. Unit tests now use the Istanbul coverage provider so the unit and e2e lcov reports share the same line model and can be merged by SonarQube.
The appHistory push can race with the client hydration, which then settles back on the server-rendered view URL and the title editor never mounts.
…in vitest

Look up the Volto checkout in any parent folder, resolve the core packages through Volto and alias the add-ons kept in each repository's packages/ folder, so the tests also run from the eea-website-frontend workspace.
Bring 10.0.5: add a new block to a tab emptied with delete (refs
#308479). New tests converted to vitest, jest-only setup files left out.
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.

2 participants