Skip to content

Bump google/go-github and shurcooL/githubv4 packages - #560

Open
WallyGuzman wants to merge 1 commit into
turbot:mainfrom
WallyGuzman:bump_github_package_versions
Open

WallyGuzman wants to merge 1 commit into
turbot:mainfrom
WallyGuzman:bump_github_package_versions

Conversation

@WallyGuzman

@WallyGuzman WallyGuzman commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
  • 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

Note: 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, and github_repository_sbom. The github_actions_repository_runner had 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_repository query returns err Field 'fundingLinks' doesn't exist on type 'Repository'.

Example query results

Results

github_actions_artifact

> .output line;
> select
  *
from
  github_actions_artifact
where
  repository_full_name = 'turbot/steampipe' limit 1;
-[ RECORD 1  ]---------------------------------------------------------------------------
login_id             | MDQ6VXNlcjM2MjM0MjY=
repository_full_name | turbot/steampipe
name                 | test-logs-plugin-ubuntu-latest
id                   | 8,614,273,598
size_in_bytes        | 31,543
archive_download_url | https://api.github.com/repos/turbot/steampipe/actions/artifacts/8614273598/zip
created_at           | 2026-07-25T02:27:48Z
expired              | false
expires_at           | 2026-10-23T02:17:17Z
node_id              | MDg6QXJ0aWZhY3Q4NjE0MjczNTk4
sp_connection_name   | github
sp_ctx               | {"connection_name":"github","steampipe":{"sdk_version":"5.14.0"}}
_ctx                 | {"connection_name":"github","steampipe":{"sdk_version":"5.14.0"}}

github_actions_cache

> select
  *
from
  github_actions_cache
where
  repository_full_name = 'turbot/steampipe' limit 1;
-[ RECORD 1  ]---------------------------------------------------------------------------
login_id             | MDQ6VXNlcjM2MjM0MjY=
repository_full_name | turbot/steampipe
id                   | 6,237,879,723
key                  | codeql-overlay-base-database-1-433570c23e836bda-go-2.26.2-2d11d8cdb2e9e09365df128fd906c6daaaeac5f6-30673795184-1
ref                  | refs/heads/develop
version              | d96c176a7c72d361c40b4e5bcab0abec796173d7f00eca68f52f8039917812e4
last_accessed_at     | 2026-07-31T23:50:10Z
created_at           | 2026-07-31T23:50:10Z
size_in_bytes        | 31,693,006
sp_connection_name   | github
sp_ctx               | {"connection_name":"github","steampipe":{"sdk_version":"5.14.0"}}
_ctx                 | {"connection_name":"github","steampipe":{"sdk_version":"5.14.0"}}

github_gitignore

> select
  *
from
  github_gitignore
order by
  name limit 1;
-[ RECORD 1  ]---------------------------------------------------------------------------
login_id           | MDQ6VXNlcjM2MjM0MjY=
name               | AL
source             | ### AL ###                                                        +
                   | #Template for AL projects for Dynamics 365 Business Central       +
                   | #launch.json folder                                               +
                   | .vscode/                                                          +
                   | #Cache folder                                                     +
                   | .alcache/                                                         +
                   | #Symbols folder                                                   +
                   | .alpackages/                                                      +
                   | #Snapshots folder                                                 +
                   | .snapshots/                                                       +
                   | #Testing Output folder                                            +
                   | .output/                                                          +
                   | #Extension App-file                                               +
                   | *.app                                                             +
                   | #Rapid Application Development File                               +
                   | rad.json                                                          +
                   | #Translation Base-file                                            +
                   | *.g.xlf                                                           +
                   | #License-files                                                    +
                   | *.bclicense                                                       +
                   | *.flf                                                             +
                   | #Test results file                                                +
                   | TestResults.xml                                                  
sp_connection_name | github
sp_ctx             | {"connection_name":"github","steampipe":{"sdk_version":"5.14.0"}}
_ctx               | {"connection_name":"github","steampipe":{"sdk_version":"5.14.0"}}

github_repository_sbom

> select
  name,
  spdx_version
from
  github_repository_sbom
where
  spdx_version = 'SPDX-2.3'
  and repository_full_name = 'turbot/steampipe';
-[ RECORD 1  ]---------------------------------------------------------------------------
name         | com.github.turbot/steampipe
spdx_version | SPDX-2.3

- 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 cbruno10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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!

Comment thread github/utils.go

// 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()))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// LIST FUNCTION
//// LIST FUNCTION

Minor note, but the rest of the file uses four slashes for section headers.

Comment thread go.mod
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Sign up for free to 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.

2 participants