Repository navigation
Refactor/consolidate remaining identical duplicates - #569
Open
JieXiong9119 wants to merge 6 commits into
Open
JieXiong9119 wants to merge 6 commits into
JieXiong9119 wants to merge 6 commits into
Conversation
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.
Any background context you want to provide?
Issue #356 lists the duplicate element names that remained after the earlier "trivial" deduplication round (#323, #324, #325, PR #349, released in v2.4.0). At base
4f69954, 32 names were still on theignored_dupesexception list inspec/validation_spec.rb, with 177 named declarations between them.This PR covers only the duplicates whose declarations are identical, so they can be merged into one global element plus
refuses without changing what validates. Context-specific duplicates, which would need renames (breaking) or type widening (minor), are left for separate work.The proposal is included:
proposals/2026/Consolidate Remaining Identical Duplicate Elements.md.What does this PR do?
Classification: PATCH. No element is renamed or moved, no sequence is reordered, no type is widened or narrowed, and no content becomes required. Existing instance documents validate exactly as before, so no migration script is needed.
Schema changes in
BuildingSync.xsd:refCapacityauc:Capacity, unchanged. The 17 other uses were already refs.ControlSystemTypesref="auc:ControlSystemType"withminOccurs="0"andmaxOccurs="unbounded".ControlsControlof typeauc:ControlGeneralTypewithmaxOccurs="unbounded". The lightingControlsstays local because it usesControlLightingType.Otherauc:OtherType. The 5Otherdeclarations with their own inline content stay local.CBECSauc:CBECSType, which is unchanged.Controlis not made global because that name collides with gbXML.Impact:
ignored_dupes: removedCapacity,CBECSandControlSystemTypes. Nothing was added.Tests in
spec/validation_spec.rb:Capacity: all four contexts, valid and invalid cases.ControlSystemTypes: all three plant types.Controlsand lightingControls: what each accepts and rejects.Other: the empty global form and the five inline forms that stay local.CBECS: both contexts. Accepts an empty element and zones 1–5. Rejects zone 6, a repeatedClimateZone, and text content.Known downstream effect:
refthat points to a global element with a named complexType (schema#474, now BuildingSync-website#229).ClimateZoneunderCBECS. Validation is not affected.How should this be manually tested?
bundle exec rake: all examples validate. Expected result: 13 examples, 0 failures.bundle exec rake generate_data_dictionary: no name conflicts. Delete the generateddocs/DataDictionary.xlsxanddocs/enumerations.jsonafterwards.poetry run pre-commit run --all-files.4f69954and this branch, should have:minOccurs/maxOccurs;Othersites and bothCBECSsites had no documentation of their own, so they now show the global's text.What are the relevant tickets?
Screenshots (if appropriate)