build: scaffold the model-driven build under emf with its gates and CI job - #104
Merged
Merged
Conversation
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #80 (parent #78)
What this branch does
The model-driven implementation gets its build before it gets any EMF code, so the walking skeleton (#81) lands into gates that already hold. This is the EMF scaffold: a Maven reactor under
emf/, its gates, its CI job and the root wiring that watches it. It has no EMF, OCL, Xtext, QVTo or Acceleo dependency and no Tycho yet.mvnwdownloads Maven 3.9.16, pinned by SHA-256, and no wrapper jar is committed. JDK 21 comes fromemf/.java-version, which CI reads too. Coordinatesdev.jorisjonkers.deploykit.emf, version0.1.0-SNAPSHOT, and the enforcer bans any distribution target, so nothing can be published.parity, holding the first real code the parity contract needs.CanonicalJsonwrites RFC 8785 canonical JSON: keys sorted by UTF-16 code units, numbers as ECMAScript formats a double,nullrefused with the JSON Pointer of where it sat.Ledgerschecks the witness list and the rule ledger against the repository.0115): the enforcer (JDK 21, Maven 3.9, pinned plugins, dependency convergence, no distribution target),-Xlint:all -Werror, JUnit 6 with AssertJ, ArchUnit enforcing the module directionemf/docs/architecture.mdstates, Spotless with palantir-java-format, JaCoCo line and branch floors, and PIT mutation testing.emf/docs/rules.mdlists all 14 rules with the literal that enforces each, and the build fails when one is removed while its row stays.emfCI job runs./mvnw -B -ntp verifyinemf/, is required byPipeline Complete, and writes one summary line:44 tests, line coverage 100.0%, mutation score 100.0% (87 of 87).codeql.ymlis a reusable workflow thatci.ymlcalls as thecodeqljob ("Code scanning"), whichPipeline Completeneeds, on every pull request and every push tomain, plus its weekly schedule. A last step reads the analysis output and fails on any unsuppressed finding of any severity, notes included, so a finding blocks the merge instead of only landing in the Security tab; a wrong one is filtered in.github/codeql/codeql-config.ymlwith its reason. It scansjava-kotlinalongside JavaScript, TypeScript and workflow logic, all withbuild-mode: none, so theAutobuildstep and the old path filter are gone, and ignorestarget/and generated sources.test/emf-wiring.test.tsfails when a workflow runs the Maven wrapper where there is no POM or wrapper, when the reactor names a module that is not on disk, or when CodeQL stops scanning the Java. It addsRULE-061,RULE-062andREQ-015;test/pipeline-wiring.test.tsholds the CodeQL gate's wiring, withRULE-063andREQ-016. release-please excludesemf, Renovate groups themavenandmaven-wrappermanagers underemf maven, and CODEOWNERS,.gitattributes, README, the gates table (now sixteen) andCONTEXT.md(EMF scaffold and walking skeleton, so bootstrap keeps its model meaning) all name it. ESLint and Prettier ignore Maven'starget/output.The decisions later tickets inherit
Thresholds are measured, not chosen. The first build reached 100% line coverage, 100% branch coverage and 87 of 87 mutants killed, so those are the floors, and they only rise. Three mutants were equivalent (a boundary no input can reach); they were removed by restructuring the number formatter, not by lowering the score.
The gates follow the estate, with Java-shaped additions. An audit of the estate's JVM repositories found JDK 21, warnings as errors, JaCoCo, JUnit with AssertJ and ArchUnit, and nothing for Java formatting or static analysis. Spotless is the Java counterpart of the estate's ktlint. PIT is new to the estate's JVM code and is kept because the parity code decides what counts as agreement. SpotBugs, Error Prone, NullAway, SBOM generation and signing are rejected, for the reasons in
0115.JaCoCo does not append. Its default appends to the previous run's
jacoco.exec, which let a deleted test pass the coverage floor locally. Coverage is now one run's.Gate order in
verify: enforcer, compile, tests, format, coverage, mutation../mvnw spotless:applyfixes formatting.The first CodeQL run found a real defect, which is why it became a gate.
Ledgersparsed a ledger's stated row count withInteger.parseInt, so a count too large for anintthrew instead of being reported (java/uncaught-number-format-exception). The count is now compared as text, with a test for an oversized number.Verification
Each gate broken on this branch from a clean build, then restored:
0.5number case removed):Mutation score of 99 is below threshold of 100lines covered ratio is 0.98, but expected minimum is 1.00The following files had format violationsListfield:warnings found and -Werror specifiedmetamodelclass importingparity:where layer 'metamodel' may only be accessed by layers ['syntax', 'resolve', 'render', 'cli', 'parity']' was violatedwhich names a POM that does not existandemf/pom.xml names module gone, which is not on diskjava/uncaught-number-format-exception emf/parity/src/main/java/Ledgers.java:109 ...and exits 1, a suppressed finding is ignored, and an empty result printsNo CodeQL findings.and exits 0./mvnw -B -ntp clean verifyinemf/:BUILD SUCCESS, 44 tests.npm run verifyexit 0, 313 tests, coverage unchanged.node scripts/lint-adrs.ts emfreports10 files clean.actionlint1.7.7, the version CI pins, clean over every workflow;shellcheckclean onemf/scripts/summary.sh.exclude-pathschecked against the release-please config schema.On this pull request, every check passes, including
Code scanning / Analyze (java-kotlin)andPipeline Complete, with no open code scanning alert. Not verifiable before merge: that afeat:commit touching onlyemf/produces no release-please change.