Repository navigation
refactor(exporters): read the typed benchmark section in the engine - #65
Merged
Merged
Conversation
The notice, matter, reference, plain text, Benchmark elements, Benchmark id template and profile generation read the StyleConfig's benchmark section; the exporter's and the engine's namespace reads take style.benchmark.namespaces. generate_profiles_from_rules takes Profiles and its mappings ProfileMapping. A plain text's content defaults to "" in the model (the engine's default before). The notice id "terms-of-use", written when a style gives no id or an empty one, stays the engine's and the guide now says so. A profile mapping with its own id is refused when the style loads, so the engine's check for it is gone; an empty match still loads and is still refused at export. Tests that changed benchmark dicts now load a style file or build the model; the source-text assertion on map_benchmark's loop is replaced by a test of what it writes. The 28 exports are byte-identical. Refs: cis-bench-fh9l.15 Signed-off-by: Aaron Lippold <lippold@gmail.com>
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.
The engine now builds everything that comes from the style's
benchmarksection from the typed model it holds (MappingConfig.style), not the dict.SourcedElement), Benchmark id template and profile generation read the model.generate_profiles_from_rulestakesProfilesandProfileMapping.MappingConfig.namespaces, which the exporter reads, now comes fromstyle.benchmark.namespaces. The engine's Dublin Core prefix lookup reads it too. No.get()on benchmark-section data is left insrc/cis_bench/exporters.contentdefaults to""in the model. The notice idterms-of-use, written when a style gives no id or an empty one, stays in the engine; the guide now says so.idis already refused when the style loads, so the engine's check for it is gone.map_benchmark's loop is replaced by a test of what it writes.Checks:
tests/scripts, mypy, ruff andmkdocs build --strictpass.nextand passcis-bench validate.Card: cis-bench-fh9l.15. The remaining sections and the removal of
MappingConfigare cis-bench-fh9l.9.