Skip to content

Resolve cross-resource references in bundle summary#5639

Open
ilyakuz-db wants to merge 1 commit into
mainfrom
fix/synced-table-summary-ref
Open

Resolve cross-resource references in bundle summary#5639
ilyakuz-db wants to merge 1 commit into
mainfrom
fix/synced-table-summary-ref

Conversation

@ilyakuz-db

Copy link
Copy Markdown
Contributor

Changes

bundle summary now resolves ${resources.*} cross-resource references in the
reported resource name (and the URL derived from it), instead of printing the
raw reference.

For example, a synced database table whose name embeds another resource's catalog
name:

resources:
  database_catalogs:
    my_catalog:
      name: my_catalog
  synced_database_tables:
    my_synced_table:
      name: ${resources.database_catalogs.my_catalog.name}.public.my_synced_table

Before:

  Synced database tables:
    my_synced_table:
      Name: ${resources.database_catalogs.my_catalog.name}.public.my_synced_table
      URL:  .../explore/data/$%7Bresources.database_catalogs.my_catalog.name%7D...

After:

  Synced database tables:
    my_synced_table:
      Name: my_catalog.public.my_synced_table
      URL:  .../explore/data/my_catalog.public.my_synced_table

The resolution runs in the state-loading path used by bundle summary (and
bundle open), right before InitializeURLs, so the URL is derived from the
resolved name. References whose target is not known yet (e.g. an output-only id
before deployment, or a reference to a field that isn't set) are left untouched
rather than resolved to an empty value or failing the command.

Why

The resources prefix is intentionally excluded from the variable resolution
that runs during initialize because some of those references are only known
after a resource is deployed. As a result, with the direct engine, a name that
embeds a ${resources...} reference was never resolved back into the config, so
bundle summary (including the in-workspace Bundle resources view, which calls
bundle summary) showed the raw reference and a broken, percent-encoded URL.
Every other resource resolved correctly because their displayed names use
${workspace...}/${var...} references that are resolved during initialize.

Tests

  • New acceptance test bundle/resources/synced_database_tables/summary_resolves_references covers the resolution in bundle summary without a deployment.
  • New unit test TestResolveResourceReferences covers resolving a known reference and skipping one whose target isn't set.
  • Updated existing acceptance fixtures whose summary output now shows resolved references (synced_database_tables/basic, postgres_synced_tables/basic, resource_deps/unicode_reference, templates/default-python/integration_classic).

@ilyakuz-db ilyakuz-db force-pushed the fix/synced-table-summary-ref branch from 63ca70e to 64ce952 Compare June 17, 2026 18:41
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 17, 2026 18:41 — with GitHub Actions Inactive
@ilyakuz-db ilyakuz-db temporarily deployed to test-trigger-is June 17, 2026 18:41 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

11 files changed
Suggested: @denik
Also eligible: @janniklasrose, @pietern, @anton-107, @shreyas-goenka, @andrewnester, @lennartkats-db

/bundle/ - needs approval

Files: bundle/config/mutator/resolve_variable_references.go, bundle/config/mutator/resolve_variable_references_test.go
Suggested: @denik
Also eligible: @janniklasrose, @pietern, @anton-107, @shreyas-goenka, @andrewnester, @lennartkats-db

/cmd/bundle/ - needs approval

Files: cmd/bundle/utils/process.go
Suggested: @denik
Also eligible: @janniklasrose, @pietern, @anton-107, @shreyas-goenka, @andrewnester, @lennartkats-db

General files (require maintainer)

Files: NEXT_CHANGELOG.md
Based on git history:

  • @denik -- recent work in cmd/bundle/utils/, ./, bundle/config/mutator/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db) can approve all areas.
See OWNERS for ownership rules.

Jobs:
foo:
Name: ${resources.jobs.变量.id}
Name: [NUMID]

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.

could you add replace_ids.py to script so that instead of NUMID we have concrete replacement.

// from the resolved names.
mutators = append(mutators,
mutator.ResolveResourceReferences(),
mutator.InitializeURLs(),

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.

This approach is a bit concerning because it introduces a completely different way to resolve $resources references.

One major difference is that it uses values from config not from the state. This could match but they can also be different if config is changed but not yet deployed.

There could also be other differences simply because it's a completely different approach to resolve these.

Let's explore looking up required fields from the state instead?

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 64ce952

Run: 27711698550

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 14 264 1011 6:04
🟨​ aws windows 7 14 266 1009 10:13
💚​ aws-ucws linux 7 14 360 925 6:13
💚​ aws-ucws windows 7 14 362 923 8:49
💚​ azure linux 1 16 267 1009 5:17
🔄​ azure windows 2 1 16 267 1007 8:29
💚​ azure-ucws linux 1 16 365 921 6:51
🔄​ azure-ucws windows 3 16 365 919 8:15
💚​ gcp linux 1 16 263 1012 6:30
💚​ gcp windows 1 16 265 1010 6:46
25 interesting tests: 14 SKIP, 7 KNOWN, 4 flaky
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 🟨​K 🟨​K 💚​R 💚​R 💚​R 💚​R 💚​R 🔄​f 💚​R 💚​R
🔄​ TestAccept/bundle/deployment/bind/alert 🙈​s 🙈​s 🙈​s 🙈​s ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p
🔄​ TestAccept/bundle/deployment/bind/alert/DATABRICKS_BUNDLE_ENGINE=terraform ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p
🙈​ 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 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​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_endpoints/recreate 🙈​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
🔄​ TestFetchRepositoryInfoAPI_FromRepo/root ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p
🔄​ TestFetchRepositoryInfoAPI_FromRepo/subdir ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p
Top 20 slowest tests (at least 2 minutes):
duration env testname
5:24 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:31 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
4:25 gcp linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:57 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:27 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:13 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:10 aws-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:02 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:58 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:58 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:56 azure windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:53 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:50 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:47 aws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:46 aws-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:41 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:39 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:33 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:32 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:25 azure-ucws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

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