fix: guard against nil target entries in bundle debug list-targets#5203
Merged
fix: guard against nil target entries in bundle debug list-targets#5203
Conversation
denik
approved these changes
May 7, 2026
Contributor
this could be an acceptance test |
janniklasrose
approved these changes
May 7, 2026
| t := targets[name] | ||
| // YAML decoding can leave a nil entry in the map when a target is | ||
| // declared with a null value. Skip rather than dereference and panic. | ||
| if t == nil { |
Contributor
There was a problem hiding this comment.
would be nice to have an example to reproduce
Contributor
There was a problem hiding this comment.
bundle:
name: list-targets-nil-repro
targets:
dev:
default: true
workspace:
host: https://dev.example.com
staging:
prod:
workspace:
host: https://prod.example.commaybe let's add an acceptance test as follow-up?
YAML decoding can leave a nil *config.Target in the targets map when a target is declared with a null value, causing collectTargets to panic on field access. Skip nil entries while still listing the target name.
9e49d2b to
d8f0ffe
Compare
2 tasks
deco-sdk-tagging Bot
added a commit
that referenced
this pull request
May 7, 2026
## Release v0.299.1 ### CLI * `databricks api` now works against unified hosts. Adds `--account` to scope a call to the account API and `--workspace-id` to override the workspace routing identifier per call. A `?o=<workspace-id>` query parameter on the path (the SPOG URL convention used by the Databricks UI) is also recognized as a per-call workspace override, so URLs pasted from the browser route correctly. * JSON output for single objects now uses standard `"key": "value"` spacing (matching list output and `encoding/json` defaults). ### Bundles * Validate that resource keys do not contain variable references ([#5169](#5169)) * engine/direct: Drop the deployment state entry on a recreate before the follow-up `Create`, so a `Create` failure no longer leaves a broken state with `invalid state: empty id` on the next `bundle plan` ([#5173](#5173)). * `bundle debug list-targets`: skip nil entries in the targets map instead of panicking when a target is declared with a null value ([#5203](#5203)). ### Dependency updates * Added `github.com/jackc/pgx/v5` v5.9.1 (MIT) as a new dependency. Used by an experimental Postgres command added in this release; the package is dormant for users who do not invoke that command.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bundle debug list-targetspanics with a nil pointer dereference atcmd/bundle/debug/list_targets.go:40when the targets map contains a nil*config.Target.collectTargetsthen dereferencest.Default/t.Modewithout a nil check.Test plan
./task testpasses.databricks.ymlwith a null-valued target lists its name and exits 0 instead of panicking.