Skip to content

develop -> main: Release the move from libxmljs2 to libxml2-wasm - #585

Merged
simon-20 merged 23 commits into
mainfrom
develop
Aug 26, 2026
Merged

develop -> main: Release the move from libxmljs2 to libxml2-wasm#585
simon-20 merged 23 commits into
mainfrom
develop

Conversation

@simon-20

Copy link
Copy Markdown
Contributor

This PR releases to production the move to libxml2-wasm, which upgrades the underlying libxml used by the Validator, bringing it in line with the Dashboard, so that they both report the same types of errors.

simon-20 and others added 23 commits May 21, 2025 15:23
IATI/validator-services#496

Previously, this app used a BASIC_GITHUB_TOKEN with a personal access token.

Also fixes a bug in getFileCommitSha where an error message could contain the wrong code.
Was using branchRes var instead of fileRes
Github access - switch to Oauth app credentials. And reduce API calls.
 Running the integration tests against the Docker container requires temporarily
 setting "authLevel": "anonymous" in all five function.json files, because the
 container has no AzureWebJobsStorage and so cannot validate function keys.
 Committing that would leave the deployed endpoints reachable without a key.

 Adds a .husky/pre-commit check on staged content, and a matching
 check-auth-level job in develop-func-ci.yml which also gates automerge, so a
 Dependabot PR cannot merge with it set. The hook alone is insufficient: it can
 be bypassed with --no-verify and is absent in a fresh clone until npm install
 has run.
Tests added prior to replacing libxmljs2 - see js-validator-api#574

Adds schema-unit-tests/, the first coverage of the XSD schema path.
Extend the rules:test glob so the new directory runs in existing CI with
no workflow change.

Five cases fail deliberately. They assert the corrected behaviour and go
green when libxmljs2 is replaced. Two controls pass either side, guarding
against the suite going green by not validating at all.

Also adds an HTTP-level case to the newman collection.
Addresses issue #574

Now on libxml2-wasm 0.7.1 (libxml2 2.15.1), pinned exactly: a bump can
change the bundled libxml2, so it is excluded from Dependabot and
upgraded by hand.

Behaviour:
- Sign-only decimals are now reported; over-long decimals no longer are.
- No currently published dataset changes verdict, tested against all 451
  datasets the Dashboard reports as failing.
- With ?details=true, errors carry only { line, column }. str1, code,
  level, domain and int1 are no longer available.

Worth knowing when reading the diff:
- utils/xmlParse.js restores libxmljs2's throw semantics. libxml2-wasm
  throws whenever libxml2 records any error, even when it still built a
  usable document, which would turn schema errors into parse errors.
- Documents hold memory outside the JS heap and must be dispose()d.
  Schemas are compiled once by XsdValidator.fromDoc, not per activity.
- getFileInformation moves to utils/iatiFile.js, split so that parsing
  owns document creation, and so the tests can reach it without
  importing utils.js and therefore Redis.
Replace libxmljs2 with libxml2-wasm
Bumps [fastify/github-action-merge-dependabot](https://github.com/fastify/github-action-merge-dependabot) from 3.9.1 to 3.15.0.
- [Release notes](https://github.com/fastify/github-action-merge-dependabot/releases)
- [Commits](fastify/github-action-merge-dependabot@v3.9.1...v3.15.0)

---
updated-dependencies:
- dependency-name: fastify/github-action-merge-dependabot
  dependency-version: 3.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [azure/CLI](https://github.com/azure/cli) from 1.0.8 to 3.0.0.
- [Release notes](https://github.com/azure/cli/releases)
- [Changelog](https://github.com/Azure/cli/blob/master/ReleaseProcess.md)
- [Commits](Azure/cli@v1.0.8...v3.0.0)

---
updated-dependencies:
- dependency-name: azure/CLI
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [azure/login](https://github.com/azure/login) from 1.4.7 to 3.0.1.
- [Release notes](https://github.com/azure/login/releases)
- [Commits](Azure/login@v1.4.7...v3.0.1)

---
updated-dependencies:
- dependency-name: azure/login
  dependency-version: 3.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 7.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v4...v7)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
 The 2.5.0 bump updated package.json only. Cosmetic - npm ci accepts
 the mismatch - but the two should agree
Bumps [azure/docker-login](https://github.com/azure/docker-login) from 1 to 2.
- [Release notes](https://github.com/azure/docker-login/releases)
- [Commits](Azure/docker-login@v1...v2)

---
updated-dependencies:
- dependency-name: azure/docker-login
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
 sync package-lock.json version with package.json
docs(deploy): document why workflows get disabled
@simon-20
simon-20 merged commit 0eac01b into main Aug 26, 2026
16 checks passed
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.

3 participants