Skip to content

ci(lint): deny google/uuid imports outside internal/uuid - #2780

Open
laskoviymishka wants to merge 1 commit into
apache:mainfrom
laskoviymishka:factory/uuid-depguard
Open

laskoviymishka wants to merge 1 commit into
apache:mainfrom
laskoviymishka:factory/uuid-depguard

Conversation

@laskoviymishka

Copy link
Copy Markdown
Contributor

Follow-up to zeroshade's comment on #2764: enables depguard with one rule that rejects github.com/google/uuid outside internal/uuid, so a new direct import can't slip past the build-tag swap. The only file it flagged on main, catalog/catalogtest/create_table_opts.go, now uses internal/uuid.

make lint and go build ./... pass, and a scratch file importing github.com/google/uuid from table/ fails lint with the new message.

Part of #2062.

AI-assisted, reviewed by a human.

Enable depguard with a single rule that rejects github.com/google/uuid
in every file except internal/uuid, pointing to
github.com/apache/iceberg-go/internal/uuid instead. A direct import
elsewhere would be missed by the later build-tag swap to the standard
library uuid package.

The only remaining direct importer on main was
catalog/catalogtest/create_table_opts.go; it now uses internal/uuid and
uuid.New().String() in place of uuid.NewString().

Signed-off-by: laskoviymishka <[email protected]>

This branch has not been deployed

No deployments
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.

1 participant