+
Skip to content

Create tool to update and validate GitHub v3 API URLs #1477

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

Merged
merged 16 commits into from
Apr 10, 2020

Conversation

gmlewis
Copy link
Collaborator

@gmlewis gmlewis commented Mar 30, 2020

Fixes #1476.

Note that this is a breaking API change because it found receivers that were being passed by value instead of by reference, and these have been fixed and pulled out into a separate PR #1487.

@googlebot googlebot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label Mar 30, 2020
@codecov
Copy link

codecov bot commented Mar 30, 2020

Codecov Report

Merging #1477 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1477   +/-   ##
=======================================
  Coverage   68.12%   68.12%           
=======================================
  Files          94       94           
  Lines        8454     8454           
=======================================
  Hits         5759     5759           
  Misses       1829     1829           
  Partials      866      866           
Impacted Files Coverage Δ
github/actions_workflow_jobs.go 58.46% <ø> (ø)
github/activity_events.go 60.58% <ø> (ø)
github/activity_notifications.go 54.28% <ø> (ø)
github/activity_star.go 76.92% <ø> (ø)
github/activity_watching.go 58.33% <ø> (ø)
github/apps.go 61.81% <ø> (ø)
github/apps_installation.go 57.74% <ø> (ø)
github/apps_manifest.go 57.14% <ø> (ø)
github/apps_marketplace.go 50.68% <ø> (ø)
github/checks.go 56.14% <ø> (ø)
... and 27 more

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 8256b72...6cb681d. Read the comment docs.

Copy link
Collaborator

@wesleimp wesleimp 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 Author

gmlewis commented Apr 8, 2020

Thank you, @wesleimp!

Since this is a non-trivial addition and affects future maintenance, I would like to also get a review from @willnorris to make sure he is on-board with this change before going ahead with it.

No rush, @willnorris - nothing is waiting on this. Thank you!

@gmlewis gmlewis requested a review from willnorris April 8, 2020 12:59
@willnorris
Copy link
Collaborator

I haven't done a thorough review of the generation code, but it certainly looks to be pretty clever (and probably a lot of fun to write!). But it's also rather complex and hefty (and potentially fragile), for maintaining what is a very minor aspect of our godocs. In fact, I think I started include the GitHub doc URLs somewhat on a lark, as just an extra "nice to have".

I think the number of changes in the doc URLs certainly shows how out of date they are, so I'm totally supportive of whatever tools make it easier to keep those up to date. I'm just worried about the ongoing maintenance of it. What do you think of pulling it out of the main github folder, similar to what we did with the scrape package? Maybe even make it its own go module, so it doesn't get downloaded as part of the main module when someone is just using go-github, but not actually contributing to it?

wdyt?

@gmlewis
Copy link
Collaborator Author

gmlewis commented Apr 8, 2020

wdyt?

Great idea! I like it. Thanks, @willnorris ! I'll work on that and update this PR when I've got it moved.

@gmlewis
Copy link
Collaborator Author

gmlewis commented Apr 8, 2020

Tool moved to "update-urls" subdir with its own "go.mod" and "go.sum". PTAL (low priority).
Thank you, Will!

Copy link
Collaborator

@willnorris willnorris left a comment

Choose a reason for hiding this comment

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

Admittedly, I still haven't taken a close look at the doc generation code, but given that it's now separated out, I'm a lot less worried about it.

Ideally, I'd split this out into two commits, one that makes the breaking changes to the few methods that got updated (like in github/users_projects.go, and you mentioned elsewhere about an update to some method receivers?), and a separate commit that updates the doc URLs and adds the update-urls package. Those are really two unrelated things, and so the commits would reflect that.

Otherwise, LGTM.

@gmlewis
Copy link
Collaborator Author

gmlewis commented Apr 9, 2020

That makes sense, Will... thank you!

I'll pull those breaking changes out into a separate PR and not merge this one yet until that one is in.

@gmlewis gmlewis added the DO NOT MERGE Do not merge this PR. label Apr 9, 2020
@gmlewis
Copy link
Collaborator Author

gmlewis commented Apr 9, 2020

This PR is now on hold until #1487 has been merged, which is a prerequisite for tests to pass.

@gmlewis gmlewis changed the title Use go generate to update and validate GitHub v3 API URLs Create tool to update and validate GitHub v3 API URLs Apr 9, 2020
@gmlewis
Copy link
Collaborator Author

gmlewis commented Apr 10, 2020

This PR now contains only changes to comments and the addition of the update-urls tool.
Merging.

@gmlewis gmlewis merged commit 259aa56 into google:master Apr 10, 2020
@gmlewis gmlewis deleted the gen-doc-urls branch April 10, 2020 01:28
n1lesh pushed a commit to n1lesh/go-github that referenced this pull request Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indication that the PR author has signed a Google Contributor License Agreement. DO NOT MERGE Do not merge this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Go generate should validate and fix all documentation URLs
4 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载