Skip to content

temp: add Windows reproduction for export-dir on illegal notebook name#5655

Open
radakam wants to merge 5 commits into
mainfrom
cli-5171-fix-workspace-export-dir-new-notebook
Open

temp: add Windows reproduction for export-dir on illegal notebook name#5655
radakam wants to merge 5 commits into
mainfrom
cli-5171-fix-workspace-export-dir-new-notebook

Conversation

@radakam

@radakam radakam commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Why

A UI-created notebook is named like New Notebook 2026-05-04 13:54:24. The : is legal on Linux/macOS but illegal on Windows, so os.Create fails with ERROR_INVALID_NAME and the whole recursive export aborts on that one file.

Changes

  • export_dir.go: skip such a file with a warning and continue, instead of aborting. Only this specific error is skipped — permission/disk/missing-path errors still propagate (so we never silently drop files on real failures).
  • Detection is build-tagged (export_dir_windows.go / export_dir_other.go) to avoid err.Error() string-matching and stay cross-platform; ERROR_INVALID_NAME has no portable Go sentinel.
  • libs/testserver: added a fake WorkspaceList handler so the imported notebook is actually listed and exported.
  • Changelog entry added.

Changes to acceptance harness

  • The test now runs on all OSes instead of being Windows-gated. The behavior legitimately differs per platform (skipped on Windows, exported on Linux/macOS), so the output is captured in out.<goos>.txt; output.txt holds only an OS-independent header line.
  • preparePathFilter now compares only the current OS's out.<goos>.txt and skips the others. Previously every committed out* file was required on every OS, so per-OS goldens weren't possible.

Closes DECO-27435 and fixes issue #5171.

Tests

  • Acceptance (export-dir-illegal-filename/): runs on all OSes; export skips-with-warning on Windows (out.windows.txt, captured from a real Windows CI run) and completes-with-export on Linux/macOS (out.linux.txt / out.darwin.txt).
  • Unit (export_dir_windows_test.go): asserts the narrow contract — only ERROR_INVALID_NAME skips; ErrPermission/ErrNotExist/generic/nil do not.

Reproduces #5171: `workspace export-dir` aborts on Windows
when a notebook name contains a ':' (e.g. an untitled "New Notebook
<timestamp>"), because the colon is illegal in a local Windows filename
and os.Create fails. The name is legal on Linux/macOS, so the test is
gated to Windows via GOOS.

output.txt is intentionally omitted: the golden cannot be generated on a
non-Windows machine, so the Windows CI leg will surface the real output
to commit verbatim.
@radakam radakam temporarily deployed to test-trigger-is June 18, 2026 17:35 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 18, 2026 17:35 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 50a000c

Run: 27827059938

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 7 13 265 1012 5:30
💚​ aws windows 7 13 267 1010 7:56
💚​ aws-ucws linux 7 13 361 926 6:22
💚​ aws-ucws windows 7 13 363 924 7:37
💚​ azure linux 1 15 268 1010 6:17
💚​ azure windows 1 15 270 1008 6:51
💚​ azure-ucws linux 1 15 366 922 6:39
💚​ azure-ucws windows 1 15 368 920 7:38
💚​ gcp linux 1 15 264 1013 5:42
💚​ gcp windows 1 15 266 1011 8:45
20 interesting tests: 13 SKIP, 7 RECOVERED
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/resources/postgres_branches/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/recreate 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/replace_existing 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/update_protected 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_branches/without_branch_id 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_endpoints/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/postgres_projects/update_display_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
Top 21 slowest tests (at least 2 minutes):
duration env testname
5:11 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:18 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:11 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:09 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:53 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:51 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:43 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:15 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:15 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:03 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:02 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:00 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:56 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:55 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:43 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:42 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:38 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:38 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:32 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:29 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:08 gcp windows TestAccept

Captured verbatim from the Windows CI run of the test added in the
previous commit. Documents the current (buggy) behavior of #5171:
export-dir aborts on Windows when a notebook name contains ':'.
@radakam radakam temporarily deployed to test-trigger-is June 18, 2026 19:17 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 18, 2026 19:17 — with GitHub Actions Inactive
A workspace object name can be illegal as a local filename (e.g. the ':'
in an untitled "New Notebook 2026-05-04 13:54:24" on Windows), which made
os.Create fail and abort the entire export. Skip such files with a
warning and continue, matching the existing skip paths for non-exportable
and oversized objects.

Detection uses a build-tagged helper checking the Windows
ERROR_INVALID_NAME code; on other platforms no filename character (other
than '/' and NUL, which cannot appear in a workspace object name) is
illegal, so it is a no-op.

Flips the Windows-gated acceptance test from asserting the abort to
expecting skip-with-warning. Fixes #5171.
@radakam radakam temporarily deployed to test-trigger-is June 18, 2026 19:31 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 18, 2026 19:31 — with GitHub Actions Inactive
Locks in the narrow contract that only the Windows ERROR_INVALID_NAME
error is treated as skippable, while permission, not-exist, generic, and
nil errors are not. The acceptance test only exercises the positive
(invalid-name) path, so this guards against accidentally broadening the
check and silently dropping files on real I/O failures.
@radakam radakam temporarily deployed to test-trigger-is June 18, 2026 19:38 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 18, 2026 19:38 — with GitHub Actions Inactive
@radakam radakam marked this pull request as ready for review June 19, 2026 06:08
Comment thread acceptance/cmd/workspace/export-dir-illegal-filename/test.toml Outdated
# This reproduces databricks/cli#5171, which only manifests on Windows: a ':' in
# the notebook name is a legal filename character on Linux/macOS but illegal on
# Windows, so os.Create rejects the local target path there.
[GOOS]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets run this test on all operating systems. You can redirect the stderr / stdout to out.(os).txt to capture the operating system differences in teh same PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done -- runs on all three OSes now, with export-dir output redirected to out.(os).txt; output.txt keeps one OS-independent line so there's no empty golden. One note: it seems that the runner had no per-OS golden support, so a plain out.windows.txt would fail as "Missing output file" on linux/macos if I understand it correctly. I extended preparePathFilter to compare only the current OS's file and skip the rest, and added a fake WorkspaceList handler so the notebook is actually listed and exported. Is this what you had in mind?

The test reproducing #5171 was gated to Windows only because a
':' in the notebook name is illegal as a local filename on Windows but legal on
Linux/macOS, so export-dir skips it there and exports it everywhere else.

Run it on every OS and capture the divergent output in out.<goos>.txt. Teach the
acceptance runner to compare only the current OS's out.<goos>.txt and skip the
others (extending the existing variant-skip machinery), since otherwise the
non-current goldens would fail as "Missing output file".

Add a fake WorkspaceList handler so the imported notebook is listed and actually
exported, replacing the hardcoded [[Server]] list stub.
@radakam radakam temporarily deployed to test-trigger-is June 19, 2026 12:56 — with GitHub Actions Inactive
@radakam radakam temporarily deployed to test-trigger-is June 19, 2026 12:56 — with GitHub Actions Inactive
@shreyas-goenka shreyas-goenka self-requested a review June 19, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants