Skip to content

Move examples dir into its own Go module - #2310

Merged
gmlewis merged 1 commit into
google:masterfrom
wlynch:example-module
Mar 8, 2022
Merged

Move examples dir into its own Go module#2310
gmlewis merged 1 commit into
google:masterfrom
wlynch:example-module

Conversation

@wlynch

@wlynchwlynch commented Mar 2, 2022

Copy link
Copy Markdown
Contributor

We (in particular shoutout to @asvoboda for noticing this in bradleyfalzon/ghinstallation#63)
noticed that go-github has an example that references ghinstallation,
which causes a circular module dependency. While this is technically
fine (https://go.dev/ref/mod#minimal-version-selection should resolve
it), there's probably not a strong reason to pull in ghinstallation and
other example dependencies not needed by the core github package unless
it is strictly needed.

This just breaks the example folder into its own module so that users
can import the core go-github package with the minimal set of
dependencies. This should not affect any functionality.
I tried to keep versions roughly the same for compatibility, though
replaced the go-github dependency with the parent to try and keep
examples up-to-date with HEAD (this could possibly be replaced with
https://go.dev/ref/mod#workspaces later).

@codecov

codecovBot commented Mar 2, 2022

Copy link
Copy Markdown

Codecov Report

Merging #2310 (0c53a68) into master (2a15bc2) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@ Coverage Diff @@## master #2310 +/- ##
=======================================
Coverage 97.84% 97.84% =======================================
Files 115 115 Lines 10403 10403 =======================================
Hits 10179 10179 Misses 156 156 Partials 68 68 

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 2a15bc2...0c53a68. Read the comment docs.

Comment threadexample/go.mod Outdated
We notices that go-github has an example that references ghinstallation,
which causes a circular module dependency. While this is technically
fine (https://go.dev/ref/mod#minimal-version-selection should resolve
it), there's probably not a strong reason to pull in ghinstallation and
other example dependencies not needed by the core github package unless
it is strictly needed.
This just breaks the example folder into its own module so that users
can import the core go-github package with the minimal set of
dependencies. This should not affect any functionality.
I tried to keep versions the roughly same for compatibility, though
replaced the go-github dependency with the parent to try and keep
examples up-to-date with HEAD (this could possibly be replaced with
https://go.dev/ref/mod#workspaces later).

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, @wlynch !
(In the future, please don't force-push PRs for this repo, as we always squash-and-merge at the end anyway... see CONTRIBUTING.md for more details.)
LGTM.

Awaiting second LGTM from any other contributor to this repo.

@frioux

Copy link
Copy Markdown

Looking forward to this one getting merged. The fact that the current release expresses a dependency on an older version of itself... seems not great 😅

@gmlewis

gmlewis commented Mar 8, 2022

Copy link
Copy Markdown
Collaborator

Looking forward to this one getting merged. The fact that the current release expresses a dependency on an older version of itself... seems not great 😅

If you (or any other contributor) give me a second LGTM/Approval, @frioux , I can go ahead and merge it. 😁

@asvoboda

Copy link
Copy Markdown
Contributor

👍 LGTM.

@gmlewis

Copy link
Copy Markdown
Collaborator

Thank you, @asvoboda !
Merging.

@gmlewisgmlewis changed the title Move examples into its own Go moduleMove examples dir into its own Go moduleMar 8, 2022
@gmlewis
gmlewis merged commit b4e931b into google:masterMar 8, 2022
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Sign up for freeto 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.

4 participants

@wlynch@frioux@gmlewis@asvoboda