Skip to content

Commit

Permalink
Add changeset conflict handler to IModelDb (backport #6437) [release/…
Browse files Browse the repository at this point in the history
…4.4.x] (#6546)

Co-authored-by: affank <[email protected]>
Co-authored-by: Nick Tessier <[email protected]>
  • Loading branch information
3 people authored Mar 27, 2024
1 parent c01210c commit 8236cb3
Show file tree
Hide file tree
Showing 21 changed files with 794 additions and 183 deletions.
22 changes: 22 additions & 0 deletions common/api/core-backend.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ import { Constructor } from '@itwin/core-bentley';
import { CreateEmptySnapshotIModelProps } from '@itwin/core-common';
import { CreateEmptyStandaloneIModelProps } from '@itwin/core-common';
import { CreateSnapshotIModelProps } from '@itwin/core-common';
import { DbConflictCause } from '@itwin/core-bentley';
import { DbOpcode } from '@itwin/core-bentley';
import { DbResult } from '@itwin/core-bentley';
import { DefinitionElementProps } from '@itwin/core-common';
import { DisplayStyle3dProps } from '@itwin/core-common';
Expand Down Expand Up @@ -685,6 +687,26 @@ export interface ChangesetArg extends IModelIdArg {
readonly changeset: ChangesetIndexOrId;
}

// @internal (undocumented)
export interface ChangesetConflictArgs {
// (undocumented)
cause: DbConflictCause;
// (undocumented)
changesetFile?: string;
// (undocumented)
dump: () => void;
// (undocumented)
getForeignKeyConflicts: () => number;
// (undocumented)
indirect: boolean;
// (undocumented)
opcode: DbOpcode;
// (undocumented)
setLastError: (message: string) => void;
// (undocumented)
tableName: string;
}

// @beta
export class ChangesetECAdaptor implements IDisposable {
constructor(reader: SqliteChangesetReader, disableMetaData?: boolean);
Expand Down
21 changes: 21 additions & 0 deletions common/api/core-bentley.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,27 @@ export type ComputePriorityFunction<T> = (value: T) => number;
// @public
export type Constructor<T> = new (...args: any[]) => T;

// @internal
export enum DbConflictCause {
// (undocumented)
Conflict = 3,
// (undocumented)
Constraint = 4,
// (undocumented)
Data = 1,
// (undocumented)
ForeignKey = 5,
// (undocumented)
NotFound = 2
}

// @internal
export enum DbConflictResolution {
Abort = 2,
Replace = 1,
Skip = 0
}

// @public
export enum DbOpcode {
Delete = 9,
Expand Down
1 change: 1 addition & 0 deletions common/api/summary/core-backend.exports.csv
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ beta;ChangeFormatArgs
beta;ChangeInstanceKey
beta;ChangeMetaData
public;ChangesetArg
internal;ChangesetConflictArgs
beta;ChangesetECAdaptor
internal;ChangesetIndexArg
public;ChangesetRangeArg
Expand Down
2 changes: 2 additions & 0 deletions common/api/summary/core-bentley.exports.csv
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public;CompressedId64Set = string
public;CompressedId64Set
public;ComputePriorityFunction
public;Constructor
internal;DbConflictCause
internal;DbConflictResolution
public;DbOpcode
public;DbResult
public;Dictionary
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-backend",
"comment": "",
"type": "none"
}
],
"packageName": "@itwin/core-backend"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-bentley",
"comment": "",
"type": "none"
}
],
"packageName": "@itwin/core-bentley"
}
2 changes: 1 addition & 1 deletion common/config/azure-pipelines/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
- checkout: self
- template: ./templates/core-build.yaml
parameters:
nodeVersion: 20.x
nodeVersion: 20.11.1
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
steps:
- template: templates/integration-test-steps.yaml
parameters:
nodeVersion: 20.x
nodeVersion: 20.11.1
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
steps:
- template: templates/integration-test-steps.yaml
parameters:
nodeVersion: 20.x
nodeVersion: 20.11.1
6 changes: 3 additions & 3 deletions common/config/azure-pipelines/integration-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ jobs:
nodeVersion: 18.x
Linux_node_20_x:
imageName: ubuntu-latest
nodeVersion: 20.x
nodeVersion: 20.11.1
Windows_node_20_x:
imageName: windows-latest
nodeVersion: 20.x
nodeVersion: 20.11.1
MacOS_node_20_x:
imageName: macos-latest
nodeVersion: 20.x
nodeVersion: 20.11.1
pool:
vmImage: $(imageName)
steps:
Expand Down
11 changes: 5 additions & 6 deletions common/config/azure-pipelines/jobs/fast-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ variables:
- name: shouldWriteToCache
value: ${{ and(eq(variables['Agent.OS'], 'Linux'), in(variables['Build.Reason'], 'IndividualCI', 'Manual')) }}
- name: win_pool
value: 'iModelTechCI'
value: "iModelTechCI"
- name: linux_pool
value: 'iModeljs Linux'
value: "iModeljs Linux"
- name: mac_pool
value: 'iModelTechMacArm'

value: "iModelTechMacArm"

pr:
autoCancel: true
Expand Down Expand Up @@ -63,11 +62,11 @@ jobs:
clean: true
- template: ../templates/core-build.yaml
parameters:
nodeVersion: 20.x
nodeVersion: 20.11.1
buildMobile: true
# Will run if even there is a failure somewhere else in the pipeline.
- template: ../templates/publish-test-results.yaml
parameters:
nodeVersion: 20.x
nodeVersion: 20.11.1
# The publish script identifies any new packages not previously published and tags the build
- template: ../templates/publish.yaml
Loading

0 comments on commit 8236cb3

Please sign in to comment.