Skip to content

Add CI check for examples using deprecated elements - #568

Merged
kflemin merged 5 commits into
develop-v2from
feat/CI-check-on-deprecated-elements-in-examples
Nov 6, 2026
Merged

kflemin merged 5 commits into
develop-v2from
feat/CI-check-on-deprecated-elements-in-examples

Conversation

@JieXiong9119

@JieXiong9119 JieXiong9119 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Any background context you want to provide?

Several elements and enumerations in BuildingSync.xsd are marked WARNING: ... being deprecated in their xs:documentation, but some example files still use them. Implementers use the examples as their main reference, so we should be able to see where the examples still model deprecated usage. Until now, CI (spec/validation_spec.rb) checked only XSD validity, tabs, XMLSpy content, complexContent, and name collisions.

Decisions for this PR:

  • Examples are not changed. Some of them come from external tools (for example, the Audit Template exports), so updating them is left for a separate decision.
  • The check only warns. It never fails the build.

What does this PR do?

Adds the RSpec check No deprecated elements in examples to spec/validation_spec.rb:

  • Detection: the deprecated list is built from the XSD itself. It includes every xs:element and xs:enumeration whose xs:documentation matches /deprecat/i, so newly deprecated items are picked up without editing the spec.
    • Element deprecated on a local element or on a ref: flagged only under that parent (for example, CoolingSource/Capacity).
    • Global element deprecated: flagged under every parent that uses it, except the replacement path named in the documentation. For example, Site/WeatherDataStationID is flagged, but WeatherStations/WeatherStation/WeatherDataStationID is not.
    • Deprecated enumeration value: flagged on its element (for example, TimeSeriesReadingQuantity=Currency).
  • Reporting (warning only):
    • The check prints WARNING: Deprecated usages found in examples: to stderr, with the file, usage, count, and line numbers for each finding.
    • In GitHub Actions, it also appends a Markdown table (Example | Deprecated usage | Count | Lines) to the job summary (GITHUB_STEP_SUMMARY).

No schema or example changes.

Current findings:

Example Deprecated usage Count
ASHRAE 211 Export.xml TimeSeriesReadingQuantity=Currency 55
AT_example_AS_conversion_audit_report.xml Boiler/OutputCapacity, HeatingSource/OutputCapacity 1, 2
AT_example_NYC_audit_report_property.xml Boiler/OutputCapacity, HeatingSource/OutputCapacity 1, 2
AT_example_SF_audit_report.xml Boiler/OutputCapacity, HeatingSource/OutputCapacity 1, 1
BuildingEQ-1.0.0.xml HeatingSource/OutputCapacity 1
BuildingSync Website Valid Schema.xml Site/WeatherDataStationID, Site/WeatherStationName 1, 1
Reference Building - Primary School.xml Site/WeatherDataStationID, Site/WeatherStationName, Boiler/OutputCapacity 1, 1, 1
Single_building_gbxml_externalreference_geometry.xml Site/WeatherDataStationID, Site/WeatherStationName, Boiler/OutputCapacity 1, 1, 1

How should this be manually tested?

  1. Run bundle exec rake. Expect 7 examples, 0 failures, and the warning list printed in the output.
  2. To preview the job summary locally, run the following PowerShell, then open tmp/summary.md:
    $env:GITHUB_STEP_SUMMARY = "$PWD/tmp/summary.md"; bundle exec rake
  3. On this PR's CI run, open the run's Summary page and confirm the table is shown.

What are the relevant tickets?

Closes #560

Screenshots (if appropriate)

image

@JieXiong9119 JieXiong9119 self-assigned this Oct 28, 2026
@JieXiong9119 JieXiong9119 added Non-breaking Change feature Adding new functionality to BuildingSync Schema: No Changes No updates to the BuildingSync Schema labels Oct 28, 2026
@JieXiong9119
JieXiong9119 requested a review from kflemin October 28, 2026 19:37
@kflemin
kflemin merged commit 74cce36 into develop-v2 Nov 6, 2026
6 checks passed
@kflemin
kflemin deleted the feat/CI-check-on-deprecated-elements-in-examples branch November 6, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Adding new functionality to BuildingSync Non-breaking Change Schema: No Changes No updates to the BuildingSync Schema

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CI check that example files don't use deprecated elements

2 participants