Skip to content

Fixes fmt and unit test failures from new blueprint release #4048

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 4 commits into from
Jun 16, 2025

Conversation

pritishpai
Copy link
Contributor

Changes

Breaking changes in the blueprint release needs adding type hints to MockInstallation and fix a failing unit tests. This PR will also allow the acceptance tests to run that fail for dependabot.

Tests

  • manually tested

@pritishpai pritishpai requested a review from a team as a code owner May 29, 2025 17:48
Copy link

github-actions bot commented May 29, 2025

✅ 24/24 passed, 1 skipped, 38m4s total

Running from acceptance #8649

@gueniai gueniai added this to UCX May 30, 2025
@gueniai gueniai moved this to Ready for Review in UCX May 30, 2025
@pritishpai pritishpai self-assigned this May 30, 2025
Copy link
Contributor

@asnare asnare left a comment

Choose a reason for hiding this comment

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

LGTM, albeit with a few suggestions.

pyproject.toml Outdated
@@ -47,7 +47,7 @@ classifiers = [

dependencies = ["databricks-sdk>=0.44.0,<0.54.0",
"databricks-labs-lsql>=0.16.0,<0.17.0",
"databricks-labs-blueprint>=0.10.0,<0.11.0",
"databricks-labs-blueprint>=0.10.0,<0.12.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

I would pin this to a specific version due to the way testing works:

Suggested change
"databricks-labs-blueprint>=0.10.0,<0.12.0",
"databricks-labs-blueprint>=0.11.0,<0.12.0",

Testing always pulls in the latest version, and unless we pin the version upgrades of existing installations will remain on the older version. Accidental incompatibility with older versions (because we don't test against the min-supported version) is a common source of problems.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this specifically for testing for a new version manually (as opposed to the automated branch created by dependabot)? Because the dependabot release does seem to do the same. We might have to change it there as well.

https://github.com/databrickslabs/ucx/pull/4043/files

Copy link
Contributor

Choose a reason for hiding this comment

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

It says "This branch upgrades the dependency to this version", and we of-course include the changes needed for compatibility.

Once this is merged, on the dependabot PR we issue the command @dependabot rebase and it will: a) realise the version update has happened; b) close the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that would change the minimum version for this manual PR. But then this manual change needs to be done for every version change PR. I checked the other automated dependabot PRs and they do not update the minimum version. Is there a way to have dependabot itself also update the minimum version so that we do not have to do it manually in the future?

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if setting the version-strategy to increase might work?

Another combination to try might be ~=0.11.0 and increase-if-necessary.

(The code for dependabot is available, but I haven't dug around to figure out what might work.)

@asnare asnare requested a review from a team June 16, 2025 14:37
@pritishpai pritishpai force-pushed the fix/dependabot_blueprint_0_12_unit_test branch from f7a1b3d to 40d8996 Compare June 16, 2025 14:45
@asnare asnare added the dependencies Pull requests that update a dependency file label Jun 16, 2025
@pritishpai pritishpai added this pull request to the merge queue Jun 16, 2025
Merged via the queue into main with commit 931cead Jun 16, 2025
8 checks passed
@pritishpai pritishpai deleted the fix/dependabot_blueprint_0_12_unit_test branch June 16, 2025 15:11
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in UCX Jun 16, 2025
gueniai added a commit that referenced this pull request Jul 3, 2025
* Added documentation for [#3963](#3963) ([#4020](#4020)). The workflow assessment functionality has been enhanced with an experimental task that analyzes recently executed workflows for migration problems, providing links to relevant documentation and recommendations for addressing identified issues. This task, labeled as experimental, now only runs for workflows executed within the last 30 days, but users can opt to analyze all workflows by running a specific workflow. The assessment findings, including any migration problems detected, can be viewed in the assessment dashboard, offering a centralized location for monitoring and addressing potential issues, and helping users to ensure a smoother migration process.
* Enhance documentation for UCX ([#4024](#4024)). The UCX documentation has undergone significant enhancements to improve user experience and provide comprehensive guidance for contributors and users. The main page has been revamped with a simplified and accelerated Unity Catalog migration process, featuring a prominent call-to-action and key features such as comprehensive assessment, automated migrations, and detailed reporting. Additional pages, including a `Getting Started` section, have been added to guide users through installation, running, and operating the toolkit, with links to relevant sections such as installation, running, and reference materials. The contributing section has been updated for consistency, and a new `How to Contribute` section has been introduced, providing clear resources for submitting issues, pull requests, and contributing to the documentation. The documentation structure has been reorganized, with updated sidebar positions and revised descriptions to better reflect the content and purpose of each section, ultimately aiming to provide better user documentation, clarity, and a more intuitive interface for navigating and utilizing the UCX toolkit.
* Fixes fmt and unit test failures from new blueprint release ([#4048](#4048)). The dependency on the databricks-labs-blueprint has been updated to a version range of 0.11.0 or higher but less than 0.12.0, incorporating new features and bug fixes from the latest blueprint release. To ensure compatibility with this updated version, the codebase has been updated to address breaking changes introduced in the recent blueprint release, including the addition of type hints to MockInstallation and the DEFAULT_CONFIG variable, which is now defined as a dictionary with string keys and RootJsonValue values. Furthermore, a previously failing unit test has been fixed, and the test_installation_recovers_invalid_dashboard function has been refactored into two separate test functions to verify the recovery of invalid dashboards due to InvalidParameterValue and NotFound exceptions, utilizing the MockInstallation class and caplog fixture to capture and verify log messages. These changes aim to resolve issues with the new blueprint release, enable previously failing acceptance tests, and improve the overall robustness of the installation process.
* Updated for Databricks SDK 0.56+ ([#4178](#4178)). The project's dependencies have been updated to support Databricks SDK version 0.56 and above, with the upper bound set to less than 0.58.0, to ensure compatibility with the evolving SDK. This update includes breaking changes, and as a result, various modifications have been made to the code, such as adding type hints to functions to improve linting, replacing `PermissionsList` with `GetPermissionsResponse`, and accessing `SecurableType` enum values using the `value` attribute. Additionally, several test functions have been updated to reflect these changes, including the addition of return type hints and the use of `create_autospec` to create mock objects. These updates aim to maintain the project's functionality and ensure seamless compatibility with the latest Databricks SDK version, while also improving code quality and test coverage. The changes affect various aspects of the code, including grants management, permissions retrieval, and test cases for different scenarios, such as migrating managed tables, external tables, and tables in mounts.
* Workaround for acceptance with dependabot PR ([#4029](#4029)). The library's dependency on a key SDK has been updated to support a broader version range, now compatible with versions from 0.44.0 up to but not including 0.54.0, enhancing flexibility and potentially allowing for the incorporation of new features or bug fixes introduced in these versions. Additionally, an internal function responsible for setting default catalog settings has been refined to handle `NotFound` exceptions more robustly. Specifically, the function now checks for the presence of metadata before attempting to retrieve an etag, preventing potential errors that could occur when metadata is missing, thereby improving the overall stability and reliability of the library.
@gueniai gueniai mentioned this pull request Jul 3, 2025
gueniai added a commit that referenced this pull request Jul 3, 2025
* Added documentation for
[#3963](#3963)
([#4020](#4020)). The
workflow assessment functionality has been enhanced with an experimental
task that analyzes recently executed workflows for migration problems,
providing links to relevant documentation and recommendations for
addressing identified issues. This task, labeled as experimental, now
only runs for workflows executed within the last 30 days, but users can
opt to analyze all workflows by running a specific workflow. The
assessment findings, including any migration problems detected, can be
viewed in the assessment dashboard, offering a centralized location for
monitoring and addressing potential issues, and helping users to ensure
a smoother migration process.
* Enhance documentation for UCX
([#4024](#4024)). The UCX
documentation has undergone significant enhancements to improve user
experience and provide comprehensive guidance for contributors and
users. The main page has been revamped with a simplified and accelerated
Unity Catalog migration process, featuring a prominent call-to-action
and key features such as comprehensive assessment, automated migrations,
and detailed reporting. Additional pages, including a `Getting Started`
section, have been added to guide users through installation, running,
and operating the toolkit, with links to relevant sections such as
installation, running, and reference materials. The contributing section
has been updated for consistency, and a new `How to Contribute` section
has been introduced, providing clear resources for submitting issues,
pull requests, and contributing to the documentation. The documentation
structure has been reorganized, with updated sidebar positions and
revised descriptions to better reflect the content and purpose of each
section, ultimately aiming to provide better user documentation,
clarity, and a more intuitive interface for navigating and utilizing the
UCX toolkit.
* Fixes fmt and unit test failures from new blueprint release
([#4048](#4048)). The
dependency on the databricks-labs-blueprint has been updated to a
version range of 0.11.0 or higher but less than 0.12.0, incorporating
new features and bug fixes from the latest blueprint release. To ensure
compatibility with this updated version, the codebase has been updated
to address breaking changes introduced in the recent blueprint release,
including the addition of type hints to MockInstallation and the
DEFAULT_CONFIG variable, which is now defined as a dictionary with
string keys and RootJsonValue values. Furthermore, a previously failing
unit test has been fixed, and the
test_installation_recovers_invalid_dashboard function has been
refactored into two separate test functions to verify the recovery of
invalid dashboards due to InvalidParameterValue and NotFound exceptions,
utilizing the MockInstallation class and caplog fixture to capture and
verify log messages. These changes aim to resolve issues with the new
blueprint release, enable previously failing acceptance tests, and
improve the overall robustness of the installation process.
* Updated for Databricks SDK 0.56+
([#4178](#4178)). The
project's dependencies have been updated to support Databricks SDK
version 0.56 and above, with the upper bound set to less than 0.58.0, to
ensure compatibility with the evolving SDK. This update includes
breaking changes, and as a result, various modifications have been made
to the code, such as adding type hints to functions to improve linting,
replacing `PermissionsList` with `GetPermissionsResponse`, and accessing
`SecurableType` enum values using the `value` attribute. Additionally,
several test functions have been updated to reflect these changes,
including the addition of return type hints and the use of
`create_autospec` to create mock objects. These updates aim to maintain
the project's functionality and ensure seamless compatibility with the
latest Databricks SDK version, while also improving code quality and
test coverage. The changes affect various aspects of the code, including
grants management, permissions retrieval, and test cases for different
scenarios, such as migrating managed tables, external tables, and tables
in mounts.
* Workaround for acceptance with dependabot PR
([#4029](#4029)). The
library's dependency on a key SDK has been updated to support a broader
version range, now compatible with versions from 0.44.0 up to but not
including 0.54.0, enhancing flexibility and potentially allowing for the
incorporation of new features or bug fixes introduced in these versions.
Additionally, an internal function responsible for setting default
catalog settings has been refined to handle `NotFound` exceptions more
robustly. Specifically, the function now checks for the presence of
metadata before attempting to retrieve an etag, preventing potential
errors that could occur when metadata is missing, thereby improving the
overall stability and reliability of the library.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants