Repository navigation
ci: SPEC_GUARD lets a feature PR change the spec with its code - #119
Merged
Merged
Conversation
The guard let an entry join sharp/baseline/spec only in a PR that changed docs/spec.md, README.md and the list alone, and kept every example and every file in sharp/harness/, sharp/bin/, sharp/docker/ and .github/ unchanged in any PR that changed code. So a feature could never land its spec change, its checker and its engine in one PR. Both rules go. GUARDED shrinks to what measures the examples, sharp/bin/spec and sharp/harness/, which still change only in a PR of their own. The ratchet stays: the list names exactly the failing examples, and an example the base checked never joins it unchanged.
sharp/bin/spec changes only in a PR of its own, so its comments say what holds before and after Mago moves into the tree: sharp/bin/test provides the mago it runs.
…folder too Feature pull requests add harness classes, such as the Username struct the structs examples use, so GUARDED keeps only sharp/bin/spec, the code that measures an example. A pull request lists its harness changes, and its review checks that no stub makes an example pass falsely. The guard and COMPLETES run the base's sharp/bin/spec on the pull request. So this one learns to read sharp/baseline/spec as a folder of empty <section>/<id> files, and counts that folder's files as the list, before the pull request that turns the list into that folder.
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.
SPEC_GUARD stops one feature from landing as one pull request. This lets a feature PR change the spec, its examples,
sharp/baseline/spec, the harness, the checker and the engine together. It keeps the ratchet.What changes
sharp/baseline/speconly in a PR that changesdocs/spec.md,README.mdand the list alone.GUARDEDkeeps onlysharp/bin/spec. That file is the code that measures an example, so it still changes only in a PR of its own, beside Markdown.sharp/bin/,sharp/docker/and.github/leave the guard. So doessharp/harness/, because feature PRs add harness classes: the structs examples neededUsername.sharp.sharp/harness/lists it in its body. Its review checks that no stub makes an example pass falsely.docs/architecture/spec-examples.md,docs/how-we-work.mdandsharp/README.mdsay so.sharp/bin/specinLINUX.SPEC_GUARD.SPEC_GUARDandCOMPLETESrun the base'ssharp/bin/spec. So this script learns to readsharp/baseline/spec/<section>/<id>before the next PR,chore/spec-list-folder, turns the list into that folder. It also counts the folder's files as the list, not as "other files".chore/spec-list-folderconverts master's 113 entries to one empty file each. It also deletes the one-file reading this PR keeps.sharp/bin/specbeside a new file outside its list. So the folder can't arrive in this PR.Verification
php origin/master:sharp/bin/spec --base origin/masterprinted "0 entries join sharp/baseline/spec, 0 leave it."sharp/bin/spec --base origin/masterprinted "0 entries join sharp/baseline/spec, 0 leave it."chore/spec-list-folder(folder head, file base): it printed "0 entries join sharp/baseline/spec, 0 leave it."COMPLETESon the folder:BODY="Completes: §30"printed "§30 still has 1 entries in sharp/baseline/spec: tuples."php -l sharp/bin/spec: no syntax errors.