Skip to content

ci: check dependencies with gosocialcheck - #53979

Open
AkihiroSuda wants to merge 1 commit into
moby:masterfrom
AkihiroSuda:gosocialcheck
Open

AkihiroSuda wants to merge 1 commit into
moby:masterfrom
AkihiroSuda:gosocialcheck

Conversation

@AkihiroSuda

@AkihiroSuda AkihiroSuda commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Run gosocialcheck to check whether the dependencies of the main module, api, and client are adopted by trusted projects (i.e., CNCF graduated projects).

Findings are reported as GitHub Actions annotations on go.sum and do not fail the job.

Docker, Moby, and golang.org/x packages are annotated as trusted (//gosocialcheck:trusted) in go.mod.

https://github.com/AkihiroSuda/gosocialcheck

See:

Release notes (optional)

A picture of a cute animal (not mandatory but encouraged)


Created with: Claude Code

Comment thread client/go.mod Outdated
Comment on lines +28 to +33
// Docker, Moby, and golang.org/x packages are trusted
//gosocialcheck:trusted
require (
github.com/moby/docker-image-spec v1.3.1 // indirect
golang.org/x/sys v0.33.0 // indirect
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this something that can be configured through other ways? If I'm not mistaken, go (finally!?) started fixing grouping in go.mod to prevent multiple groups (multiple direct / indirect).

Also slightly wondering what makes decisions in CNCF projects more trust-worthy than (e.g.) moby itself? (I've seen some poor choices and messy dependency-management in CNCF)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is this something that can be configured through other ways?

Updated to use inline comments instead of require() group comments

If I'm not mistaken, go (finally!?) started fixing grouping in go.mod to prevent multiple groups (multiple direct / indirect).

Yes, seems started in Go 1.27 😞

Also slightly wondering what makes decisions in CNCF projects more trust-worthy than (e.g.) moby itself?

s/CNCF projects/CNCF graduated projects/
s/more/same/

(I've seen some poor choices and messy dependency-management in CNCF)

https://github.com/cncf/toc/blob/main/.github/ISSUE_TEMPLATE/template-graduation-application.md#security could be improved?

Comment on lines +259 to +261
name: Install gosocialcheck
run: |
go install "github.com/AkihiroSuda/gosocialcheck/cmd/gosocialcheck@${GOSOCIALCHECK_VERSION}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could this run as linter in golangci-lint? Similar to (e.g.) forbidigo ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not sure, as gosocialcheck is a linter for go.mod rather than Go source codes themselves.
Could be experimented as a plugin anyway

@AkihiroSuda
AkihiroSuda force-pushed the gosocialcheck branch 3 times, most recently from b9a5830 to fa0e781 Compare October 22, 2026 16:06
@AkihiroSuda
AkihiroSuda requested a review from thaJeztah October 22, 2026 16:06
@AkihiroSuda
AkihiroSuda requested a review from vvoland October 29, 2026 18:46
@AkihiroSuda
AkihiroSuda force-pushed the gosocialcheck branch 2 times, most recently from e7e6fa0 to 1067b9b Compare November 2, 2026 18:47
@AkihiroSuda

Copy link
Copy Markdown
Member Author

Addressed the review comments

@thaJeztah Could you take a look?

@AkihiroSuda
AkihiroSuda force-pushed the gosocialcheck branch 4 times, most recently from fc546a1 to 85103cf Compare November 5, 2026 19:44
Run gosocialcheck to check whether the dependencies of the main
module, api, and client are adopted by trusted projects (i.e., CNCF
graduated projects).

Findings are reported as GitHub Actions annotations on go.sum and do
not fail the job.

Docker, Moby, and golang.org/x packages are annotated as trusted in
go.mod.

https://github.com/AkihiroSuda/gosocialcheck

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Comment thread go.mod
Comment on lines +68 to +72
github.com/moby/buildkit v0.35.0-rc1 //gosocialcheck:trusted
github.com/moby/docker-image-spec v1.3.1 //gosocialcheck:trusted
github.com/moby/extensions v0.0.0-20261026144205-2b6b3bd5fa82 //gosocialcheck:trusted
github.com/moby/go-archive v0.3.3 //gosocialcheck:trusted
github.com/moby/ipvs v1.1.0 //gosocialcheck:trusted

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Still on the fence on these; it's odd that we trust other orgs, but not the things we maintain ourselves, and don't trust dependencies maintained by the Go project.

cc @vvoland @corhere any thoughts?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's odd that we trust other orgs, but not the things we maintain ourselves, and don't trust dependencies maintained by the Go project.

This PR does the quite opposite. Docker, Moby, and golang.org/x packages are trusted with the //gosocialcheck:trusted annotations. The others are untrusted, unless they are already adopted by a CNCF-graduated project.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Right; but

unless they are already adopted by a CNCF-graduated project.

Means we assume those made the right choice, so that's out of our control ? And "adopted by a CNCF-graduated project" means, that I need to get (say) containerd to accept a PR that adds something as an (indirect?) dependency, then it's considered "approved" by default 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does containerd have this in CI? Because if the graduated CNCF project do not get a warning "this is a new dependency that has not yet been adopted by anyone else; you're the first!", then that would reduce the gate for it to be introduced.

(besides every update of a dependency should ideally get the same amount of attention; version X of a dependency may be fine, but gives no promises for any update of the same dependency).

@AkihiroSuda AkihiroSuda Nov 10, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Means we assume those made the right choice, so that's out of our control ?

Right, if an adoption in a single CNCF project is not considered safe enough, maybe we should bump the threshold to 2 or 3?

And "adopted by a CNCF-graduated project" means, that I need to get (say) containerd to accept a PR that adds something as an (indirect?) dependency, then it's considered "approved" by default 🤔

You don't need to get (say) containerd to accept such a PR. Just a warning will be printed.

Does containerd have this in CI?

It is in nerdctl (containerd/nerdctl#5208) , but not in containerd itself yet.
Will open a PR there soon. EDIT: opened containerd/containerd#14547

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. meta/ai-assisted module/api module/client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants