Skip to content

Be strict about capturing UC dependencies (disallow references or extra dot-separated components) - #6667

Merged
janniklasrose merged 4 commits into
mainfrom
janniklasrose/uc-dependencies-references
Sep 15, 2026
Merged

janniklasrose merged 4 commits into
mainfrom
janniklasrose/uc-dependencies-references

Conversation

@janniklasrose

@janniklasrose janniklasrose commented Sep 14, 2026

Copy link
Copy Markdown
Member

Follow-up to #6655.

CaptureUCDependencies parsed compound UC names. We now bail early for every resource if a ${resources.*} reference is still there - users are expected to either declare every UC component via reference or none.

Parsing out the components is also strict, requiring the expected number of dot-separated values.

janniklasrose and others added 2 commits September 14, 2026 10:14
CaptureUCDependencies parsed compound UC names (vector search index
Name, quality monitor OutputSchemaName, model service Parent) with
strings.SplitN, which split on the dots inside a ${resources...}
reference and produced nonsensical catalog/schema fragments. It only
worked by accident: the fragments matched nothing, so the name was
reconstructed unchanged.

Make reference handling explicit:
- splitUCName treats a ${...} reference as atomic so a reference in any
  component no longer breaks parsing.
- resolveCatalog/resolveSchema leave a component that is already an
  explicit reference untouched.
- findSchema normalizes a catalog reference back to its literal name
  (via literalCatalogName), so a literal schema is still captured when
  its catalog is written as a ${resources.catalogs.<key>.name} reference.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
// splitUCName splits a UC identifier on "." into at most n parts, like
// strings.SplitN, but treats a ${...} reference as atomic so the dots inside a
// reference (e.g. ${resources.catalogs.c.name}) do not create extra splits.
func splitUCName(name string, n int) []string {

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.

do we need to parse? should we just skip the implicit linking if we detect references or other divergence from a.b.c format (like unexpected number of components)?

what extra cases we solve by having this parser (which may work differently from our actual variable parser)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

we can use dynvar.ContainsVariableReference early inside Apply(), but then we miss out on

${references.catalogs.my_catalog.name}.${var.my_schema}.my_vs_index

which at the time of capture_uc_dependencies is

${references.catalogs.my_catalog.name}.my_schema.my_vs_index

but you could argue that if you're already using references, you should be using it for all components. there's pros & cons to either (better user experience vs less maintainance).

or other divergence from a.b.c format (like unexpected number of components)?

seems a bit restricting but works for the currently onboarded resources. SplitN works also for e.g.

field := "foobar/mycatalog.myschema.my-custom.name"
rest := strings.CutPrefix(field, "foobar/")
parts := strings.SplitN(rest, ".", 3)
// use parts[0] and parts[1]

but we can revisit if a resource ever adopts that pattern

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: da87e82

Run: 34840420656

Env 🔄​flaky 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux 1 275 16 8:01
🔄​ aws windows 1 1 276 14 5:34
💚​ azure linux 1 274 16 9:07
💚​ azure windows 1 276 14 6:19
💚​ gcp linux 1 275 16 8:33
🔄​ gcp windows 1 1 276 14 6:06
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🔄​ TestSyncIncrementalFileOverwritesFolder ✅​p 🔄​f ✅​p ✅​p ✅​p ✅​p
🔄​ TestSyncIncrementalFileSync ✅​p ✅​p ✅​p ✅​p ✅​p 🔄​f
Top 6 slowest tests (at least 2 minutes):
duration env testname
4:59 azure windows TestAccept
4:38 aws windows TestAccept
3:56 gcp linux TestAccept
3:53 azure linux TestAccept
3:53 aws linux TestAccept
3:28 gcp windows TestAccept

@janniklasrose
janniklasrose requested a review from denik September 14, 2026 11:52
@janniklasrose janniklasrose changed the title Capture UC dependencies inside names that already use references Be strict about capturing UC dependencies (disallow references or extra dot-separated components) Sep 14, 2026
@denik

denik commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

PR description seems out of date?

Reference-aware split (splitUCName) treats a ${...} reference as atomic, so a reference in any component no longer breaks parsing.

this is no longer here, right?

@janniklasrose

Copy link
Copy Markdown
Member Author

@denik dropped AI summary, hand-write what's done

@janniklasrose
janniklasrose added this pull request to the merge queue Sep 15, 2026
Merged via the queue into main with commit c92dc2f Sep 15, 2026
34 checks passed
@janniklasrose
janniklasrose deleted the janniklasrose/uc-dependencies-references branch September 15, 2026 11: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.

3 participants