Skip to content

Commit

Permalink
Preceding checkpointv2 relationship fix (#611)
Browse files Browse the repository at this point in the history
* Changed the relationship name used for preceding Checkpointv2 query

* API break: changed the CheckpointV2Query.precedingCheckpoint method name to CheckpointV2Query.precedingCheckpointV2
  • Loading branch information
austeja-bentley authored Jan 30, 2021
1 parent 845f3e7 commit c75575f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
4 changes: 2 additions & 2 deletions clients/imodelhub/src/imodelhub/CheckpointsV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ 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 {
this.filter(`PrecedingCheckpoint-backward-ChangeSet.Id+eq+'${targetChangeSetId}'`);
public precedingCheckpointV2(targetChangeSetId: string): this {
this.filter(`PrecedingCheckpointV2-backward-ChangeSet.Id+eq+'${targetChangeSetId}'`);
return this;
}

Expand Down
2 changes: 1 addition & 1 deletion common/api/imodelhub-client.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,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;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ 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"));
const checkpoints = await iModelClient.checkpointsV2.get(requestContext, imodelId, new CheckpointV2Query().precedingCheckpoint(changeSetId));
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().precedingCheckpointV2(changeSetId));
chai.assert(checkpoints);
chai.expect(checkpoints.length).to.be.equal(1);
chai.expect(checkpoints[0].changeSetId).to.be.equal(expectedPrecedingChangeSetId);
Expand Down

0 comments on commit c75575f

Please sign in to comment.