databricks / cli

Databricks CLI
Other
115 stars 39 forks source link

Job name normalization #1537

Open blood-onix opened 4 days ago

blood-onix commented 4 days ago

Describe the issue

In a particular cases bundle generate job --existing-job-id and UI giving different results for job resource names.

If job name starts with a special symbol, for example job name - "[TEST] Some Name", UI will set resource name as "TEST_Some_Name" in "View YAML/JSON"

image

And bundle generate will call it - "_test__some_name"

image

image

In general its not a big deal, at least untill you will try to ref this job in a run_job_task. So as far as you will try to use ${resources.jobs._test__some_name.id} it will fail image

image

Once the underscore is removed from the beginning of the resource name - deployment will start working without issues (file itself and resource name in it obviously renamed as well) image image

Althought terraform support underscores in the beggining of the resource names, probably its just easier to use same pattern for name normalizationas in UI?

Steps to reproduce the behavior

Please list the steps required to reproduce the issue, for example:

  1. Create a job with name strating from any special symbol
  2. Run bundle generate job --existing-job-id
  3. Resource name will start with underscore

Expected Behavior

Most likely if job name strating from a special symbol it should be truncated as it done in the UI.

Actual Behavior

Special symbol in beginning of the name converted to underscore as others.

OS and CLI version

cli 0.222, tested on 0.214 and 0.215