Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added --restart flag for bundle run command #1191

Merged
merged 3 commits into from
Feb 9, 2024
Merged

Added --restart flag for bundle run command #1191

merged 3 commits into from
Feb 9, 2024

Conversation

andrewnester
Copy link
Contributor

Changes

Added --restart flag for bundle run command

When running with this flag, bundle run will cancel all existing runs before starting a new one

Tests

Manually

@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2024

Codecov Report

Attention: 22 lines in your changes are missing coverage. Please review.

Comparison is base (4073e45) 51.92% compared to head (51ef679) 51.93%.
Report is 1 commits behind head on main.

Files Patch % Lines
cmd/bundle/run.go 0.00% 10 Missing ⚠️
bundle/run/job.go 70.00% 6 Missing and 3 partials ⚠️
bundle/run/pipeline.go 72.72% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1191      +/-   ##
==========================================
+ Coverage   51.92%   51.93%   +0.01%     
==========================================
  Files         299      299              
  Lines       16554    16605      +51     
==========================================
+ Hits         8595     8624      +29     
- Misses       7335     7353      +18     
- Partials      624      628       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

cmd/bundle/run.go Outdated Show resolved Hide resolved
bundle/run/job.go Show resolved Hide resolved
bundle/run/pipeline.go Show resolved Hide resolved
cmd/bundle/run.go Outdated Show resolved Hide resolved
internal/bundle/bind_resource_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

While it looks pretty straightforward, I'd love a bit of coverage on the cancel functions.

Also, how does this work for continuous jobs/pipelines? E.g. do they transition to the idle state or immediately start again? If the status is pinned to the job run or pipeline update it can be isolated but would be good to confirm what happens.

@andrewnester
Copy link
Contributor Author

@pietern added unit tests. As to continuous runs: restart flag will cancel existing run and start a new one as it would with non-continuos one

To have your continuous job pick up a new job configuration, cancel the existing run and then a new run automatically starts. You can also click Restart run to restart the job run with the updated configuration.
Selecting Run now on a continuous job that is paused triggers a new job run. If the job is unpaused, an exception is thrown.

Confirmed it manually

Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

Thanks!

@andrewnester andrewnester added this pull request to the merge queue Feb 9, 2024
Merged via the queue into main with commit bc30c9e Feb 9, 2024
4 checks passed
@andrewnester andrewnester deleted the restart-run branch February 9, 2024 14:39
andrewnester added a commit that referenced this pull request Feb 15, 2024
CLI:
 * Ignore environment variables for `auth profiles` ([#1189](#1189)).
 * Update LICENSE ([#1013](#1013)).

Bundles:
 * Added `bundle deployment bind` and `unbind` command ([#1131](#1131)).
 * Use allowlist for Git-related fields to include in metadata ([#1187](#1187)).
 * Added `--restart` flag for `bundle run` command ([#1191](#1191)).
 * Generate correct YAML if custom_tags or spark_conf is used for pipeline or job cluster configuration ([#1210](#1210)).

Internal:
 * Move folders package into libs ([#1184](#1184)).
 * Log time it takes for profile to load ([#1186](#1186)).
 * Use mockery to generate mocks compatible with testify/mock ([#1190](#1190)).
 * Retain partially valid structs in `convert.Normalize` ([#1203](#1203)).
 * Skip `for_each_task` when generating the bundle schema ([#1204](#1204)).
 * Regenerate the CLI using the same OpenAPI spec as the SDK ([#1205](#1205)).
 * Avoid race-conditions while executing sub-commands ([#1201](#1201)).

API Changes:
 * Changed `databricks connections delete` command with new required argument order.
 * Changed `databricks connections get` command with new required argument order.
 * Changed `databricks connections update` command with new required argument order.
 * Added `databricks tables exists` command.
 * Changed `databricks volumes delete` command with new required argument order.
 * Changed `databricks volumes read` command with new required argument order.
 * Changed `databricks volumes update` command with new required argument order.
 * Added `databricks lakehouse-monitors` command group.
 * Removed `databricks files get-status` command.
 * Added `databricks files create-directory` command.
 * Added `databricks files delete-directory` command.
 * Added `databricks files get-directory-metadata` command.
 * Added `databricks files get-metadata` command.
 * Added `databricks files list-directory-contents` command.
 * Removed `databricks pipelines reset` command.
 * Changed `databricks account settings delete-personal-compute-setting` command with new required argument order.
 * Removed `databricks account settings read-personal-compute-setting` command.
 * Changed `databricks account settings update-personal-compute-setting` command with new required argument order.
 * Added `databricks account settings get-personal-compute-setting` command.
 * Removed `databricks settings delete-default-workspace-namespace` command.
 * Removed `databricks settings read-default-workspace-namespace` command.
 * Removed `databricks settings update-default-workspace-namespace` command.
 * Added `databricks settings delete-default-namespace-setting` command.
 * Added `databricks settings delete-restrict-workspace-admins-setting` command.
 * Added `databricks settings get-default-namespace-setting` command.
 * Added `databricks settings get-restrict-workspace-admins-setting` command.
 * Added `databricks settings update-default-namespace-setting` command.
 * Added `databricks settings update-restrict-workspace-admins-setting` command.
 * Changed `databricks token-management create-obo-token` command with new required argument order.
 * Changed `databricks token-management get` command to return .
 * Changed `databricks clean-rooms delete` command with new required argument order.
 * Changed `databricks clean-rooms get` command with new required argument order.
 * Changed `databricks clean-rooms update` command with new required argument order.
 * Changed `databricks dashboards create` command . New request type is .
 * Added `databricks dashboards update` command.

OpenAPI commit c40670f5a2055c92cf0a6aac92a5bccebfb80866 (2024-02-14)
Dependency updates:
 * Bump github.com/hashicorp/hc-install from 0.6.2 to 0.6.3 ([#1200](#1200)).
 * Bump golang.org/x/term from 0.16.0 to 0.17.0 ([#1197](#1197)).
 * Bump golang.org/x/oauth2 from 0.16.0 to 0.17.0 ([#1198](#1198)).
 * Bump github.com/databricks/databricks-sdk-go from 0.30.1 to 0.32.0 ([#1199](#1199)).
@andrewnester andrewnester mentioned this pull request Feb 15, 2024
github-merge-queue bot pushed a commit that referenced this pull request Feb 15, 2024
CLI:
* Ignore environment variables for `auth profiles`
([#1189](#1189)).
* Update LICENSE file to match Databricks license language
([#1013](#1013)).

Bundles:
* Added `bundle deployment bind` and `unbind` command
([#1131](#1131)).
* Use allowlist for Git-related fields to include in metadata
([#1187](#1187)).
* Added `--restart` flag for `bundle run` command
([#1191](#1191)).
* Generate correct YAML if `custom_tags` or `spark_conf` is used for
pipeline or job cluster configuration
([#1210](#1210)).

Internal:
* Move folders package into libs
([#1184](#1184)).
* Log time it takes for profile to load
([#1186](#1186)).
* Use mockery to generate mocks compatible with testify/mock
([#1190](#1190)).
* Retain partially valid structs in `convert.Normalize`
([#1203](#1203)).
* Skip `for_each_task` when generating the bundle schema
([#1204](#1204)).
* Regenerate the CLI using the same OpenAPI spec as the SDK
([#1205](#1205)).
* Avoid race-conditions while executing sub-commands
([#1201](#1201)).

API Changes:
 * Added `databricks tables exists` command.
 * Added `databricks lakehouse-monitors` command group.
 * Removed `databricks files get-status` command.
 * Added `databricks files create-directory` command.
 * Added `databricks files delete-directory` command.
 * Added `databricks files get-directory-metadata` command.
 * Added `databricks files get-metadata` command.
 * Added `databricks files list-directory-contents` command.
 * Removed `databricks pipelines reset` command.
* Changed `databricks account settings delete-personal-compute-setting`
command with new required argument order.
* Removed `databricks account settings read-personal-compute-setting`
command.
* Changed `databricks account settings update-personal-compute-setting`
command with new required argument order.
* Added `databricks account settings get-personal-compute-setting`
command.
* Removed `databricks settings delete-default-workspace-namespace`
command.
* Removed `databricks settings read-default-workspace-namespace`
command.
* Removed `databricks settings update-default-workspace-namespace`
command.
 * Added `databricks settings delete-default-namespace-setting` command.
* Added `databricks settings delete-restrict-workspace-admins-setting`
command.
 * Added `databricks settings get-default-namespace-setting` command.
* Added `databricks settings get-restrict-workspace-admins-setting`
command.
 * Added `databricks settings update-default-namespace-setting` command.
* Added `databricks settings update-restrict-workspace-admins-setting`
command.
* Changed `databricks token-management create-obo-token` command with
new required argument order.
 * Changed `databricks token-management get` command to return .
* Changed `databricks dashboards create` command . New request type is .
 * Added `databricks dashboards update` command.

OpenAPI commit c40670f5a2055c92cf0a6aac92a5bccebfb80866 (2024-02-14)
Dependency updates:
* Bump github.com/hashicorp/hc-install from 0.6.2 to 0.6.3
([#1200](#1200)).
* Bump golang.org/x/term from 0.16.0 to 0.17.0
([#1197](#1197)).
* Bump golang.org/x/oauth2 from 0.16.0 to 0.17.0
([#1198](#1198)).
* Bump github.com/databricks/databricks-sdk-go from 0.30.1 to 0.32.0
([#1199](#1199)).

---------

Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
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.

None yet

3 participants