Skip to content

Replace glob dependency with glob from fs/promises - #4601

Open
josefs wants to merge 1 commit into
mainfrom
josefs/replace-packages-with-node-22-built-ins
Open

josefs wants to merge 1 commit into
mainfrom
josefs/replace-packages-with-node-22-built-ins

Conversation

@josefs

@josefs josefs commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Replaces the glob package in extensions/ql-vscode (src/databases/local-databases/database-resolver.ts, src/databases/local-databases/db-contents-heuristics.ts, and src/databases/qlpack.ts) with glob from Node 22's built-in fs/promises, now that the minimum VS Code version has been bumped to 1.101.0 (Node 22) in #4619.

Validation

  • npm run check-types — passed
  • npm run lint — passed
  • npm run find-deadcode — passed
  • npm run build — passed
  • npm run test:unit — passed (67 test suites, 645 passed)

Remember to update the changelog if there have been user-facing changes!

@josefs
josefs marked this pull request as ready for review October 15, 2026 10:44
@josefs
josefs requested a review from a team as a code owner October 15, 2026 10:44
@josefs
josefs requested review from kaspersv and a max review from Copilot October 15, 2026 10:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Native globbing breaks database and query workflows on supported Node 20 extension hosts.

1 open finding
What changed in this PR

Reduces dependencies in the CodeQL VS Code extension by using Node built-ins and existing libraries.

Changes:

  • Replace build utilities and filesystem globbing with Node APIs.
  • Replace identifier generation and graph click handling.
  • Reuse tmp-promise in tests and remove unused dependencies.
File Description
extensions/​ql-vscode/​test/​vscode-tests/​no-workspace/​query-history/​store/​query-history-store.test.ts Use UUIDs in fixtures.
extensions/​ql-vscode/​test/​vscode-tests/​no-workspace/​local-queries/​webview.test.ts Import temporary-file helpers from tmp-promise.
extensions/​ql-vscode/​test/​vscode-tests/​no-workspace/​databases/​local-databases-ui.test.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​test/​vscode-tests/​no-workspace/​code-tour/​code-tour.test.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​test/​vscode-tests/​minimal-workspace/​queries-panel/​query-pack-discovery.test.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​test/​vscode-tests/​minimal-workspace/​queries-panel/​query-discovery.test.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​test/​vscode-tests/​minimal-workspace/​qlpack-generator.test.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​test/​vscode-tests/​minimal-workspace/​local-queries/​local-databases.test.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​test/​vscode-tests/​minimal-workspace/​common/​vscode/​file-path-discovery.test.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​test/​vscode-tests/​jest.activated-extension.setup.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​test/​vscode-tests/​cli-integration/​query-server/​query-server-client.test.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​test/​vscode-tests/​cli-integration/​model-editor/​modeled-method-fs.test.ts Generate temporary paths with UUID prefixes.
extensions/​ql-vscode/​test/​vscode-tests/​cli-integration/​local-queries/​skeleton-query-wizard.test.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​test/​unit-tests/​local-queries/​query-contents.test.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​test/​unit-tests/​databases/​local-databases/​db-contents-heuristics.test.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​test/​unit-tests/​common/​files.test.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​test/​jest-config.ts Remove transforms for removed dependencies.
extensions/​ql-vscode/​test/​common/​logging/​output-channel-logger.test.ts Reuse tmp-promise helpers.
extensions/​ql-vscode/​src/​view/​results/​Graph.tsx Use native click listeners.
extensions/​ql-vscode/​src/​variant-analysis/​run-remote-query.ts Use UUIDs for temporary paths.
extensions/​ql-vscode/​src/​stories/​variant-analysis/​VariantAnalysisAnalyzedRepos.stories.tsx Generate repository identifiers with Faker.
extensions/​ql-vscode/​src/​run-queries-shared.ts Use UUID-based query identifiers.
extensions/​ql-vscode/​src/​query-server/​query-runner.ts Use UUID-based run identifiers.
extensions/​ql-vscode/​src/​model-editor/​extensions-workspace-folder.ts Use UUIDs for pack-location probes.
extensions/​ql-vscode/​src/​databases/​qlpack.ts Use native globbing for database schemes.
extensions/​ql-vscode/​src/​databases/​local-databases/​db-contents-heuristics.ts Use native globbing for root detection.
extensions/​ql-vscode/​src/​databases/​local-databases/​database-resolver.ts Use native globbing for database discovery.
extensions/​ql-vscode/​src/​databases/​database-fetcher.ts Use UUIDs for filename collision fallback.
extensions/​ql-vscode/​src/​compare/​compare-view.ts Use UUID-based streaming identifiers.
extensions/​ql-vscode/​package.json Remove redundant dependencies.
extensions/​ql-vscode/​package-lock.json Prune the dependency graph.
extensions/​ql-vscode/​gulpfile.ts/​typescript.ts Use native styling and directory removal.
extensions/​ql-vscode/​gulpfile.ts/​textmate.ts Use Node’s object-mode transform stream.
extensions/​ql-vscode/​gulpfile.ts/​appInsights.ts Inject telemetry keys through filesystem APIs.
Files not reviewed (1)
  • extensions/ql-vscode/package-lock.json: Generated file

🧠 Review effort: Max


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

} from "./database-contents";
import { DatabaseKind } from "./database-contents";
import { glob } from "glob";
import { glob } from "fs/promises";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure who decides which minimum version of VS Code we support. It might be possible to bump the minimum supported version, but if it isn't we should probably keep the glob dependency for now.

@kaspersv kaspersv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Besides the pending issue with glob, this looks good to me. Would you mind creating a new PR with the other commits. Then we can get those merged while we clarify whether we can bump the minimum VS Code version we support.

@josefs

josefs commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

@kaspersv #4607

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@josefs
josefs force-pushed the josefs/replace-packages-with-node-22-built-ins branch from d076698 to ef13e95 Compare October 22, 2026 19:13
@josefs josefs changed the title Replace redundant dependencies with Node 22 built-ins Replace glob dependency with glob from fs/promises Oct 22, 2026

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.

3 participants