Skip to content

Commit 3493eb1

Browse files
feat(core): add lineage.enabled to WorkflowSettings and ProjectConfig
Introduces `LineageSettings { bool enabled }` and threads it through `WorkflowSettings` (yaml opt-in) into `ProjectConfig` (compiled graph) so downstream Dataform runners can decide whether to emit OpenLineage events to Knowledge Catalog (datalineage.googleapis.com) after each action completes. Config plumbing only — no emission logic is added in this change. Consumers (Dataform CLI runner, Dataform Backend) read this field in follow-up work.
1 parent f3335b2 commit 3493eb1

5 files changed

Lines changed: 51 additions & 0 deletions

File tree

core/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ ts_test_suite(
8181
"jit_context_test.ts",
8282
"main_test.ts",
8383
"utils_test.ts",
84+
"workflow_settings_test.ts",
8485
],
8586
data = [
8687
":node_modules",

core/workflow_settings.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ export function workflowSettingsAsProjectConfig(
178178
if (workflowSettings.preserveGovernanceControls) {
179179
projectConfig.preserveGovernanceControls = workflowSettings.preserveGovernanceControls;
180180
}
181+
if (workflowSettings.lineage) {
182+
projectConfig.lineageEnabled = workflowSettings.lineage.enabled;
183+
}
181184
projectConfig.warehouse = "bigquery";
182185
return projectConfig;
183186
}

core/workflow_settings_test.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { expect } from "chai";
2+
3+
import { workflowSettingsAsProjectConfig } from "df/core/workflow_settings";
4+
import { dataform } from "df/protos/ts";
5+
import { suite, test } from "df/testing";
6+
7+
suite("workflowSettingsAsProjectConfig", () => {
8+
test("sets lineageEnabled when workflow settings enable lineage", () => {
9+
const workflowSettings = dataform.WorkflowSettings.create({
10+
lineage: { enabled: true },
11+
});
12+
13+
const projectConfig = workflowSettingsAsProjectConfig(workflowSettings);
14+
15+
expect(projectConfig.lineageEnabled).to.equal(true);
16+
});
17+
18+
test("leaves lineageEnabled unset when workflow settings omit lineage", () => {
19+
const workflowSettings = dataform.WorkflowSettings.create({});
20+
21+
const projectConfig = workflowSettingsAsProjectConfig(workflowSettings);
22+
23+
expect(projectConfig.lineageEnabled).to.equal(null);
24+
});
25+
26+
test("sets lineageEnabled to false when lineage.enabled is explicitly false", () => {
27+
const workflowSettings = dataform.WorkflowSettings.create({
28+
lineage: { enabled: false },
29+
});
30+
31+
const projectConfig = workflowSettingsAsProjectConfig(workflowSettings);
32+
33+
expect(projectConfig.lineageEnabled).to.equal(false);
34+
});
35+
});

protos/configs.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ message WorkflowSettings {
7171
// Optional. If set to true, governance controls (e.g. Data Policies) will be
7272
// preserved on BigQuery tables.
7373
bool preserve_governance_controls = 18;
74+
75+
// Optional. Configuration for Knowledge Catalog lineage emission.
76+
LineageSettings lineage = 19;
77+
}
78+
79+
// Configuration for Knowledge Catalog lineage emission.
80+
message LineageSettings {
81+
// If true, downstream runners will emit OpenLineage events to Knowledge
82+
// Catalog for actions executed from this project.
83+
bool enabled = 1;
7484
}
7585

7686
// Action configs defines the contents of `actions.yaml` configuration files.

protos/core.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ message ProjectConfig {
4040

4141
bool preserve_governance_controls = 24;
4242

43+
optional bool lineage_enabled = 25;
44+
4345
reserved 3, 4, 6, 8, 10, 12, 13;
4446
}
4547

0 commit comments

Comments
 (0)