refactor: make emf/ navigable and its parity tier independent - #133
Closed
ExtraToast wants to merge 5 commits into
Closed
ExtraToast wants to merge 5 commits into
ExtraToast wants to merge 5 commits into
Conversation
Record two decisions for the model-driven implementation. 0120 puts the parity suite on the pipeline's file interface. The suite imports Pipeline, Parsed, Diagnostic and Descriptor today, which is why parity/ is an eclipse-plugin bundle while the architecture says a module needing no p2 bundle stays a plain jar. Moving the suite onto the files the pipeline writes closes that drift and narrows the test surface to the one an examiner exercises from a launch configuration. 0121 splits the tree into bundles/ for what Tycho builds and Eclipse imports and tests/ for what only Maven runs, and makes the second tier Kotlin. Ecore generates Java and a bundle compiles through JDT against a target platform with no Kotlin unit, so the bundle tier stays Java. Both are proposed, and the tree is unchanged: emf/docs/architecture.md describes the flat modules it still has and carries each decision as a "proposed, not landed" note beside the section it will rewrite.
…files the build leaves behind A run of the pipeline now leaves behind everything the parity contract compares, as files, in the canonical JSON the oracles are committed in. For every case under spec/v1/examples/, Outputs writes the parsed intent or the diagnostics that refused it, beside the exit code the run ended on, under cli/target/parity in a tree that mirrors the example tree, so a written file and its oracle are obviously a pair. DescriptorFile writes the source metamodel's descriptor from the same reflective walk Descriptor already performs, under metamodel/target/parity. Neither file is committed. The canonical JSON writer moves down to metamodel/, the lowest module that writes a canonical file, because the pipeline now writes what the parity suite used to serialise. The parity suites are otherwise untouched: this is the expand half of the move recorded in 0120, so a wrong output shape is caught here rather than after the suites depend on it. Closes #128.
The suite decides every case from the files a run leaves behind and the exit code beside them, so it holds no EMF type, calls nothing, and needs nothing from the target platform. The module becomes a plain jar: its META-INF/MANIFEST.MF and build.properties are gone, and it declares the test libraries the parent's bundle profile used to give it. Each case asserts its file exists before comparing it, so a file the run owes and did not write fails as a missing file rather than as a skipped case (0120). Two gates had to survive that change rather than quietly stop enforcing. ArchitectureTest saw the other modules only because the manifest required them; with no dependency left it reads their class directories by path instead. Because withOptionalLayers excuses an empty layer, EMF-010 and EMF-011 would then pass on an empty import while proving nothing, so EMF-017 fails when a module whose classes the build wrote is missing from the import. All three now fail on a fixture that breaks them, as 0104 requires, and the layered rule no longer names the parity layer as a permitted accessor. Also removes an em-dash the decision record carried, which test/emdash.test.ts refuses. Closes #129.
The listing now says which modules a course examiner opens. `bundles/` holds the five Tycho builds Eclipse imports; `tests/` holds the parity tier Maven alone runs, which by 0120 holds no EMF type and needs nothing from the target platform. The directory names stay short, since Eclipse names an imported project from its `artifactId` regardless (0121). Every document that names a module by its old path moves with it: the rule ledger, whose EMF-014 check fails the build the moment a row's named file is not where the row says, the witness list, this tree's architecture, two decision records, the refusal examples' README, the root architecture, and the two root tests that name a parity path in a comment and in a fixture string. `emf/README.md` gains the table that says which artefact lives where and which task grades it. Two things the move would have broken quietly. The module POMs now sit two directories below the parent, so each declares its `relativePath`, and `scripts/lint-codes.ts` matched `emf/<module>/src/test/` one segment deep, which would have stopped counting a Java test as exercising a code for the whole tree rather than only for the tier that moved. Closes #130.
…s on it `tests/parity` is written in the estate's JVM language, with the idiom its other repositories already use: JUnit 5, AssertJ, ArchUnit, and a test function named as a sentence in backticks. The bundle tier stays Java, because Ecore generates Java, Xtext's runtime hooks are Java, and a bundle compiles through JDT against a target platform holding no Kotlin unit (0121). The gates move with it. Spotless gains a ktlint step over `src/*/kotlin`, and EMF-018 is its ledger row. The Kotlin compiler runs with `-Werror`, which is EMF-006's rule in the compiler this tier uses. The coverage floor holds unchanged. The mutation threshold also stands at 100, which needed one thing rather than a decision to lower it: `kotlinc` emits a null check for every platform type crossing into Kotlin and a `closeFinally` for every `use`, and removing either call is an equivalent mutation, not an uncovered one, so pitest is told not to mutate calls to them. That is the same treatment `bundles/cli` already gives the one-off OCL language registration. The word that changes in 0114 is "Java", not the rule: a witness is a JUnit test in whichever language its module is written, so `Ledgers.checkWitnesses` now reads a `.kt` function and a `.java` method alike, three of the six witnesses name Kotlin functions and three name Java methods, and a new fixture proves a Java witness in a bundle is still found. The decision record, the witness list, EMF-013's row and the gates sentence say so. Closes #131.
Shape
CoverageBaseline:
This pull request changed no covered line. |
Contributor
Author
|
Superseded by #134. GitHub closed this pull request when its base branch, |
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 #127, closes #128, closes #129, closes #130, closes #131
Stacked on #126, which carries the two decision records this implements, so the base is that branch rather than
main. GitHub retargets it when #126 merges.What this branch does
emf/read as one flat list of six Eclipse bundles, and nothing in the listing said which of them a course examiner opens. The parity suite was the sharpest case: it reached past the pipeline's own interface intoPipeline,Parsed,DiagnosticandDescriptor, which is whyparity/pom.xmldeclaredeclipse-pluginpackaging while the architecture said a module needing no p2 bundle stays a plain jar. Four commits close that drift, in the order the two decisions take.intent.jsonordiagnostics.jsonbehind for every case underspec/v1/examples/, beside theexitcode it ended on, underbundles/cli/target/parityin a tree that mirrors the example tree, so a written file and its oracle are obviously a pair.bundles/metamodel/target/parityholdsdescriptor.json, from the same reflective walk as before. Neither is committed. The suites were left untouched here, so a wrong output shape failed in this commit rather than after they depended on it.jarpackaging, with itsMETA-INF/MANIFEST.MFandbuild.propertiesgone.bundles/is what Tycho builds and Eclipse imports;tests/is what Maven alone runs. Every document naming a module by its old path moved with it, andemf/README.mdgained the table that answers where an artefact lives and which task grades it.The decisions
The canonical JSON writer moved down to
bundles/metamodel. 0120 said the module would keepCanonicalJsonbesideLedgersin itssrc/main. It cannot: the pipeline now writes what the suite used to serialise, so the writer belongs to the lowest module that writes a canonical file. The record is amended to say so rather than left to drift, which is the thing it was written to stop.Two gates would have stopped enforcing silently.
ArchitectureTestsaw the other modules only because the manifest required them. With no dependency left it reads their class directories by path, and sincewithOptionalLayers(true)excuses an empty layer,EMF-010andEMF-011would otherwise have passed on an empty import while proving nothing.EMF-017is the new row that fails an import holding no module the build wrote. All three now fail on a fixture, as 0104 requires.The mutation threshold stands at 100. 0121 warned that PIT reports equivalent mutants on Kotlin, and it does: nine survivors, every one a
kotlinc-generatedIntrinsicsnull check or auseblock'scloseFinally. Neither is written here and neither is observable from a test, so pitest is told not to mutate calls to them, which is the treatmentbundles/clialready gives the one-off OCL language registration. No threshold was lowered, so no decision was owed.0114's word "Java" changed, not its rule. A witness is a JUnit test in whichever language its module is written. Three of the six are now Kotlin functions and three are Java methods of a bundle,
Ledgers.checkWitnessesreads a.ktfunction and a.javamethod alike, and a new fixture proves a Java witness in a bundle is still found.Gates
The rule ledger holds eighteen rules:
EMF-017for the import guard above, andEMF-018for the ktlint step Spotless now runs oversrc/*/kotlin. The Kotlin compiler runs with-Werror, which isEMF-006's rule in the compiler this tier uses. The coverage floor is unchanged.Verification
./mvnw -B -ntp clean verifyfromemf/, exit 0: seven modules green, 40 tests intests/parity, mutation 29 of 29 killed, the coverage floor held at 1.00.npm run verifyat the root, exit 0: 722 tests, coverage unchanged.emf/docs/adr/emf/0120carried an em-dash, whichtest/emdash.test.tsrefuses, so docs: decide the parity seam and the two tiers under emf/ #126 is red on that alone. Fixed here.Not yet proven
The Eclipse import path in
emf/README.mdfollows from Eclipse naming an imported project by itsartifactId, not from an import run against the moved tree. No examiner has opened it since the split.