Skip to content
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

r/membership: Fix import crash on incorrect ID #72

Merged
merged 1 commit into from
Feb 12, 2018

Conversation

vancluever
Copy link
Contributor

@vancluever vancluever commented Feb 7, 2018

An incorrect two-part ID supplied to github_membership during import
results in a crash - this is because the import functionality is passing
this directly to the Read function of the resource, for which IDs are
programatically controlled and a panic there would be more telling of a
much more serious error worthy of panicking over.

This adds an internal validation function for two-part IDs, and wraps
the resource's import functionality to use it to validate incoming IDs
before passing them to Read.

@vancluever vancluever added Type: Bug Something isn't working as documented crash labels Feb 7, 2018
An incorrect two-part ID supplied to github_membership during import
results in a crash - this is because the import functionality is passing
this directly to the Read function of the resource, for which IDs are
programatically controlled and a panic there would be more telling of a
much more serious error worthy of panicking over.

This adds an internal validation function for two-part IDs, and wraps
the resource's import functionality to use it to validate incoming IDs
before passing them to Read.
@vancluever vancluever force-pushed the b-membership-import-crash branch from 6273c49 to 466389d Compare February 7, 2018 19:21
Copy link
Contributor

@paddycarver paddycarver left a comment

Choose a reason for hiding this comment

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

LGTM!

@paddycarver paddycarver merged commit 01dfa09 into master Feb 12, 2018
@paultyng paultyng deleted the b-membership-import-crash branch September 8, 2020 13:22
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
…hip-import-crash

r/membership: Fix import crash on incorrect ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants