Skip to content
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

apiviewgo parses non-SDK modules as needed #8699

Merged
merged 2 commits into from
Aug 1, 2024
Merged

Conversation

chlowell
Copy link
Member

When apiviewgo finds a type alias referencing a non-SDK module, it will parse that module's source from the local mod cache or download it from the Go module proxy, and hoist the definition to the API it's reviewing. Parsing and definition-hoisting logic is unchanged; this PR just adds the ability for apiviewgo to parse code not residing in the SDK repo.

Closes #7866

@chlowell chlowell marked this pull request as ready for review July 24, 2024 23:27
src/go/cmd/cache.go Outdated Show resolved Hide resolved
@RickWinter
Copy link
Member

The linked issue talks about an allow list. I don't see that, are we not doing that? How do we prevent exporting types from libraries we don't own?

@chlowell
Copy link
Member Author

I decided against the allow list because I didn't see a benefit worth the friction. The review process from PR to apiview prevents exporting types we don't own; it's clear at each stage where a type comes from. It does rely totally on human judgment though. Do you think we need a hard barrier?

@RickWinter
Copy link
Member

I decided against the allow list because I didn't see a benefit worth the friction. The review process from PR to apiview prevents exporting types we don't own; it's clear at each stage where a type comes from. It does rely totally on human judgment though. Do you think we need a hard barrier?

It should be fine to not have it since its clear in the Apiview where the types are coming from.

@chlowell chlowell merged commit 286da43 into Azure:main Aug 1, 2024
7 checks passed
@chlowell chlowell deleted the download branch August 1, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

apiviewgo resolves type aliases referring to external repos
3 participants