-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor/remove duplicates #349
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, ~2k lines less! That's awesome.
Because this was so much I wasn't really able to meticulously look at every change.
To convince myself (and others) that this is a non-breaking change, ie that we only refactored the elements into shared elements for reference, I generated multiple v2.3.0 files using oxygenxml. Below is the workflow I used:
- Download v2.3.0 xsd from releases page.
- Use the
Generate Sample XML Files
Tool in OxygenXML. See the config below. I've also attached a zip file of these generated buildingsync files. The important configuration settings are "generate optional elements" and "attributes" are both enabled, with a "preferred number of repetitions" of 2, so we are guaranteed all optional elements. In addition I set the "discard optional elements after nested level" to 100, so I don't think we'd be dropping any optional elements that deep.
bsync_examples.zip
from pathlib import Path
import xmlschema
instances = (Path.home() / 'Downloads/bsync_examples').rglob('*.xml')
schema_path = 'BuildingSync.xsd'
schema = xmlschema.XMLSchema(str(schema_path))
for i, instance in enumerate(instances):
print(f'Validating {instance}')
try:
xmlschema.validate(str(instance))
except Exception as e:
print(f'FAILED {instance}')
raise e
I feel 99% confident this is a non-breaking change. In the future it might help to break these changes into separate PRs.
Can you resolve the conflict por favor? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. Thanks Ted for the comprehensive non-breaking change check.
This is going to be a doozy to merge into develop-v3, I expect.
Also, can one of you confirm that Selection Tool is still happy parsing this schema?
Resolved! The only issue was with the list of duplicates in the validator so I don't believe there needs to be any additional testing. |
@Ryoken Looks like some ones we removed snuck back in there, could you remove those again? (left is diff after original spec update, right is diff after post-merge) |
I just ran it through the Selection Tool again, added it as a new schema and validated a few sample XMLs with it. |
You're right, it looks like a recent merge added a couple new duplicates. I pulled those out and updated the PR! |
Should we bring this to |
@JieXiong9119 yes, can you open that PR? Not sure how messy that'll be, happy to help if it gets weird |
Any background context you want to provide?
There are duplicate elements that need to be removed.
What does this PR do?
Consolidates all duplicate elements.
How should this be manually tested?
bundle exec rake
should passWhat are the relevant tickets?
#323
#324
#325
Screenshots (if appropriate)