DAB dynvar: cannot parse resource keys starting with digits when permissions are set

Open
#7,387 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
66/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
cli

Research direction

Start by tracing how the CLI parses resource references such as ${resources.jobs.00_clear_silver_and_gold.id} while planning resource permissions, then compare that path with the case where permissions are absent. Reproduce with the YAML example using databricks bundle plan or deploy; done when a resource key beginning with digits plans successfully with permissions.

Written by the indexing model from the issue text.

Description

Problem

Resource keys starting with a digit (e.g. 00_clear_silver_and_gold) fail with cannot parse when permissions are defined on the resource.

Error message:
Error: cannot plan resources.jobs.00_clear_silver_and_gold.permissions: cannot parse "/jobs/${resources.jobs.00_clear_silver_and_gold.id}" Error: planning failed

The same key works fine without permissions. Renaming the key to not start with a digit (e.g. clear_silver_and_gold) while keeping name: 00_clear_silver_and_gold resolves the issue.

Reproduction

CLI version: 1.7.0

resources:
  jobs:
    00_clear_silver_and_gold:
      name: 00_clear_silver_and_gold
      permissions:
        - group_name:  engineer-group
          level: CAN_MANAGE
        - group_name: admin-group
          level: CAN_MANAGE
      tasks:
        - task_key: example_task
          notebook_task:
            notebook_path: ${workspace.file_path}/src/example

Running databricks bundle deploy or databricks bundle plan produces:
Error: cannot plan resources.jobs.00_clear_silver_and_gold.permissions: cannot parse "/jobs/${resources.jobs.00_clear_silver_and_gold.id}"

Expected behavior
Resource keys starting with digits should be supported, consistent with how Terraform and the Databricks API handle job names.

Dominant language
Go
Stars
427
Forks
267
Avg merge
2d 1h
Merged PRs (30d)
233

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from databricks/cli

All issues in databricks/cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.