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

Fix improper github org member pagination #814

Merged
merged 1 commit into from Sep 21, 2022

Conversation

trufflesteeeve
Copy link
Collaborator

I'm not sure I fully understand why this issue exists. But I think the short version is this: When we attempted to paginate users, we would set a variable's Page value. But that variable appears to not actually be a pointer, despite being added as one. It probably has to do with how struct embedding works. Either way, if we make the overall options variable the whole thing, and update its embedded struct with our page variable, everything works out.

I'm not sure I fully understand why this issue exists. But I think the
short version is this: When we attempted to paginate users, we would set
a variable's Page value. But that variable appears to not actually be a
pointer, despite being added as one. It probably has to do with how
struct embedding works. Either way, if we make the overall options
variable the whole thing, and update its embedded struct with our page
variable, everything works out.
@trufflesteeeve trufflesteeeve requested a review from a team as a code owner September 21, 2022 22:18
}
optsOrg := &github.ListMembersOptions{
PublicOnly: false,
ListOptions: *opts,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good find!

The dereference here means ListOptions is set to the value of opts at this point; if opts changes in the future ListOptions does not.

@dustin-decker dustin-decker merged commit 63fcf33 into main Sep 21, 2022
@dustin-decker dustin-decker deleted the fix-github-add-members-by-org-pagination branch September 21, 2022 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants