-
Notifications
You must be signed in to change notification settings - Fork 125
Add support for generate for alerts #4108
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
Conversation
|
Commit: 834b5b0
27 interesting tests: 21 KNOWN, 3 RECOVERED, 2 FAIL, 1 SKIP
Top 18 slowest tests (at least 2 minutes):
|
denik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, but tests need fixing
| } | ||
|
|
||
| cmd.Flags().StringVar(&alertID, "existing-id", "", `ID of the alert to generate configuration for`) | ||
| cmd.Flags().StringVar(&alertID, "existing-alert-id", "", `ID of the alert to generate configuration for`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd.Flags().StringVar(&alertID, "existing-id", "",
ID of the alert to generate configuration for)
cmd.Flags().StringVar(&alertID, "existing-alert-id", "",ID of the alert to generate configuration for)
what the difference between these two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have something similar in dashboards as well, so to keep things consistent:
// Alias lookup flags that include the resource type name.
// Included for symmetry with the other generate commands, but we prefer the shorter flags.
cmd.Flags().StringVar(&d.existingPath, "existing-dashboard-path", "", `workspace path of the dashboard to generate configuration for`)
cmd.Flags().StringVar(&d.existingID, "existing-dashboard-id", "", `ID of the dashboard to generate configuration for`)
cmd.Flags().MarkHidden("existing-dashboard-path")
cmd.Flags().MarkHidden("existing-dashboard-id")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a comment clarifying this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have a preferred way then the other is deprecated? In that case, we can skip it for new resources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the goal was symmetry (cc: @pietern ). I don't mind it either way. The flag is hidden so users will not be encouraged to use it.
| if errors.As(err, &apiErr) && apiErr.StatusCode == 404 { | ||
| return fmt.Errorf("alert with ID %s not found", alertID) | ||
| } | ||
| return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could libs/diag/sdk_error.go be useful here to show error in full? or perhaps somewhere at the caller side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea but I don't think we should do it here. We can solve this in general by modifying the main function and logging the API error details everytime we see an apierr.APIError.
|
|
||
| // FilePath points to the local `.dbalert.json` file containing the alert definition. | ||
| // This is inlined into the alert during deployment. | ||
| FilePath string `json:"file_path,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is part of https://github.com/databricks/cli/pull/3602/files right? You can specify different target branch so that this does not show up in diff (for easier review).
|
|
|
Commit: 04d744a
50 interesting tests: 22 FAIL, 20 KNOWN, 4 RECOVERED, 2 flaky, 1 SKIP, 1 MISS
Top 50 slowest tests (at least 2 minutes):
|
- Remove #4135 (already released in v0.281.0) - Update #4081 reference to #4101 (use PR instead of issue) - Add #4108 (bundle generate alert command) - Add #3602 (.dbalert.json files support) - Add #4169 (SYSTEM_TEAMFOUNDATIONCOLLECTIONURI for Azure DevOps OIDC) - Move domain_friendly_name entry from CLI to Bundles section - Normalize formatting (backticks, verb tense, wording consistency) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## Changes - Remove #4135 (already released in v0.281.0) - Update #4081 reference to #4101 (use PR instead of issue) - Add #4108 (bundle generate alert command) - Add #3602 (.dbalert.json files support) - Add #4169 (SYSTEM_TEAMFOUNDATIONCOLLECTIONURI for Azure DevOps OIDC) - Move domain_friendly_name entry from CLI to Bundles section - Normalize formatting (backticks, verb tense, wording consistency) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
## Release v0.282.0 ### Notable Changes * engine/direct: New plan format (v2) ([#4201](#4201)) ### CLI * Skip non-exportable objects (e.g., `MLFLOW_EXPERIMENT`) during `workspace export-dir` instead of failing ([#4101](#4101)) ### Bundles * Allow `domain_friendly_name` to be used in `name_prefix` in development mode ([#4173](#4173)) * Add missing schema grants privileges ([#4139](#4139)) * Add support for `bundle generate alert` command ([#4108](#4108)) * Add support for `.dbalert.json` files ([#3602](#3602)) * Pass `SYSTEM_TEAMFOUNDATIONCOLLECTIONURI` from env to the Terraform provider for Azure DevOps OIDC auth ([#4169](#4169)) * Add `ipykernel` to the `default` template to enable Databricks Connect notebooks in Cursor/VS Code ([#4164](#4164)) * Add interactive SQL warehouse picker to `default-sql` and `dbt-sql` bundle templates ([#4170](#4170)) * Add `name`, `target` and `mode` fields to the deployment metadata file ([#4180](#4180)) * engine/direct: Fix app deployment failure when app is in `DELETING` state ([#4176](#4176)) * engine/direct: Changes in config that match remote changes no longer trigger an update ([#4201](#4201))
Changes
Adds support for
databricks bundle generate alertcommand to generate bundle configuration from existing SQL alerts.Why
This allows users to import existing alerts into bundles
Usage
Generate configuration from existing alert
This creates:
resources/<alert-name>.alert.yml- Bundle configuration with alert settingssrc/<alert-name>.dbalert.json- Complete alert definitionUpdate existing bundle resource
Tests
Note: It should be merged after: #3602