pipe-cd / pipe-cd/pipecd

Bug: Prevent nil pointer panic in deployment metadata updates

Open Beginner friendly
#7,228 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug
Dominant language
Go
Stars
1.4k
Forks
364
Avg merge
1d 4h
Merged PRs (30d)
84

Description

Bug: Prevent nil pointer panic in deployment metadata updates

Description

UpdateSharedMetadata() and UpdatePluginMetadata() in
pkg/datastore/deploymentstore.go can panic when called with a
deployment whose MetadataV2 field is nil.

Both methods access fields of MetadataV2 without first checking whether
the pointer has been initialized.

Affected Functions

  • UpdateSharedMetadata()
  • UpdatePluginMetadata()

File:

pkg/datastore/deploymentstore.go

Current Behavior

When MetadataV2 == nil, calling UpdateSharedMetadata() results in a
nil pointer dereference while accessing:

d.MetadataV2.Shared

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pkg/datastore/deploymentstore.go by reading UpdateSharedMetadata() and UpdatePluginMetadata(). Reproduce each path with a deployment whose MetadataV2 is nil, then verify both methods complete without a nil pointer panic while preserving their metadata-update behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.