Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Fix `${resources...}` references to resource keys ending in an underscore (e.g. `my_job_`). Deploying such a resource with `permissions` or `grants` failed with `cannot parse "/jobs/${resources.jobs.my_job_.id}"`, which also made the automatic migration of Terraform-deployed bundles fail. ([#6965](https://github.com/databricks/cli/pull/6965))
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
bundle:
name: test-bundle

# Reproduce: resource keys with a trailing underscore caused "cannot parse" on the
# direct engine because the reference regex required segments to end with a letter or digit.
resources:
jobs:
job_:
name: trailing underscore
permissions:
- level: CAN_VIEW
group_name: users
_job__:
name: leading and trailing underscores
ref:
name: "a=${resources.jobs.job_.id} b=${resources.jobs._job__.id}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cloud = false
EnvMatrix.DMS = ["", "true"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
Created jobs._job__
Created jobs.job_
Created jobs.job_.permissions
Created jobs.ref
Files: 1 uploaded, 0 deleted
Resources: 4 created, 0 changed, 0 deleted, 0 unchanged
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
trace $CLI bundle deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RecordRequests = false

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.

With requests not recorded, the output only shows that the deploy didn't fail. If _job__ stopped matching, jobs.ref would still be created, with the literal ${resources.jobs._job__.id} in its name, and this test would pass. Can you record requests and print the jobs/create payloads (as escaped_ref does, with --nostamp so both DMS variants agree) so the resolved name is in output.txt? Or is Created jobs.job_.permissions considered enough here, as in underscore_key_reference?

Loading