-
Notifications
You must be signed in to change notification settings - Fork 0
CXP-897 Incremental sync support #56
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
base: main
Are you sure you want to change the base?
Changes from all commits
7303c65
f435216
ca5195e
1d9c118
22c4e7f
5d31b34
f6fbc49
590e616
16f3b89
4a14d25
62b6858
1484ab6
a1835ef
ce795ff
a81b45f
f8ebc73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,6 +70,26 @@ var ( | |
| field.WithDescription("Workspaces to exclude from sync, identified by workspace name, deployment name, or numeric workspace ID. Mutually exclusive with workspaces."), | ||
| field.WithDisplayName("Exclude Workspaces"), | ||
| ) | ||
| EnableIncrementalSyncField = field.BoolField( | ||
| "enable-incremental-sync", | ||
| field.WithDescription("Poll a Databricks audit-log event feed between full syncs to pick up access changes early. Deletions are still only caught by the next full sync."), | ||
| field.WithDisplayName("Enable Incremental Sync"), | ||
| field.WithDefaultValue(false), | ||
| ) | ||
| SQLWarehouseIDField = field.StringField( | ||
| "sql-warehouse-id", | ||
| field.WithDescription("ID of the Databricks SQL warehouse used to query system.access.audit. Required when incremental sync is enabled."), | ||
| field.WithDisplayName("SQL Warehouse ID"), | ||
| ) | ||
| SQLWarehouseWorkspaceField = field.StringField( | ||
| "sql-warehouse-workspace", | ||
| field.WithDescription( | ||
| "Deployment name of the workspace that hosts the SQL warehouse (sql-warehouse-id), since SQL warehouses "+ | ||
| "only exist in one workspace. Required when incremental sync is enabled and more than one workspace "+ | ||
| "is available; if omitted with only one workspace available, that workspace is used automatically.", | ||
| ), | ||
| field.WithDisplayName("SQL Warehouse Workspace"), | ||
| ) | ||
| configFields = []field.SchemaField{ | ||
| AccountHostnameField, | ||
| AccountIdField, | ||
|
|
@@ -80,6 +100,9 @@ var ( | |
| WorkspaceTokensField, | ||
| BaseURLField, | ||
| ExcludeWorkspacesField, | ||
| EnableIncrementalSyncField, | ||
| SQLWarehouseIDField, | ||
| SQLWarehouseWorkspaceField, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: |
||
| } | ||
| ) | ||
|
|
||
|
|
@@ -101,15 +124,20 @@ var Config = field.NewConfiguration( | |
| Fields: []field.SchemaField{ | ||
| AccountIdField, DatabricksClientIdField, DatabricksClientSecretField, | ||
| HostnameField, AccountHostnameField, WorkspacesField, BaseURLField, ExcludeWorkspacesField, | ||
| EnableIncrementalSyncField, SQLWarehouseIDField, SQLWarehouseWorkspaceField, | ||
| }, | ||
| Default: true, | ||
| }, | ||
| { | ||
| Name: DatabricksWorkspaceTokenGroup, | ||
| DisplayName: "Workspace token", | ||
| HelpText: "Authenticate with a personal access token scoped to each workspace.", | ||
| Fields: []field.SchemaField{AccountIdField, WorkspacesField, WorkspaceTokensField, HostnameField, AccountHostnameField, BaseURLField, ExcludeWorkspacesField}, | ||
| Default: false, | ||
| // Incremental sync requires the Account API, which workspace tokens can't reach | ||
| // (see Validate) — omitted here so the UI doesn't offer an option that can never work. | ||
| Fields: []field.SchemaField{ | ||
| AccountIdField, WorkspacesField, WorkspaceTokensField, HostnameField, AccountHostnameField, BaseURLField, ExcludeWorkspacesField, | ||
| }, | ||
| Default: false, | ||
| }, | ||
| }), | ||
| ) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: also add
EnableIncrementalSyncFieldandSQLWarehouseIDFieldto every auth field group that supports incremental sync. They are inconfigFields(here) but missing from both groupFieldslists below, so the grouped schema does not associate them with a selectable auth mode and SDK validation skips them for that mode.Keep common feature fields in each applicable auth group. Pattern: https://github.com/ConductorOne/baton-azure-devops/blob/47b239de197e4c4c35da801e08c59ba6009f78e8/pkg/config/config.go#L215-L267