Skip to content

fix: Add internal/generated/imports.go for vendoring of generated sources#1286

Open
jeffmahoney wants to merge 1 commit intodmacvicar:mainfrom
jeffmahoney:fix-vendoring
Open

fix: Add internal/generated/imports.go for vendoring of generated sources#1286
jeffmahoney wants to merge 1 commit intodmacvicar:mainfrom
jeffmahoney:fix-vendoring

Conversation

@jeffmahoney
Copy link

@jeffmahoney jeffmahoney commented Feb 27, 2026

The move to using generated schemas meant that 'go vendor' didn't see the imports in the generated code. This commit adds an otherwise empty imports.go that contains the imports so offline builds can continue to work. It's hidden behind a //go:build imports so there's no impact at build or runtime.

…rces

The move to using generated schemas meant that 'go mod vendor' didn't see
the imports in the generated code.  This commit adds an otherwise empty
imports.go that contains the imports so offline builds can continue to
work.  It's hidden behind a //go:build imports so there's no impact at
build or runtime.
@dmacvicar
Copy link
Owner

Hi Jeff. I imagine this is in the context of packaging.

I don't like much the idea of having to maintain a file with imports only for this reason.

Have you thought avout vendoring internal/codegen, runing the generator and then vendoring again?

@jeffmahoney
Copy link
Author

I have but OBS doesn’t support automating that kind of workflow. I went this route because I got the impression that the list of imports wouldn’t change much over time and wouldn’t impose a meaningful maintenance burden. IMO, if it’s not maintained by the project, it won’t break regular builds. If changes are made that break OBS builds, whomever notices can submit a new PR.

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