Skip to content

Commit

Permalink
Read changesets directly instead of applying them to determine whats …
Browse files Browse the repository at this point in the history
…changed (#135)

Keeping the PR as draft at the moment, because waiting on a change from
Affan to the changesetECAdaptor to not error out when there is no
ECClassId and instead fall back to the ecclassid of the root class.

The above scenario occurs when the element is no longer present in the
database (because it was deleted in some future changeset that isn't
currently being processed) so it can't be queried for its ecclassid.

EDIT: In 4.3.3 there is a different issue with classIdPresentInChange.
See below PR
iTwin/itwinjs-core#6341

---------

Co-authored-by: Michael Belousov <mike.belousov@bentley.com>
  • Loading branch information
nick4598 and MichaelBelousov authored Jan 12, 2024
1 parent 25b9b99 commit 799afea
Show file tree
Hide file tree
Showing 17 changed files with 900 additions and 691 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
"typedoc-plugin-merge-modules": "^4.0.1",
"typescript": "^5.0.2",
"@typescript-eslint/eslint-plugin": "^5.59.7"
},
"patchedDependencies": {
"@itwin/core-backend@4.3.3": "patches/@itwin__core-backend@4.3.3.patch"
}
}
}
4 changes: 2 additions & 2 deletions packages/performance-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"author": "Bentley Systems, Inc.",
"license": "MIT",
"devDependencies": {
"@itwin/build-tools": "^3.6.0 || ^4.0.0",
"@itwin/core-backend": "^3.6.0 || ^4.0.0",
"@itwin/build-tools": "4.3.3",
"@itwin/core-backend": "4.3.3",
"@types/node": "^18.11.5",
"typescript": "~4.4.0"
}
Expand Down
14 changes: 7 additions & 7 deletions packages/performance-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
},
"repository": {},
"dependencies": {
"@itwin/core-backend": "^3.6.0 || ^4.0.0",
"@itwin/core-bentley": "^3.6.0 || ^4.0.0",
"@itwin/core-common": "^3.6.0 || ^4.0.0",
"@itwin/core-geometry": "^3.6.0 || ^4.0.0",
"@itwin/core-quantity": "^3.6.0 || ^4.0.0",
"@itwin/core-backend": "4.3.3",
"@itwin/core-bentley": "4.3.3",
"@itwin/core-common": "4.3.3",
"@itwin/core-geometry": "4.3.3",
"@itwin/core-quantity": "4.3.3",
"@itwin/imodel-transformer": "workspace:*",
"@itwin/ecschema-metadata": "^3.6.0 || ^4.0.0",
"@itwin/ecschema-metadata": "4.3.3",
"@itwin/imodels-access-backend": "^2.2.1",
"@itwin/imodels-client-authoring": "2.3.0",
"@itwin/node-cli-authorization": "~0.9.0",
Expand All @@ -31,7 +31,7 @@
"yargs": "^16.0.0"
},
"devDependencies": {
"@itwin/build-tools": "^3.6.0 || ^4.0.0",
"@itwin/build-tools": "4.3.3",
"@itwin/eslint-plugin": "^3.6.0 || ^4.0.0",
"@itwin/oidc-signin-tool": "^3.4.1",
"@itwin/projects-client": "^0.6.0",
Expand Down
6 changes: 5 additions & 1 deletion packages/performance-tests/test/iModelUtils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import * as fs from "fs";
import * as path from "path";
import { ElementGroupsMembers, IModelDb, IModelHost, PhysicalModel, PhysicalObject, SpatialCategory, StandaloneDb } from "@itwin/core-backend";
Expand Down Expand Up @@ -27,7 +31,7 @@ export function setToStandalone(iModelPath: string) {
nativeDb.resetBriefcaseId(BriefcaseIdValue.Unassigned); // standalone iModels should always have BriefcaseId unassigned
nativeDb.saveLocalValue("StandaloneEdit", JSON.stringify({ txns: true }));
nativeDb.saveChanges(); // save change to briefcaseId
nativeDb.closeIModel();
nativeDb.closeFile();
}

export function generateTestIModel(iModelParam: IModelParams): TestIModel {
Expand Down
8 changes: 4 additions & 4 deletions packages/test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
},
"repository": {},
"dependencies": {
"@itwin/core-backend": "^3.6.0 || ^4.0.0",
"@itwin/core-bentley": "^3.6.0 || ^4.0.0",
"@itwin/core-common": "^3.6.0 || ^4.0.0",
"@itwin/core-geometry": "^3.6.0 || ^4.0.0",
"@itwin/core-backend": "4.3.3",
"@itwin/core-bentley": "4.3.3",
"@itwin/core-common": "4.3.3",
"@itwin/core-geometry": "4.3.3",
"@itwin/imodels-access-backend": "^2.2.1",
"@itwin/imodels-client-authoring": "2.3.0",
"@itwin/node-cli-authorization": "~0.9.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/test-app/src/Main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ void (async () => {
nativeDb.resetBriefcaseId(BriefcaseIdValue.Unassigned); // standalone iModels should always have BriefcaseId unassigned
nativeDb.saveLocalValue("StandaloneEdit", JSON.stringify({ txns: true }));
nativeDb.saveChanges(); // save change to briefcaseId
nativeDb.closeIModel();
nativeDb.closeFile();
}
targetDb.close();
setToStandalone(args.targetStandaloneDestination);
Expand Down
26 changes: 13 additions & 13 deletions packages/transformer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"lint:no-tests": "eslint -f visualstudio --quiet \"./src/*.ts\" 1>&2",
"lint:fix": "eslint --fix -f visualstudio --quiet \"./src/**/*.ts\" 1>&2",
"lint:with-warnings": "eslint -f visualstudio \"./src/**/*.ts\" 1>&2",
"test": "mocha \"lib/cjs/test/**/*.test.js\" --timeout 8000 --require source-map-support/register",
"test": "mocha \"lib/cjs/test/**/*.test.js\" --timeout 8000 --reporter-option maxDiffSize=0 --require source-map-support/register",
"no-internal-report": "no-internal-report src/**/*.ts"
},
"repository": {
Expand Down Expand Up @@ -53,25 +53,25 @@
"You can find a script to see the latest @itwin/imodel-transformer version for your iTwin.js version in the README"
],
"peerDependencies": {
"@itwin/core-backend": "^3.6.0 || ^4.0.0",
"@itwin/core-bentley": "^3.6.0 || ^4.0.0",
"@itwin/core-common": "^3.6.0 || ^4.0.0",
"@itwin/core-geometry": "^3.6.0 || ^4.0.0",
"@itwin/core-quantity": "^3.6.0 || ^4.0.0",
"@itwin/ecschema-metadata": "^3.6.0 || ^4.0.0"
"@itwin/core-backend": "^4.3.3",
"@itwin/core-bentley": "^4.3.3",
"@itwin/core-common": "^4.3.3",
"@itwin/core-geometry": "^4.3.3",
"@itwin/core-quantity": "^4.3.3",
"@itwin/ecschema-metadata": "^4.3.3"
},
"//devDependencies": [
"NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install",
"NOTE: All tools used by scripts in this package must be listed as devDependencies"
],
"devDependencies": {
"@itwin/build-tools": "4.0.0-dev.86",
"@itwin/core-backend": "^3.6.0 || ^4.0.0",
"@itwin/core-bentley": "^3.6.0 || ^4.0.0",
"@itwin/core-common": "^3.6.0 || ^4.0.0",
"@itwin/core-geometry": "^3.6.0 || ^4.0.0",
"@itwin/core-quantity": "^3.6.0 || ^4.0.0",
"@itwin/ecschema-metadata": "^3.6.0 || ^4.0.0",
"@itwin/core-backend": "^4.3.3",
"@itwin/core-bentley": "^4.3.3",
"@itwin/core-common": "^4.3.3",
"@itwin/core-geometry": "^4.3.3",
"@itwin/core-quantity": "^4.3.3",
"@itwin/ecschema-metadata": "^4.3.3",
"@itwin/eslint-plugin": "^3.6.0 || ^4.0.0",
"@types/chai": "4.3.1",
"@types/chai-as-promised": "^7.1.5",
Expand Down
Loading

0 comments on commit 799afea

Please sign in to comment.