fix(ci-compliance): exclude the versioning test sets from the dataset pathspec - #20
Merged
Merged
Conversation
… pathspec The dataset compliance check asserts that every file it selects deserialises into a BH.oM.Data.Library.Dataset. Versioning_Toolkit's versioning test sets match the selector but are JSON Lines of oM objects, so all 80 fail by design. Measured: DatasetComplianceRunner built from develop exits 1 on .ci/code/Versioning_Test/Datasets/9.2/Objects.json and 0 on a real library dataset in the same environment. Adds the exclusion to both tier-bundle templates and pins it in the changed-file-patterns suite, which goes from 75 to 83 assertions. The suite also pins the project-directory case as still selected, because the selector is substring-based rather than dataset-aware and this exclusion covers one directory layout rather than a class of file. Refs BHoM/internal-tickets#36
sakanni
added a commit
that referenced
this pull request
Sep 9, 2026
…taset pathspec Follow-up to #20. That exclusion was path-based and covered one directory layout. Versioning_<digits>.json are versioning upgrade maps holding {"Dataset":{"ToNew":..,"ToOld":..}}, read by BHoM_Engine Versioning_Engine/Query/DatasetToNewPaths.cs. They carry no _t, can never be BH.oM.Data.Library.Dataset documents, and sit at a project root in any repo, so a path-scoped rule cannot reach them. Add ':(exclude,glob,icase)**/Versioning_[0-9]*.json' to both tier-bundle templates. Each element is required and is pinned by an assertion: :(glob) keeps the token a filename match rather than a path-substring match, the ** anchor keeps it depth-agnostic, and the [0-9] gate keeps a genuine dataset named Versioning_Rules.json in scope. Flip the two characterisation assertions #20 left as assert_matches, which its own comment recorded as the intended outcome of a widening. Add five fixtures covering the depth-2 case, a real dataset inside a Versioning_<digits> directory, a real dataset under a Versioning_Engine project, and one path that the base selector never reaches. Refine the structural invariant to permit ** only under :(glob). Defect 3 is a property of git's default matcher, where '**' is not special; :(glob) switches on WM_PATHNAME and there '**/' matches zero or more leading components. The invariant previously rejected the only correct way to write a basename match. It still fails ** without :(glob). Suite 83 to 92 assertions. Fleet measurement over 309 repositories on their default branches: no repository loses a file, because no upgrade map currently sits in a selected path on a default branch. Refs BHoM/internal-tickets#36, BHoM/internal-tickets#43.
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.
ci-dataset-complianceasserts that every file it selects deserialises into aBH.oM.Data.Library.Dataset. Versioning_Toolkit's versioning test sets match the selector but are JSON Lines of oM objects, so all 80 fail by design.Measured rather than inferred:
DatasetComplianceRunnerbuilt fromdevelopexits 1 on.ci/code/Versioning_Test/Datasets/9.2/Objects.jsonwithDataset file did not deserialise into a BH.oM.Data.Library.Dataset object successfully, and exits 0 on a real library dataset in the same environment.The change
Both tier-bundle templates gain one exclusion token:
compute-changed-filessplitspatternswithread -raand passes the tokens togit diffas pathspecs (action.yml:123and:125), so git exclusion syntax works, and the token contains no spaces.Loss check
git ls-filesagainst real checkouts, except the last row:Nothing legitimate is lost. BHoM_Engine's 208 under
.ci/Datasets/**are genuineDatasetdocuments; spot-checked.ci/Datasets/BHoM_Engine/Modify/RemoveAndSplitAtIndexes.json. The BuroHappold_Datasets row was measured from the git tree at a branch head rather than a checkout, and is a no-op there: that repo holds no path containingVersioning_Test/Datasets/.Test coverage
The suite goes from 75 to 83 assertions and passes.
extract_check_patternsreadspatterns:straight out of the shipped YAML, so the new two-token value is picked up without being restated, andmatched()mirrors the action's ownread -raplusgit diffinvocation.Control run: reverting the pathspec alone fails exactly the two new
assert_not_matchesand nothing else, so those assertions test the exclusion rather than passing vacuously.Two fixtures per case, not one:
9.2/Objects.jsonis the file the versioning dataset work edits, and9.1/Methods.jsonproves the exclusion is version- and filename-agnostic rather than accidentally passing on one path.The fixture also pins the project-directory case as still selected. The selector is substring-based, not dataset-aware: without
:(glob)a*crosses/, so the substring can come from a filename, a data directory, or a project directory named*_Datasets. This exclusion covers one directory layout and deliberately not that case, which is live and failing today in a*_Datasetsrepo. Asserting it positively means a later re-anchoring has to flip a visible assertion instead of changing fleet-wide scope silently. Tracked in BHoM/internal-tickets#43.What this does not do
Per BHoM/internal-tickets#39, onboarded repos hold their own copy of
ci-beta.ymlwith the pathspec inline and nothing propagates a template change. This fixes no repository. It stops the old pathspec reaching future onboardings. The edit that unblocks the versioning dataset work is the same one-line change to Versioning_Toolkit's own workflow file, and that is a separate PR.Refs BHoM/internal-tickets#36.