Skip to content

Read dashboard definition from file_path via filer interface #2738

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

Merged
merged 8 commits into from
Apr 29, 2025

Conversation

anton-107
Copy link
Contributor

@anton-107 anton-107 commented Apr 17, 2025

Changes

  1. When dashboard resource contains a file_path field, that file is read and its contents are set to the serialized_dashboard field. This is done in a newly introduced ConfigureDashboardSerializedDashboard mutator
  2. Old behavior of wrapping file_path into terraform's file directive is removed from dashboardConverter (unit tests for this are also removed)
  3. ConfigureWSFS mutator call is moved to be executed before PythonMutator so that the latter has access to the Workspace File System client

Why

This change allows bundle deploy to correctly deploy dashboard resource when running in Databricks Workspace / Runtime. Deployment does not work currently, because reading a dashboard file via file system interface throws an error in the Workspace.

Tests

  • Added a new dashboard deployment acceptance test
  • Performed a manual test to deploy a dashboard from a workspace

@anton-107 anton-107 temporarily deployed to test-trigger-is April 17, 2025 11:55 — with GitHub Actions Inactive
@anton-107 anton-107 temporarily deployed to test-trigger-is April 17, 2025 12:14 — with GitHub Actions Inactive
@anton-107 anton-107 marked this pull request as ready for review April 17, 2025 12:51
Copy link
Contributor

@shreyas-goenka shreyas-goenka left a comment

Choose a reason for hiding this comment

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

Thanks! Could you also include in the PR description what does not work today in the workspace? Also please take a look at converting the mutator to read from the typed tree. That'll simplify the code quite a bit.

@anton-107 anton-107 force-pushed the anton-107/configure-serialized-dashboard branch from c3573b7 to bcba28d Compare April 22, 2025 12:58
@anton-107 anton-107 temporarily deployed to test-trigger-is April 22, 2025 12:58 — with GitHub Actions Inactive
@anton-107 anton-107 temporarily deployed to test-trigger-is April 22, 2025 15:36 — with GitHub Actions Inactive
@anton-107 anton-107 force-pushed the anton-107/configure-serialized-dashboard branch from 28533c6 to d40eabc Compare April 23, 2025 11:12
@anton-107 anton-107 temporarily deployed to test-trigger-is April 23, 2025 11:12 — with GitHub Actions Inactive
@anton-107 anton-107 temporarily deployed to test-trigger-is April 23, 2025 11:55 — with GitHub Actions Inactive
Copy link
Contributor

@shreyas-goenka shreyas-goenka left a comment

Choose a reason for hiding this comment

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

Approving to unblock. Just one question about why we needed to change the file translation.

@pietern pietern changed the title Read dashboard definition from file_path via filer interface Read dashboard definition from file_path via filer interface Apr 24, 2025
@anton-107
Copy link
Contributor Author

Approving to unblock. Just one question about why we needed to change the file translation.

yes. this is needed for the filer to read the file correctly

@anton-107 anton-107 force-pushed the anton-107/configure-serialized-dashboard branch from abdf67b to e7e0b45 Compare April 24, 2025 08:37
@anton-107 anton-107 temporarily deployed to test-trigger-is April 24, 2025 08:37 — with GitHub Actions Inactive
@anton-107 anton-107 temporarily deployed to test-trigger-is April 24, 2025 12:40 — with GitHub Actions Inactive
@anton-107 anton-107 requested a review from pietern April 24, 2025 14:08
Copy link
Contributor

@denik denik left a comment

Choose a reason for hiding this comment

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

Did you manually test it in the workspace? (You can cross-build and upload binary there)

Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

Can you confirm this change is a no-op for dashboards deployed with an earlier version of the CLI? Everything else LGTM.

@anton-107
Copy link
Contributor Author

Did you manually test it in the workspace? (You can cross-build and upload binary there)

Yes, tested for new dashboards in workspace - deployment works with this change in

@denik
Copy link
Contributor

denik commented Apr 29, 2025

Did you manually test it in the workspace? (You can cross-build and upload binary there)

Yes, tested for new dashboards in workspace - deployment works with this change in

OK, thanks. I asked because I did not see it not mentioned in Tests section, but I see it's there now.

@anton-107
Copy link
Contributor Author

Can you confirm this change is a no-op for dashboards deployed with an earlier version of the CLI? Everything else LGTM.

Wrote this test:

  • created a new bundle containing a simple dashboard
  • deployed it with a CLI version that does not have this change (latest main
  • deployed it with a CLI version containing this change

the second run reported Deployment as complete and there were no signs of any changes that were required

@anton-107 anton-107 added this pull request to the merge queue Apr 29, 2025
Merged via the queue into main with commit 59a4da6 Apr 29, 2025
10 checks passed
@anton-107 anton-107 deleted the anton-107/configure-serialized-dashboard branch April 29, 2025 13:30
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.

4 participants