Repository navigation
Add the name squatting dashboard view + required functionality/indexes - #2437
autumnfound wants to merge 10 commits into
Conversation
|
looks pretty good so far, nice work! if you don't mind I'll be doing some changes to the UI just to improve a bit the UX overall, but will be really minimal, also trying to be consistent. |
Sounds good! I tried to guide the AI to be somewhat consistent, but I do recognize there are still some bumps haha |
4561db2 to
eccd120
Compare
eccd120 to
b2eb1c1
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The configuration baseline incorrectly lists documented properties, causing the configuration check to fail, and unresolved pagination, matching, and bulk-removal retry defects remain.
5 open issues
8 files not reviewed
server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Indexes.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/Keys.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/Public.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/Sequences.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/Tables.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionValidationFailure.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NameSimilarityAllow.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NameSimilarityAllowRecord.java: Generated file
What changed in this PR
Adds name-squatting review to Open VSX, connecting advisory publish-time similarity checks with an admin dashboard for reviewing collisions and managing allowed pairs.
Changes:
- Adds trigram indexes, pair-allowlist storage, and a non-blocking
NAME_SIMILARITYpublish check. - Introduces permission-protected admin endpoints and dashboard actions to allow pairs or delete extensions.
- Adds server and UI tests, configuration documentation, and upgrade notes.
| File | Description |
|---|---|
webui/test/unit/pages/admin-dashboard/name-squatting/name-squatting.spec.tsx |
Tests tab navigation and linked tab selection. |
webui/test/unit/pages/admin-dashboard/name-squatting/name-squatting-model.spec.ts |
Tests filtering, similarity formatting, and page merging. |
webui/test/unit/pages/admin-dashboard/name-squatting/name-diff.spec.ts |
Tests character-difference highlighting. |
webui/test/unit/pages/admin-dashboard/name-squatting/collisions-tab.spec.tsx |
Tests collision display, pagination, and admin actions. |
webui/test/unit/pages/admin-dashboard/name-squatting/allowlist-tab.spec.tsx |
Tests allowlist filtering and removal flows. |
webui/test/unit/admin-name-squatting-request.spec.ts |
Tests endpoint URLs and mutation payloads. |
webui/src/pages/admin-dashboard/name-squatting/use-name-squatting.ts |
Adds query hooks, page merging, and mutations. |
webui/src/pages/admin-dashboard/name-squatting/remove-allows-dialog.tsx |
Adds confirmation for removing allowed pairs. |
webui/src/pages/admin-dashboard/name-squatting/name-squatting.tsx |
Adds the dashboard page and URL-backed tabs. |
webui/src/pages/admin-dashboard/name-squatting/name-squatting-styles.ts |
Defines shared dashboard layouts and table styles. |
webui/src/pages/admin-dashboard/name-squatting/name-squatting-parts.tsx |
Adds extension identities and name comparisons. |
webui/src/pages/admin-dashboard/name-squatting/name-squatting-model.ts |
Implements filtering and display helpers. |
webui/src/pages/admin-dashboard/name-squatting/name-diff.ts |
Computes case-insensitive character differences. |
webui/src/pages/admin-dashboard/name-squatting/delete-extension-dialog.tsx |
Adds confirmation for deleting extension versions. |
webui/src/pages/admin-dashboard/name-squatting/collisions-tab.tsx |
Displays collision groups, filters, and loading states. |
webui/src/pages/admin-dashboard/name-squatting/collision-group.tsx |
Renders grouped matches and resolution actions. |
webui/src/pages/admin-dashboard/name-squatting/allowlist-tab.tsx |
Displays grouped allows and removal controls. |
webui/src/pages/admin-dashboard/name-squatting/allow-dialog.tsx |
Adds pair approval with an optional reason. |
webui/src/pages/admin-dashboard/admin-dashboard.tsx |
Registers permission-gated navigation and routing. |
webui/src/pages/admin-dashboard/admin-dashboard-routes.ts |
Defines the name-squatting route. |
webui/src/extension-registry-types.ts |
Defines dashboard request and response types. |
webui/src/extension-registry-service.ts |
Adds name-squatting admin service methods. |
webui/CHANGELOG.md |
Documents the dashboard and client API additions. |
server/src/test/java/org/eclipse/openvsx/scanning/NameSimilarityCheckServiceTest.java |
Tests advisory checks and allowed-pair exclusions. |
server/src/test/java/org/eclipse/openvsx/scanning/NameSimilarityCheckConfigTest.java |
Tests configuration defaults, binding, and validation. |
server/src/test/java/org/eclipse/openvsx/repositories/NameSimilarityJooqRepositoryTest.java |
Tests matching, indexes, candidate paging, and timeouts. |
server/src/test/java/org/eclipse/openvsx/repositories/NameSimilarityAllowRepositoryTest.java |
Tests pair uniqueness and deletion behavior. |
server/src/test/java/org/eclipse/openvsx/repositories/JooqOnlyTestConfig.java |
Registers the similarity repository for tests. |
server/src/test/java/org/eclipse/openvsx/admin/NameSquattingServiceTest.java |
Tests collision grouping and allowlist operations. |
server/src/main/resources/db/migration/V1_87__Name_Similarity_Indexes.sql |
Adds trigram and flagged-candidate indexes. |
server/src/main/resources/db/migration/V1_86__Name_Similarity_Allowlist.sql |
Enables pg_trgm and creates allowlist storage. |
server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NameSimilarityAllowRecord.java |
Adds the generated allowlist record mapping. |
server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NameSimilarityAllow.java |
Adds the generated allowlist table mapping. |
server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionValidationFailure.java |
Includes the new failure index in generated metadata. |
server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Tables.java |
Exposes the generated allowlist table reference. |
server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Sequences.java |
Adds the generated allowlist sequence reference. |
server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Public.java |
Registers generated schema additions. |
server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Keys.java |
Adds generated allowlist key metadata. |
server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Indexes.java |
Adds generated index references. |
server/src/main/java/org/eclipse/openvsx/scanning/NameSimilarityCheckService.java |
Implements advisory similarity checks and allow exclusions. |
server/src/main/java/org/eclipse/openvsx/scanning/NameSimilarityCheckConfig.java |
Defines and validates similarity settings. |
server/src/main/java/org/eclipse/openvsx/repositories/NameSimilarityJooqRepository.java |
Implements similarity queries and candidate discovery. |
server/src/main/java/org/eclipse/openvsx/repositories/NameSimilarityAllowRepository.java |
Provides allowlist queries and persistence operations. |
server/src/main/java/org/eclipse/openvsx/json/NameSquattingJson.java |
Defines admin endpoint payloads. |
server/src/main/java/org/eclipse/openvsx/entities/NameSimilarityField.java |
Defines comparable name fields. |
server/src/main/java/org/eclipse/openvsx/entities/NameSimilarityAllow.java |
Models allowed pairs and decision details. |
server/src/main/java/org/eclipse/openvsx/admin/NameSquattingService.java |
Coordinates live collision grouping and allowlist management. |
server/src/main/java/org/eclipse/openvsx/admin/NameSquattingAPI.java |
Exposes permission-protected dashboard endpoints. |
server/src/dev/resources/application.yml |
Adds development similarity settings. |
server/scripts/config-properties-baseline.txt |
Adds similarity-property baseline entries. |
server/CHANGELOG.md |
Documents server behavior and migration considerations. |
doc/configuration.md |
Documents similarity settings and timeout behavior. |
Review effort: Balanced
netomi
left a comment
There was a problem hiding this comment.
Thanks, the overall approach (non-enforced check, live re-probing, pair allowlist) looks good. A few things before this can go in:
Before merging
- The branch conflicts with
main(it is based on the pre-1.4.084f06f58), and no CI checks have run on the head commit. Please rebase so CI runs; the configuration-baseline issue Copilot flagged will otherwise fail the configuration check. - Copilot's other open items still apply: the match limit applied before the partner filter, the page offset when fetching an extra row, bulk-removal retries not skipping already removed IDs, and the duplicate doc anchors.
Load
- One collisions request can run up to
MAX_BATCHES x sizecandidates, each with several separately timed probes.statement-timeoutbounds a single statement, not the request, so one request can hold a DB connection for minutes. Please bound the request as a whole (fewer batches, or an overall deadline). withStatementTimeoutreads and restoresstatement_timeoutaround every lookup, two extra round trips per probe. Setting it once per transaction would be enough, asSET LOCALends with it.
Deployment and docs
V1_87builds the GIN indexes withoutCONCURRENTLYand blocks writes toextension_versionandextensionwhile doing so. That is fine as documented, we will build them out of band for open-vsx.org.- Per the repo's AGENTS.md, please trim the 20-line header of
V1_87to the non-obvious constraint (1-3 lines; the rest belongs in the PR or docs), keep the changelog entries to one line each, and link this PR from them.
| private NameSquattingJson.Collisions lookUpCollisions(int offset, int size) { | ||
| var pairs = new LinkedHashMap<Long, Pair>(); | ||
| var probed = new HashSet<Long>(); | ||
| var cursor = offset; |
There was a problem hiding this comment.
Paging by numeric offset into a list ordered most recently flagged first shifts with every new flag: extensions flagged between two "Load more" calls push already shown candidates into the next page (repeats), and allowlist changes reorder the shared-display-name tail (skips). A keyset cursor (detected_at, scan_id), which the new index already supports, would keep pages stable.
Adds pg_trgm, a pair allowlist table and trigram indexes on extension and display names, with a repository that probes one extension's names against active extensions and finds display names shared across namespaces. Groundwork for the name squatting admin dashboard. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Adds the non-enforced NAME_SIMILARITY publish check, which flags versions whose name or display name resembles another namespace's active extension, and admin endpoints that re-probe flagged extensions and shared display names live and manage the pair allowlist. Lookups run under a transaction-local statement timeout so a slow probe cannot tie up the database. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Adds a Name Squatting admin page with a Collisions tab, listing look-alike extensions against the one published first with actions to allow the pair or delete the look-alike, and an Allowlist tab grouped by the allowed extension. Backed by new admin service methods for the name squatting endpoints. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Removed undocumented properties related to name similarity scanning. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Martin Lowe <mtlowe@live.ca>
Look-alikes are now grouped under the earliest extension they resemble whichever page finds them: lookups keep the earliest published matches within the limit and exclude allowed partners in SQL, and look-alikes found only from their anchor's side are looked up from their own. Allow looks up the requested partner alone, from either side, so the match limit can no longer reject a pair that still resembles. The allowlist pages through a Slice, which no longer skips a group at every page boundary. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Add error handling for removeNameSquattingAllow mutation Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Martin Lowe <mtlowe@live.ca>
Collision lookups stop starting new candidates once a request has run for one statement timeout, and resume from the returned cursor. Extensions sharing a display name page by id, so removals no longer skip one. Allowing probes outside any transaction, maps a statement timeout to 503, and inserts with ON CONFLICT DO NOTHING so a concurrent allow answers "Already allowed". Each lookup sets its timeout and threshold in one statement. The dashboard takes allowed pairs off the loaded collisions instead of refetching every page, retries bulk removals past allows already gone, and keys match rows by their values. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Moves the CONCURRENTLY instructions for V1_87 into doc/deployment.md, cuts the migration header to its constraints, and keeps the changelog entries to one line each with a link to the pull request. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
The request budget now only limits starting candidate lookups: the look-alikes found are always anchored at their earliest match, so a page that runs out of time can no longer list one under two anchors. Allowing a pair cancels a collisions batch still loading, which would otherwise write the allowed pair back when it lands. Nested records in the name similarity repository, service and tests move to the end of their classes, and the walk constants join the others at the top. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
b968d20 to
0ec30e0
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Filtering allowed partners after query limits and skipping explicit display names can miss collisions, while asymmetric matching can place the same extension in multiple paginated groups.
3 open issues
5 resolved since last review
8 files not reviewed
server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Indexes.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/Keys.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/Public.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/Sequences.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/Tables.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionValidationFailure.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NameSimilarityAllow.java: Generated fileserver/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NameSimilarityAllowRecord.java: Generated file
Review effort: Balanced
| var candidate = new Candidate(lookalikeId, pairs.get(lookalikeId).flaggedAt()); | ||
| found.addAll(lookUp(candidate, lookalikeNames, allowed.getOrDefault(lookalikeId, Set.of()))); |
| var displayNames = displayName == null || displayName.equals(extensionName) | ||
| ? List.<String>of() | ||
| : List.of(displayName); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Martin Lowe <mtlowe@live.ca>
42c0db7 to
9e33000
Compare
These should all be resolved with my earlier patches as well.
|




This PR adds the name squatting dashboard view and functionality with the below general changesets.
Adds pg_trgm, a pair allowlist table and trigram indexes on extension
and display names, with a repository that probes one extension's names
against active extensions and finds display names shared across
namespaces. Groundwork for the name squatting admin dashboard.
Adds the non-enforced NAME_SIMILARITY publish check, which flags
versions whose name or display name resembles another namespace's
active extension, and admin endpoints that re-probe flagged extensions
and shared display names live and manage the pair allowlist. Lookups
run under a transaction-local statement timeout so a slow probe cannot
tie up the database.
Adds a Name Squatting admin page with a Collisions tab, listing
look-alike extensions against the one published first with actions to
allow the pair or delete the look-alike, and an Allowlist tab grouped
by the allowed extension. Backed by new admin service methods for the
name squatting endpoints.
changes pulled from Claude commit messages for simplicity + clarity