cli icon indicating copy to clipboard operation
cli copied to clipboard

Add configurable presets for name prefixes, tags, etc.

Open lennartkats-db opened this issue 1 year ago • 4 comments

Changes

This adds configurable transformations based on the transformations currently seen in mode: development.

  • [ ] This PR includes https://github.com/databricks/cli/pull/1590 and should be merged together.

Example databricks.yml showcasing how some transformations:

bundle:
  name: my_bundle

targets:
  dev:
    presets:
      prefix: "myprefix_"          # prefix all resource names with myprefix_
      pipelines_development: true  # set development to true by default for pipelines
      trigger_pause_status: PAUSED # set pause_status to PAUSED by default for all triggers and schedules
      jobs_max_concurrent_runs: 10 # set max_concurrent runs to 10 by default for all jobs
      tags:
        dev: true

Tests

  • Existing process_target_mode tests that were adapted to use this new code
  • Unit tests specific for the new mutator
  • Unit tests for config loading and merging
  • Manual e2e testing

lennartkats-db avatar Jun 12 '24 15:06 lennartkats-db

Codecov Report

Attention: Patch coverage is 75.00000% with 48 lines in your changes missing coverage. Please review.

Project coverage is 53.69%. Comparing base (e22dd8a) to head (4dc5f41). Report is 142 commits behind head on main.

Files Patch % Lines
bundle/config/mutator/process_target_mode.go 68.57% 16 Missing and 6 partials :warning:
bundle/config/mutator/apply_transforms.go 84.82% 12 Missing and 5 partials :warning:
bundle/config/root.go 16.66% 4 Missing and 1 partial :warning:
bundle/config/transforms.go 0.00% 4 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1490      +/-   ##
==========================================
+ Coverage   52.25%   53.69%   +1.43%     
==========================================
  Files         317      353      +36     
  Lines       18004    20406    +2402     
==========================================
+ Hits         9408    10956    +1548     
- Misses       7903     8642     +739     
- Partials      693      808     +115     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jun 14 '24 12:06 codecov-commenter

Thanks, will be great to have this.

pietern avatar Jun 18 '24 06:06 pietern

@pietern could you take another look?

lennartkats-db avatar Jul 11 '24 13:07 lennartkats-db

@pietern PTAL, I took another pass here

lennartkats-db avatar Jul 19 '24 19:07 lennartkats-db

When ready, I'd like to first merge https://github.com/databricks/cli/pull/1590. cc @pietern

lennartkats-db avatar Aug 16 '24 07:08 lennartkats-db