-
Notifications
You must be signed in to change notification settings - Fork 72
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
Support multiple locations for diagnostics #1610
Changes from 10 commits
4bedb54
7ab131f
39b3eea
14a200a
b380344
50b8fa5
4d1e2a0
3b8fc61
83558a6
d9b8902
5b94edd
52c2d2e
6ed74d0
1202bcc
16072f6
a602858
9aedd3d
2ca95a0
4beb8f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import ( | |
|
||
"github.com/databricks/cli/bundle" | ||
"github.com/databricks/cli/libs/diag" | ||
"github.com/databricks/cli/libs/dyn" | ||
) | ||
|
||
func JobClusterKeyDefined() bundle.ReadOnlyMutator { | ||
|
@@ -41,8 +42,11 @@ func (v *jobClusterKeyDefined) Apply(ctx context.Context, rb bundle.ReadOnlyBund | |
diags = diags.Append(diag.Diagnostic{ | ||
Severity: diag.Warning, | ||
Summary: fmt.Sprintf("job_cluster_key %s is not defined", task.JobClusterKey), | ||
Location: loc.Location(), | ||
Path: loc.Path(), | ||
// Show only the location where the job_cluster_key is defined. | ||
// Other associated locations are not relevant since they are | ||
// overridden during merging. | ||
Locations: []dyn.Location{loc.Location()}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eventually I'll followup with a PR to show warnings when scalar configuration is being overridden. |
||
Path: loc.Path(), | ||
}) | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import ( | |
|
||
"github.com/databricks/cli/bundle" | ||
"github.com/databricks/cli/libs/diag" | ||
"github.com/databricks/cli/libs/dyn" | ||
"github.com/databricks/cli/libs/fileset" | ||
"golang.org/x/sync/errgroup" | ||
) | ||
|
@@ -64,10 +65,10 @@ func checkPatterns(patterns []string, path string, rb bundle.ReadOnlyBundle) (di | |
loc := location{path: fmt.Sprintf("%s[%d]", path, index), rb: rb} | ||
mu.Lock() | ||
diags = diags.Append(diag.Diagnostic{ | ||
Severity: diag.Warning, | ||
Summary: fmt.Sprintf("Pattern %s does not match any files", p), | ||
Location: loc.Location(), | ||
Path: loc.Path(), | ||
Severity: diag.Warning, | ||
Summary: fmt.Sprintf("Pattern %s does not match any files", p), | ||
Locations: []dyn.Location{loc.Location()}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does not matter if we use |
||
Path: loc.Path(), | ||
}) | ||
mu.Unlock() | ||
} | ||
|
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.
Note that we display multiple locations here since they are all relevant.