From f71a498b0cbcbf9cdd7566be53be868137d06ee3 Mon Sep 17 00:00:00 2001 From: Austeja Kalpakovaite <70565417+austeja-bentley@users.noreply.github.com> Date: Wed, 20 Jan 2021 14:02:57 +0200 Subject: [PATCH 1/4] Changed the relationship name used for preceding Checkpointv2 query --- clients/imodelhub/src/imodelhub/CheckpointsV2.ts | 2 +- .../imodelhub-client/src/imodelhub/CheckpointV2.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/imodelhub/src/imodelhub/CheckpointsV2.ts b/clients/imodelhub/src/imodelhub/CheckpointsV2.ts index a704911cfe15..733b3e0d1660 100644 --- a/clients/imodelhub/src/imodelhub/CheckpointsV2.ts +++ b/clients/imodelhub/src/imodelhub/CheckpointsV2.ts @@ -116,7 +116,7 @@ export class CheckpointV2Query extends WsgQuery { * @returns This query. */ public precedingCheckpoint(targetChangeSetId: string): this { - this.filter(`PrecedingCheckpoint-backward-ChangeSet.Id+eq+'${targetChangeSetId}'`); + this.filter(`PrecedingCheckpointV2-backward-ChangeSet.Id+eq+'${targetChangeSetId}'`); return this; } diff --git a/full-stack-tests/imodelhub-client/src/imodelhub/CheckpointV2.test.ts b/full-stack-tests/imodelhub-client/src/imodelhub/CheckpointV2.test.ts index c66f54050e03..0178e613a4dc 100644 --- a/full-stack-tests/imodelhub-client/src/imodelhub/CheckpointV2.test.ts +++ b/full-stack-tests/imodelhub-client/src/imodelhub/CheckpointV2.test.ts @@ -179,7 +179,7 @@ describe("iModelHub CheckpointV2Handler", () => { }); async function verifyPrecedingCheckpointV2(changeSetId: string, expectedPrecedingChangeSetId: string) { - mockGetCheckpointV2(imodelId, `?$filter=PrecedingCheckpoint-backward-ChangeSet.Id+eq+%27${changeSetId}%27`, mockCheckpointV2(expectedPrecedingChangeSetId, CheckpointV2State.Successful, "1")); + mockGetCheckpointV2(imodelId, `?$filter=PrecedingCheckpointV2-backward-ChangeSet.Id+eq+%27${changeSetId}%27`, mockCheckpointV2(expectedPrecedingChangeSetId, CheckpointV2State.Successful, "1")); const checkpoints = await iModelClient.checkpointsV2.get(requestContext, imodelId, new CheckpointV2Query().precedingCheckpoint(changeSetId)); chai.assert(checkpoints); chai.expect(checkpoints.length).to.be.equal(1); From df15277ea9332550456a778c2fa3a24e4a58e11d Mon Sep 17 00:00:00 2001 From: Austeja Kalpakovaite <70565417+austeja-bentley@users.noreply.github.com> Date: Wed, 20 Jan 2021 14:06:17 +0200 Subject: [PATCH 2/4] Rush change --- ...heckpointv2-relationship-fix_2021-01-20-12-06.json | 11 +++++++++++ ...heckpointv2-relationship-fix_2021-01-20-12-06.json | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 common/changes/@bentley/imodelhub-client-tests/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json create mode 100644 common/changes/@bentley/imodelhub-client/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json diff --git a/common/changes/@bentley/imodelhub-client-tests/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json b/common/changes/@bentley/imodelhub-client-tests/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json new file mode 100644 index 000000000000..b856db696ca0 --- /dev/null +++ b/common/changes/@bentley/imodelhub-client-tests/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@bentley/imodelhub-client-tests", + "comment": "Test fixes to setup mock with the new PrecedingCheckpointV2 relationship", + "type": "none" + } + ], + "packageName": "@bentley/imodelhub-client-tests", + "email": "70565417+austeja-bentley@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@bentley/imodelhub-client/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json b/common/changes/@bentley/imodelhub-client/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json new file mode 100644 index 000000000000..77edf4b5aff3 --- /dev/null +++ b/common/changes/@bentley/imodelhub-client/preceding-checkpointv2-relationship-fix_2021-01-20-12-06.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@bentley/imodelhub-client", + "comment": "PrecedingCheckpointv2 usage in CheckpointV2Handler", + "type": "none" + } + ], + "packageName": "@bentley/imodelhub-client", + "email": "70565417+austeja-bentley@users.noreply.github.com" +} \ No newline at end of file From cf8774ac9239a7e7b230de95d831f65ec584a00c Mon Sep 17 00:00:00 2001 From: Austeja Kalpakovaite <70565417+austeja-bentley@users.noreply.github.com> Date: Wed, 20 Jan 2021 14:27:49 +0200 Subject: [PATCH 3/4] API break: changed the CheckpointV2Query.precedingCheckpoint method name to CheckpointV2Query.precedingCheckpointV2 --- clients/imodelhub/src/imodelhub/CheckpointsV2.ts | 2 +- .../imodelhub-client/src/imodelhub/CheckpointV2.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/imodelhub/src/imodelhub/CheckpointsV2.ts b/clients/imodelhub/src/imodelhub/CheckpointsV2.ts index 733b3e0d1660..2e9ae18d12e5 100644 --- a/clients/imodelhub/src/imodelhub/CheckpointsV2.ts +++ b/clients/imodelhub/src/imodelhub/CheckpointsV2.ts @@ -115,7 +115,7 @@ export class CheckpointV2Query extends WsgQuery { * This query returns a closest CheckpointV2 that will reach target ChangeSet by only merging forward. This resets all previously set filters. * @returns This query. */ - public precedingCheckpoint(targetChangeSetId: string): this { + public precedingCheckpointV2(targetChangeSetId: string): this { this.filter(`PrecedingCheckpointV2-backward-ChangeSet.Id+eq+'${targetChangeSetId}'`); return this; } diff --git a/full-stack-tests/imodelhub-client/src/imodelhub/CheckpointV2.test.ts b/full-stack-tests/imodelhub-client/src/imodelhub/CheckpointV2.test.ts index 0178e613a4dc..a7d652224a3e 100644 --- a/full-stack-tests/imodelhub-client/src/imodelhub/CheckpointV2.test.ts +++ b/full-stack-tests/imodelhub-client/src/imodelhub/CheckpointV2.test.ts @@ -180,7 +180,7 @@ describe("iModelHub CheckpointV2Handler", () => { async function verifyPrecedingCheckpointV2(changeSetId: string, expectedPrecedingChangeSetId: string) { mockGetCheckpointV2(imodelId, `?$filter=PrecedingCheckpointV2-backward-ChangeSet.Id+eq+%27${changeSetId}%27`, mockCheckpointV2(expectedPrecedingChangeSetId, CheckpointV2State.Successful, "1")); - const checkpoints = await iModelClient.checkpointsV2.get(requestContext, imodelId, new CheckpointV2Query().precedingCheckpoint(changeSetId)); + const checkpoints = await iModelClient.checkpointsV2.get(requestContext, imodelId, new CheckpointV2Query().precedingCheckpointV2(changeSetId)); chai.assert(checkpoints); chai.expect(checkpoints.length).to.be.equal(1); chai.expect(checkpoints[0].changeSetId).to.be.equal(expectedPrecedingChangeSetId); From 43538b1d55e4753522c47614d64a28c0676fcf9f Mon Sep 17 00:00:00 2001 From: Austeja Kalpakovaite <70565417+austeja-bentley@users.noreply.github.com> Date: Wed, 27 Jan 2021 17:31:42 +0200 Subject: [PATCH 4/4] API update --- common/api/imodelhub-client.api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/api/imodelhub-client.api.md b/common/api/imodelhub-client.api.md index 14f2b0f937ba..8a4e1db0d451 100644 --- a/common/api/imodelhub-client.api.md +++ b/common/api/imodelhub-client.api.md @@ -319,7 +319,7 @@ export class CheckpointV2Handler { export class CheckpointV2Query extends WsgQuery { byChangeSetId(changeSetId: string): this; byState(state: CheckpointV2State): this; - precedingCheckpoint(targetChangeSetId: string): this; + precedingCheckpointV2(targetChangeSetId: string): this; selectContainerAccessKey(): this; selectFailureInfo(): this; }