Skip to content

github_repository_custom_property: avoid panic on empty property_value#3387

Open
SAY-5 wants to merge 3 commits into
integrations:mainfrom
SAY-5:say5/repo-custom-prop-empty-value-3358
Open

github_repository_custom_property: avoid panic on empty property_value#3387
SAY-5 wants to merge 3 commits into
integrations:mainfrom
SAY-5:say5/repo-custom-prop-empty-value-3358

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 2, 2026

Fixes #3358.

resourceGithubRepositoryCustomPropertyCreate indexes propertyValue[0] for non-multi-select property types without a length check. When the user supplies an empty property_value set, the provider panics with index out of range [0] with length 0. Return a clear error instead.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

Copy link
Copy Markdown
Collaborator

@deiga deiga left a comment

Choose a reason for hiding this comment

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

Change looks clean. Could you please add a regression test case for this?

…erty_value

Pin the panic guard for integrations#3358: the Create path used to index
propertyValue[0] without a length check, crashing the provider when
the dynamic-block source produced an empty list despite the schema's
MinItems=1. Reach the guarded branch from a unit test by passing a
nil v3client meta — the empty-list check fires before any API call.

Signed-off-by: SAY-5 <saiasish.cnp@gmail.com>
@SAY-5
Copy link
Copy Markdown
Author

SAY-5 commented May 10, 2026

Pushed c3fd60e, added a unit test that exercises the empty-property_value path for all four single-value property types and asserts a clear error instead of the index-out-of-range panic. Verified locally that the test fails on the pre-fix code and passes on the patched code.

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.

[BUG]: crash while trying to apply "github_organization_custom_properties" and "github_repository_custom_property"

2 participants