Repository navigation
Run the tests, the regeneration of the assets and the CI without Node.js [#318] - #344
Conversation
….js [#318] Configure downloads, and verifies against their SHA-512, the pinned bootstrap environment and the ten real packages of the tests' npm registry (test/web/registry-packages.json). `wf run test-registry` builds the registry, SelfBuild* builds the environment from the current sources, and the fixture DeveloperFixtures assembles what the browser tests read, so WEBFRONT_DEVELOPER_FIXTURES and WEBFRONT_REQUIRE_NODE are gone. The environment built this way is byte for byte the published 0.6.1. The 86 tests of `node --test` become 84 Jasmine specs in test/developer/specs, run by the repository's own `wf test` (DeveloperSpecs; the wf-package job on the checkout, where jasmine-core is now locked). The checksums of the bundle inputs and the command names reserved by the terminal and by webfront::Commands move to CMake tests. The core headers are rendered and checked by js/core/EmbedAsset.cmake, in pure CMake (ADR-016 v1.3), with a Catch2 scenario that decodes each of them. The Node.js tools, vendor/package*.json, the generator, `wf run embed-core` and the comparison job of Developer packages are deleted. NoNodeDependency audits every tracked file; its exceptions are listed with their reason, and NoNodeDependencyRejectsInjections proves it. Every CI job removes the JavaScript runtimes from the runner first (also on Windows).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
EmbedAsset.cmake wrote CRLF on Windows (file(WRITE) is a text-mode write), so a header it rendered was stale for its own check: file(CONFIGURE) writes LF. The global guard skipped no empty entry of the file list. DeveloperSpecs timed out on Windows compiling with esbuild-wasm: the two specs that did are dropped (DeveloperBrowserIntegration covers the real compiler) and the specs now take 2.5 s. The registry no longer unpacks large archives (configure extracts their package.json), the refresh build doubles as the reproducibility build, and the permission test runs a script that writes at once.
Their shortening is left to a separate pull request.
Their shortening is left to a separate pull request.
Closes #318. Epic #303.
Stacked on #343 (the pin of the tests to 0.6.1): until it merges, the diff also shows its commit.
No path of WebFront depends on Node.js, npm or npx any more: configure, build, tests, regeneration of the embedded assets, building and publishing the environment, and the CI.
What changed
cmake/WebFrontRegistry.cmakedownloads the ten real packages of the tests' npm registry (test/web/registry-packages.json: name, version, SHA-512), verifies them and stops the configure on a wrong digest.-DWEBFRONT_REGISTRY_DIRreplaces the downloads on a machine without network, like-DWEBFRONT_BOOTSTRAP_DIRdoes for the bootstrap environment.wf run test-registry(test/web/registry/) builds the registry (the real archives byte for byte, plus the synthetic ones);SelfBuildInstallinstalls the build dependencies from it;SelfBuildbuilds the environment from the current sources;DeveloperFixturesassembles what the browser tests read.WEBFRONT_DEVELOPER_FIXTURESandWEBFRONT_REQUIRE_NODEare gone. The environment built this way is byte for byte the published 0.6.1 (sha512-wBYPxKJQ...), so no environment version changes.node --testbecame 84 Jasmine specs intest/developer/specs/, run by the repository's ownwf test(DeveloperSpecson a copy of the sources; thewf-packagejob on the checkout and its lock, wherejasmine-coreis now locked). Two moved to CMake because they need no browser: the checksums of the bundle inputs (BundleInputsFresh,BundleInputsRejectsChange) and the command names reserved by the terminal and bywebfront::Commands(CommandNamesAgree). The mapping of every former tool and test is indocs/NODE_TOOLS_MIGRATION.md.js/core/EmbedAsset.cmake, in pure CMake. Decision recorded in ADR-016 v1.3: the freshness of the headers must be checkable by a build that has no browser, so one renderer in CMake serves generation and checking;wf run embed-coreand the Node.js generator are deleted.EmbeddedAssetGenerator(format, padding, exit status, path with spaces, symbolic link) replacesembed.test.mjs, and a Catch2 scenario decodes each header with the C++ data it declares and compares it with its source.NoNodeDependencyaudits every tracked file (imports and APIs of Node, commands, configuration, requirement in current documentation, "like node.js" positioning). Its exceptions are intest/cmake/NodeGuardExceptions.cmake, each with a reason; an exception that matches nothing fails.NoNodeDependencyRejectsInjectionsinjectsnode:fs, a workflow install command,engines.node, a Node script nobody calls, an old command in a guide,npx, afind_program, a shebang, a CommonJS require, a requirement and the positioning, and checks that a registry URL, package metadata, the bundlers' compile-time constant and a test of the rejection of a Node import pass.js/developer/tools/{build,check,*-check,fixtures,pages,pin-check,registry-fixture-node,release-check,site,archive-release}.mjs,js/developer/vendor/{embed.mjs,embed.test.mjs,package.json,package-lock.json}, thepackagejob and the comparison of Developer packages,setup-nodeand the npm cache of the three jobs, the.gitignoreand.gitattributesrules ofvendor/.remove-nodenow also works on Windows). The CEF job's configure downloads and verifies the registry packages, then the network is cut as before.Evidence
Local, WebKitGTK, GCC 15, with
node,nodejs,npm,npxandcorepackabsent fromPATH(checked withcommand -v): configure from an empty build directory, build, and the whole CTest suite: 306/306 (54web-integration;DeveloperSpecsruns 84 specs in 32 s). The guard fails on every injection listed above and passes on the tree.NewcomerDocsMatchExamplesandRepositoryLayoutpass.CEF/Xvfb:
BuildAndTest.ymlis dispatched on this branch (the change is in the browser test infrastructure); the result is posted below.Not done here
third_party/(Supprimer le dossier third_party/ : aucune source tierce vendorisée #319), the cross-platform qualification (Qualification multiplateforme et CI du parcours développeur complet #316) and the documentation consolidation (Documentation : environnement de développement autonome WebFront #317).Cannot read properties of null (reading 'appendChild')atWebFront.js:190(injectScriptbefore thewf testrunner page has abody): a latent race in the bridge, independent of this change, to be fixed with its own regression test.js/developer/vendor/node_modules(ignored output of the oldnpm ci) may still exist on a maintainer's machine; it can be deleted.