Skip to content

packages autofix fails to upgrade dbt_constraints to fusion-compatible version 1.0.8 #343

@davidharting

Description

@davidharting

Summary

dbt-autofix packages fails to upgrade Snowflake-Labs/dbt_constraints from an incompatible version (e.g. 1.0.7) to the fusion-compatible version 1.0.8. Instead, it reports the package as "not compatible with Fusion" with no upgrade path.

Reported via: Slack thread in #fusion-autofix-support — a customer ran autofix to upgrade packages but dbt_constraints was not upgraded.

Root Cause

Snowflake-Labs/dbt_constraints is listed in EXPLICIT_DISALLOW_ALL_VERSIONS in manual_overrides.py:3. This was likely correct when no versions were compatible, but version 1.0.8 is now fusion-compatible (declared in fusion_version_compatibility_output.py).

The problem is that EXPLICIT_DISALLOW_ALL_VERSIONS takes precedence and short-circuits the upgrade check:

  1. In DbtPackage.get_package_fusion_compatibility_state() (dbt_package.py:232), the package is categorized as NO_VERSIONS_COMPATIBLE
  2. In check_for_package_upgrades() (package_upgrade.py:270), the EXPLICIT_DISALLOW_ALL_VERSIONS check fires before individual version checking
  3. The tool returns PUBLIC_PACKAGE_NOT_COMPATIBLE_WITH_FUSION without ever checking that 1.0.8 is available

Reproduction

from dbt_fusion_package_tools.dbt_package import DbtPackage

pkg = DbtPackage(
    package_name='dbt_constraints',
    package_id='Snowflake-Labs/dbt_constraints',
    project_config_raw_version_specifier='1.0.7',
)

# These show version 1.0.8 IS compatible and available:
print(pkg.fusion_compatible_versions)      # ['=1.0.8']
print(pkg.find_fusion_compatible_versions_above_requested_range())  # ['=1.0.8']

# But the package-level state says NO versions are compatible:
print(pkg.get_package_fusion_compatibility_state())  # NO_VERSIONS_COMPATIBLE

Suggested Fix

Move Snowflake-Labs/dbt_constraints from EXPLICIT_DISALLOW_ALL_VERSIONS to EXPLICIT_DISALLOW_VERSIONS with the specific incompatible versions (0.1.0 through 1.0.7), so the tool can find and offer 1.0.8 as an upgrade.

Alternatively, simply remove it from EXPLICIT_DISALLOW_ALL_VERSIONS entirely — the fusion_version_compatibility_output.py data already correctly marks versions 0.1.0–1.0.7 as incompatible and 1.0.8 as compatible, which is sufficient for the individual version checking logic to work.

Broader Concern

Claude: There may be other packages in EXPLICIT_DISALLOW_ALL_VERSIONS that have since gained compatible versions. It may be worth auditing the full list against fusion_version_compatibility_output.py to catch similar cases.

  • David: Yes! We have an objective to centralize all package compatibility decisions to hub. EXPLICIT_DISALLOW_VERSIONS will go away

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions