Skip to content
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

Consider enforcing that the imodels passed to the BranchProvenanceInitializer are identical #138

Open
nick4598 opened this issue Jan 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@nick4598
Copy link
Collaborator

nick4598 commented Jan 9, 2024

initializeBranchProvenance function in BranchProvenanceInitializer.ts takes in ProvenanceInitArgs which contains a
master and branch property of type IModelDb. Currently initializeBranchProvenance assumes that master and branch are identical, but that is not enforced.

How we could enforce it:
Compare the hash of each element in the branch to the hash of the same element (with the same id) in master. Fail if not equal.

SELECT ECInstanceId
FROM bis.Element branchElem
JOIN master.bis.Element masterElem
WHERE sha3(branchElem.$) != sha3(masterElem.$)
LIMIT 1

We can repeat the above for relationships (bis.ElementRefersToElement) and aspects (bis.ElementMultiAspect, bis.ElementUniqueAspect).

The above seems sufficient, but we could also, in addition, compare the sha1 checksum of ec schemas, ec maps and db schemas.

PRAGMA checksum(ecdb_schema);

Concerns

Performance implications? How long will this take?

@nick4598 nick4598 added the enhancement New feature or request label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant