Skip to content

Commit f58aa24

Browse files
committed
Promote workflow linter to non-experimental
1 parent 8837bb4 commit f58aa24

File tree

5 files changed

+31
-25
lines changed

5 files changed

+31
-25
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -728,9 +728,7 @@ in the Migration dashboard.
728728

729729
## Jobs Static Code Analysis Workflow
730730

731-
> Please note that this is an experimental workflow.
732-
733-
The `experimental-workflow-linter` workflow lints accessible code from 2 sources:
731+
The `workflow-linter` workflow lints accessible code from 2 sources:
734732
- all workflows/jobs present in the workspace
735733
- all dashboards/queries present in the workspace
736734
The linting emits problems indicating what to resolve for making the code Unity Catalog compatible.

src/databricks/labs/ucx/assessment/workflows.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,21 @@ def crawl_groups(self, ctx: RuntimeContext):
183183
"""Scans all groups for the local group migration scope"""
184184
ctx.group_manager.snapshot()
185185

186+
@job_task
187+
def assess_workflows(self, ctx: RuntimeContext):
188+
"""Scans all jobs for migration issues in notebooks jobs.
189+
190+
Also, stores direct filesystem accesses for display in the migration dashboard.
191+
"""
192+
ctx.workflow_linter.refresh_report(ctx.sql_backend, ctx.inventory_database)
193+
186194
@job_task
187195
def assess_dashboards(self, ctx: RuntimeContext):
188196
"""Scans all dashboards for migration issues in SQL code of embedded widgets.
189-
Also stores direct filesystem accesses for display in the migration dashboard."""
190-
ctx.query_linter.refresh_report(ctx.sql_backend, ctx.inventory_database)
191197
192-
@job_task
193-
def assess_workflows(self, ctx: RuntimeContext):
194-
"""Scans all jobs for migration issues in notebooks.
195-
Also stores direct filesystem accesses for display in the migration dashboard."""
196-
ctx.workflow_linter.refresh_report(ctx.sql_backend, ctx.inventory_database)
198+
Also, stores direct filesystem accesses for display in the migration dashboard.
199+
"""
200+
ctx.query_linter.refresh_report(ctx.sql_backend, ctx.inventory_database)
197201

198202

199203
class Failing(Workflow):

src/databricks/labs/ucx/runtime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
)
2121
from databricks.labs.ucx.progress.workflows import MigrationProgress
2222
from databricks.labs.ucx.recon.workflows import MigrationRecon
23-
from databricks.labs.ucx.source_code.workflows import ExperimentalWorkflowLinter
23+
from databricks.labs.ucx.source_code.workflows import WorkflowLinter
2424
from databricks.labs.ucx.workspace_access.workflows import (
2525
GroupMigration,
2626
PermissionsMigrationAPI,
@@ -58,7 +58,7 @@ def all(cls):
5858
ScanTablesInMounts(),
5959
MigrateTablesInMounts(),
6060
PermissionsMigrationAPI(),
61-
ExperimentalWorkflowLinter(),
61+
WorkflowLinter(),
6262
MigrationRecon(),
6363
Failing(),
6464
]

src/databricks/labs/ucx/source_code/workflows.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@
22
from databricks.labs.ucx.framework.tasks import Workflow, job_task
33

44

5-
class ExperimentalWorkflowLinter(Workflow):
5+
class WorkflowLinter(Workflow):
66
def __init__(self):
7-
super().__init__('experimental-workflow-linter')
7+
super().__init__('workflow-linter')
88

9-
@job_task(job_cluster="table_migration")
10-
def lint_all_workflows(self, ctx: RuntimeContext):
11-
"""[EXPERIMENTAL] Analyses all jobs for source code compatibility problems. This is an experimental feature,
12-
that is not yet fully supported."""
9+
@job_task
10+
def assess_workflows(self, ctx: RuntimeContext):
11+
"""Scans all jobs for migration issues in notebooks jobs.
12+
13+
Also, stores direct filesystem accesses for display in the migration dashboard.
14+
"""
1315
ctx.workflow_linter.refresh_report(ctx.sql_backend, ctx.inventory_database)
1416

15-
@job_task(job_cluster="table_migration")
16-
def lint_all_queries(self, ctx: RuntimeContext):
17-
"""[EXPERIMENTAL] Analyses all jobs for source code compatibility problems. This is an experimental feature,
18-
that is not yet fully supported."""
17+
@job_task
18+
def assess_dashboards(self, ctx: RuntimeContext):
19+
"""Scans all dashboards for migration issues in SQL code of embedded widgets.
20+
21+
Also, stores direct filesystem accesses for display in the migration dashboard.
22+
"""
1923
ctx.query_linter.refresh_report(ctx.sql_backend, ctx.inventory_database)

tests/integration/source_code/test_jobs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ def test_running_real_workflow_linter_job(installation_ctx, make_job) -> None:
3838
job = make_job(content="spark.read.table('a_table').write.csv('/mnt/things/e/f/g')\n")
3939
ctx = installation_ctx.replace(config_transform=lambda wc: replace(wc, include_job_ids=[job.job_id]))
4040
ctx.workspace_installation.run()
41-
ctx.deployed_workflows.run_workflow("experimental-workflow-linter")
42-
ctx.deployed_workflows.validate_step("experimental-workflow-linter")
41+
ctx.deployed_workflows.run_workflow("workflow-linter")
42+
ctx.deployed_workflows.validate_step("workflow-linter")
4343

4444
# This test merely tests that the workflows produces records of the expected types; record content is not checked.
4545
cursor = ctx.sql_backend.fetch(f"SELECT COUNT(*) AS count FROM {ctx.inventory_database}.workflow_problems")
4646
result = next(cursor)
4747
if result['count'] == 0:
48-
installation_ctx.deployed_workflows.relay_logs("experimental-workflow-linter")
48+
installation_ctx.deployed_workflows.relay_logs("workflow-linter")
4949
assert False, "No workflow problems found"
5050
dfsa_records = installation_ctx.directfs_access_crawler_for_paths.snapshot()
5151
used_table_records = installation_ctx.used_tables_crawler_for_paths.snapshot()

0 commit comments

Comments
 (0)