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

Add list options support for environments #2258

Merged
merged 6 commits into from Feb 3, 2022
Merged

Add list options support for environments #2258

merged 6 commits into from Feb 3, 2022

Conversation

chelnak
Copy link
Contributor

@chelnak chelnak commented Jan 17, 2022

Closes #2257

This PR introduces an EnvironmentListOptions parameter for the ListEnvironments method.

Tests have also been updated to reflect the changes and an example has been added to the example directory.

This commit updates existing tests for ListEnvironments to ensure that
they will be compatible with the EnvironmentListOptions implementation.
This commit implements EnvironmentListOptions for the ListEnvironments
method by adding a new parameter and using the addOptions function.

Additionally I've created a new struct called EnvironmentListOptions
and embedded ListOptions with the idea that this could be expanded
one day.
This commit adds an example to show how to work with ListEnvironments
and it's new opts parameter.
@gmlewis gmlewis added the Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). label Jan 17, 2022
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @chelnak !
Just a few changes are needed for the example... then we will be ready for a second LGTM before merging.

example/listenvironments/main.go Outdated Show resolved Hide resolved
example/listenvironments/main.go Outdated Show resolved Hide resolved
example/listenvironments/main.go Outdated Show resolved Hide resolved
example/listenvironments/main.go Outdated Show resolved Hide resolved
example/listenvironments/main.go Show resolved Hide resolved
example/listenvironments/main.go Outdated Show resolved Hide resolved
@gmlewis gmlewis requested a review from wesleimp January 17, 2022 15:29
@codecov
Copy link

codecov bot commented Jan 17, 2022

Codecov Report

Merging #2258 (ee239cd) into master (2950205) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2258   +/-   ##
=======================================
  Coverage   97.81%   97.81%           
=======================================
  Files         114      114           
  Lines       10266    10269    +3     
=======================================
+ Hits        10042    10045    +3     
  Misses        156      156           
  Partials       68       68           
Impacted Files Coverage Δ
github/repos_environments.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2950205...ee239cd. Read the comment docs.

Made some minor change to this example that include removing os.Exit(),
fixing some unnecessary variable declarations and godoc improvements.
@chelnak
Copy link
Contributor Author

chelnak commented Jan 17, 2022

@gmlewis All of your comments should now be resolved. Thanks for taking the time to review.

"unnecessary leading newline (whitespace)"
Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @chelnak !
LGTM.
Awaiting second LGTM before merging.

@chelnak
Copy link
Contributor Author

chelnak commented Jan 24, 2022

Hello! Is there anything else you would like me to change for this PR?

@gmlewis
Copy link
Collaborator

gmlewis commented Jan 24, 2022

Hello! Is there anything else you would like me to change for this PR?

No, thank you. We are awaiting any other contributor to this repo to give an LGTM and approve this PR before merging.

@chelnak
Copy link
Contributor Author

chelnak commented Feb 2, 2022

Hey hey! Hope everything is going well! Wondering if we could request a review from another contributor 🙏? Appreciate everyone is super busy though.

@gmlewis
Copy link
Collaborator

gmlewis commented Feb 3, 2022

Sorry for the delay, @chelnak !
Hopefully by tomorrow we will be able to get this one merged. Maybe @Parker77 has time to review?

@chelnak
Copy link
Contributor Author

chelnak commented Feb 3, 2022

Thank you 🙏 😄

Copy link

@Parker77 Parker77 left a comment

Choose a reason for hiding this comment

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

LGTM.

@gmlewis
Copy link
Collaborator

gmlewis commented Feb 3, 2022

Than you, @Parker77 !
Merging.

@gmlewis gmlewis merged commit bda32dc into google:master Feb 3, 2022
@fun4cash
Copy link

fun4cash commented Apr 7, 2022

import "github.com/google/go-github/v43/github"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support pagination for ListEnvironments
4 participants