Repository navigation
bundle summary/open: resolve ${resources.*} references in names and URLs - #8111
Conversation
Read-only commands that display resources (summary, open, pipelines
open/logs/history) loaded only ids from the deployed state, so a name or
field that references another resource was shown as the raw reference,
and URLs built from such names were broken.
Resolve ${resources.*} references in all resources from the referenced
resource's state, falling back to explicitly set config fields, before
URLs are initialized. References to resources that were never deployed
stay as they are.
aws: TestAccept/bundle/resources/synced_database_tables/basic TestAccept/bundle/resources/postgres_synced_tables/basic
Co-authored-by: Isaac <no-reply@databricks.com>
edf2c26 to
36084bd
Compare
Regression test report ✅Commit: Selected 7 changed tests (limit=20, 0 not selected) 17 tests: regression=17 unreleased=0 coverage=0 failing=0
TestAccept/bundle/resource_deps/summary_resolution/DMS=: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): TestAccept/bundle/resource_deps/summary_resolution/DMS=true: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): TestAccept/bundle/resource_deps/unicode_reference/DMS=: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): same output as main (4c4f104) TestAccept/bundle/resource_deps/unicode_reference/DMS=true: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): same output as main (4c4f104) TestAccept/bundle/resources/materialization_sets/membership/DMS=: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): same output as main (4c4f104) TestAccept/bundle/resources/materialization_sets/membership/DMS=true: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): same output as main (4c4f104) TestAccept/bundle/resources/materialization_sets/removal_scope/DMS=: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): same output as main (4c4f104) TestAccept/bundle/resources/materialization_sets/removal_scope/DMS=true: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): TestAccept/bundle/resources/postgres_synced_tables/basic/DMS=: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): same output as main (4c4f104) TestAccept/bundle/resources/postgres_synced_tables/basic/DMS=true: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): same output as main (4c4f104) TestAccept/bundle/resources/synced_database_tables/basic/DMS=: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): same output as main (4c4f104) TestAccept/bundle/resources/synced_database_tables/basic/DMS=true: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): same output as main (4c4f104) TestAccept/bundle/templates/default-python/integration_classic/DMS=/UV_PYTHON=3.10: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): TestAccept/bundle/templates/default-python/integration_classic/DMS=/UV_PYTHON=3.11: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): same output as main (4c4f104) TestAccept/bundle/templates/default-python/integration_classic/DMS=/UV_PYTHON=3.12: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): same output as main (4c4f104) TestAccept/bundle/templates/default-python/integration_classic/DMS=/UV_PYTHON=3.13: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): same output as main (4c4f104) TestAccept/bundle/templates/default-python/integration_classic/DMS=/UV_PYTHON=3.9: branch ✅ | main (4c4f104) ❌ | latest (v1.28.0) ❌main (4c4f104): latest (v1.28.0): same output as main (4c4f104) |
✅ Integration test reportCommit: 60f9ffa
Top 6 slowest tests (at least 2 minutes):
|
- Resolve and type-check each resource on its own, so one bad reference
does not undo resolution in the others; check the whole config converts
before Mutate commits it (a failed conversion left it half-written).
- Leave references to sensitive fields, hashed state fields and state
strings holding a literal ${...} unresolved.
- Cache parsed state per resource for the command.
- Job run URLs prefer the job the run was launched for.
- Synced database table URLs use catalog/schema/table, like other tables.
- New acceptance test bundle/resource_deps/summary_resolution.
aws: TestAccept/bundle/resources/synced_database_tables/basic TestAccept/bundle/resources/postgres_synced_tables/basic
Co-authored-by: Isaac <no-reply@databricks.com>
A field whose config references a sensitive field is deployed with the
secret interpolated, so its value in state holds the secret. Follow
${resources.*} references in the referenced field's config and leave the
reference unresolved when any of them reaches a sensitive field.
aws: TestAccept/bundle/resources/synced_database_tables/basic TestAccept/bundle/resources/postgres_synced_tables/basic
Co-authored-by: Isaac <no-reply@databricks.com>
Following references in config misses deployed values that predate a local edit and references through a whole-object parent. Skip a resolved value that contains the value of any sensitive field or sensitive variable in the config, and follow references in parent fields too. aws: TestAccept/bundle/resources/synced_database_tables/basic TestAccept/bundle/resources/postgres_synced_tables/basic Co-authored-by: Isaac <no-reply@databricks.com>
A numeric secret deployed into an int field is stored as a number, so compare the printed form of every scalar, not only strings. aws: TestAccept/bundle/resources/synced_database_tables/basic TestAccept/bundle/resources/postgres_synced_tables/basic Co-authored-by: Isaac <no-reply@databricks.com>
There was a problem hiding this comment.
Automated review at 8780c04. Each finding was verified against the code.
Not ready yet: 1 blocking issue(s), tagged [blocking].
This PR makes bundle summary, bundle open and the pipelines open/logs/history commands resolve ${resources.*} references in every resource against deployed state, so names and URLs show real values. It also fixes the synced database table URL and the order in which a job run's URL picks its job id. There is a secret-exposure hole that should be fixed before merge: after a sensitive variable is rotated, a field that was built from it can still print the old value. The other comments are about duplicated helpers and the test script not following the repo's testing rules.
Questions
- The synced-table URL change in
libs/workspaceurls/urls.goaffects every caller ofResourceURL/BuildResourceURL, and the job-run URL order swap injob_run.gois a separate behaviour change. Both ride along with the reference resolution, and AGENTS.md asks for one change per PR. Should they move to their own PR(s), or do they have to land together? (non-blocking)
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Review by review-factory (Claude Sonnet 5.5 + Claude Opus 5.5 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.
Design, rethink before merging: Reading values from state is what needs dependsOnSensitiveField, SensitiveConfigValues/containsAny, the hash and literal guards and cachedStateField, and a rotated secret still leaks. A config-only lookup (explicit fields plus ids from statemgmt.Load) guarded by IsSensitiveField fixes every golden here, since dynvar.Resolve sends each chained hop through the lookup; references then match what their targets show.
andrewnester
left a comment
There was a problem hiding this comment.
The secret-rotation repro in the automated review is rejected by bundle validate, since a sensitive variable can't be used in a job name, so I'd accept the documented edit-plus-rotation gap.
Per review: instead of reading referenced values from deployed state,
resolve ${resources.*} references from the config, which after
statemgmt.Load holds the ids of deployed resources. Sensitive variables
can only be used in sensitive fields, so skipping sensitive fields is
enough to keep secrets out of the output; the state guards (secret
chains, secret values, content hashes, literals) and the cached state
reader are gone.
- New mutator ResolveResourceReferencesForDisplay, run with InitIDs.
- Share the sensitive-field check with validate
(dresources.IsSensitiveResourceField).
- Use config.ResourcesTypes(); log skipped resources at debug level.
- Keep references to explicit nulls; no synced table URL from a name
that still holds a reference.
- Unit test; acceptance test covers cycles and local edits.
aws: TestAccept/bundle/resources/synced_database_tables/basic TestAccept/bundle/resources/postgres_synced_tables/basic
Co-authored-by: Isaac <no-reply@databricks.com>
|
🤖 Response to the reviews on 8780c04, pushed as one commit, 60f9ffa. @Sankalp-Mittal, design: agreed and reworked. A new mutator, @andrewnester, rotation repro: confirmed. review-oss-bot question, splitting the URL changes: both stay here. The job-run order is needed by this change: resolving the current An independent re-review (Astra) of the new head found nothing blocking. I fixed explicit-null interpolation and added per-resource debug logs. The gaps it raised that are not new to this PR are in "Gaps and risks". AI agent (opus5.5, isaac_claude) |
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Review by review-factory (Claude Sonnet 5.5 + Claude Opus 5.5 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.
No issues found.
Changes
bundle summary,bundle openand thepipelines open/logs/historycommands load the ids of deployed resources from state before they show resources (ProcessOptions.InitIDs). A new mutator,ResolveResourceReferencesForDisplay, runs right after that and resolves${resources.*}references in every resource from the config, which now holds those ids. URLs are built afterwards, from the resolved values.Display is best effort, so a reference stays as it is when its value is not known or not safe to show:
""), an explicitnull, or a field only the workspace has;sensitive_fields, for example a secret'svalue). The check is shared withvalidate.SensitiveVariableReferences, which already rejects sensitive variables in non-sensitive fields, so other fields hold no secrets;job_id). Only that resource keeps its references; the others still resolve.Two related URL fixes:
explore/data/<catalog>/<schema>/<table>, like the other table resources (postgres synced tables, schemas, registered models), instead of the dotted name. No URL is built from a name that still holds a reference.job_id. Without this, resolvingjob_idwould point the URL at another job after a local edit.Why
Two Badness notes recorded this:
Before:
After:
and
Name: ${resources.jobs.变量.id}becomesName: [变量_ID].The same fix also changes these outputs:
postgres_synced_tables/basic: the name${resources.postgres_catalogs.my_catalog.catalog_id}.public.trips_syncedresolves, so the summary shows the table's URL.materialization_sets/membership,removal_scope:bundle summary -o jsonshows the resolvedfeature_name.templates/default-python/integration_classic:bundle summary -o jsonshows the job task's resolvedpipeline_id.Tests
unicode_referencealso runsbundle summarybefore deploy: a reference to a job not deployed yet stays a reference.bundle/resource_deps/summary_resolution. After deploy it checks that id and name references resolve, that references to a secret'svaluestay (directly, through another job's name, and through a whole-object reference), and that the full JSON summary contains no secret (contains.py '!s3cr3t'). Then, without deploying, it adds a reference cycle and two resources whose resolved values don't fit their types (an int and a duration), renames a referenced job and points the run at another job: the cycle and the misfits keep their references, the reference shows the new name, the run keeps its URL.TestResolveResourceReferencesForDisplay: id into a string and into an int field, an undeployed id, a secret, a cycle, an explicit null and a type misfit.bundle/andpipelines/: the only other failure isbundle/deploy/mlops-stacks, which also fails on main in this environment.aws:line forsynced_database_tables/basicandpostgres_synced_tables/basicin the last commit message.Gaps and risks
bundle summary -o jsonoutput changes: fields that held a${resources.*}reference now hold the value. That's the purpose of the fix, but a script that parsed the raw reference out of the summary JSON sees a different value.cluster[0]), and children of a value copied through a whole-object reference. The interactivebundle openpicker runs before state is loaded, so its titles still show references.synced_database_tables/basic/test.toml(removesRunsOnDbr). This PR only removes the Badness line there, so a conflict would be trivial.Dashboard
Name: ${resources.database_catalogs.my_catalog.name}.${resources.database_catalogs.my_catalog.database_name}.my_synced_tableName: ${resources.jobs.变量.id}This PR fixes behavior recorded as Badness in acceptance tests.
🤖 AI agent (opus5.5, isaac_claude)
This pull request and its description were written by Isaac.