Bump google/go-github and shurcooL/githubv4 packages - #560
WallyGuzman wants to merge 1 commit into
Conversation
- Migrate existing table logic to latest versions - Minor modifications for deprecations and API changes - Run `go mod tidy` to prune unused dependencies - Also run `gofmt` on all files to resolve linting issues
cbruno10
left a comment
There was a problem hiding this comment.
Hey @WallyGuzman , thanks for the large amount of updates!
I've left a few initial review comments. I'm still doing testing, but these were the ones I could find through some local testing so far.
If you have any questions, please let me know, thanks!
|
|
||
| // The upload URL is not set as it's not currently required | ||
| conn, err := github.NewClient(client.Client()).WithEnterpriseURLs(uv4.String(), "") | ||
| conn, err := github.NewClient(github.WithEnterpriseURLs(uv4.String(), uv4.String())) |
There was a problem hiding this comment.
This creates a fresh client with no token or transport and replaces the authenticated one from above, so every REST table ends up unauthenticated for anyone with base_url set. I checked against a test server and this shape sends an empty Authorization header.
Passing the existing HTTP client through fixes it:
conn, err := github.NewClient(
github.WithHTTPClient(client.Client()),
github.WithEnterpriseURLs(uv4.String(), uv4.String()),
)Dropping the manual api/v3/ is fine, v89 adds it. Could you try a REST table like github_rate_limit against your GHES instance once this is in?
| "strings" | ||
|
|
||
| "github.com/google/go-github/v55/github" | ||
| "github.com/google/go-github/v89/github" |
There was a problem hiding this comment.
In this file, tags further down (line 50) is now always null. v70 changed PackageVersion.Metadata to json.RawMessage, so FromField("PackageVersion.Metadata.Container.Tags") no longer resolves and the SDK just returns nil. Same package version gives ["0.22.0","latest"] on main and null here.
It'll need a small transform that unmarshals the raw message and pulls out container.tags. metadata itself still renders fine.
| "time" | ||
|
|
||
| "github.com/google/go-github/v55/github" | ||
| "github.com/google/go-github/v89/github" |
There was a problem hiding this comment.
In this file, team (line 41) and repo (line 43) mapped onto AuditEntry.Team/.Repo, which went away in v58, so both are null now. v89 puts those keys in AdditionalFields, and FromField("AdditionalFields.team") / FromField("AdditionalFields.repo") return them.
data (line 44) also changes shape from the typed struct to the full map. Probably an improvement, but worth extra testing.
| "strings" | ||
|
|
||
| "github.com/google/go-github/v55/github" | ||
| "github.com/google/go-github/v89/github" |
There was a problem hiding this comment.
Minor note, but Hook.Config is now a typed *HookConfig, so I think hooks in this file (line 58) and on github_repository will drop any extra keys GitHub returns. Have you seen any changes to the column outputs in your testing?
| } | ||
|
|
||
| //// LIST FUNCTION | ||
| // LIST FUNCTION |
There was a problem hiding this comment.
| // LIST FUNCTION | |
| //// LIST FUNCTION |
Minor note, but the rest of the file uses four slashes for section headers.
| github.com/ghodss/yaml v1.0.0 | ||
| github.com/google/go-github/v55 v55.0.0 | ||
| github.com/shurcooL/githubv4 v0.0.0-20231126234147-1cffa1f02456 | ||
| github.com/google/go-github/v89 v89.0.0 |
There was a problem hiding this comment.
v90 and v91 have shipped since this was opened (v91 on 2026-09-03). Not a blocker, but since every import is being touched anyway it might be worth landing on the current major, after a look at those release notes.
go mod tidyto prune unused dependenciesgofmton all files to resolve linting issuesNote: I've only verified four tables where there is more than a two-line import change, but please let me know if you'd like me to verify anything else. The four are
github_actions_artifact,github_actions_cache,github_gitignore, andgithub_repository_sbom. Thegithub_actions_repository_runnerhad changes, but unfortunately, I don't have any self-hosted runners configured anywhere to test against.Disclaimer: I tried to verify the GHES changes using the on-prem instance at my $DAYJOB, but it looks like *this plugin has had issues even before this change. As an example, running a simple
select * from github_my_repositoryquery returnserr Field 'fundingLinks' doesn't exist on type 'Repository'.Example query results
Results
github_actions_artifact
github_actions_cache
github_gitignore
github_repository_sbom