GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Refactor a few things out of `util.ts` by mbg · Pull Request #4251 · github/codeql-action

Conversation

@mbg

@mbg mbg commented Oct 16, 2026

Copy link
Copy Markdown
Member

Groundwork for other things. This is a pure refactoring PR that moves various things out of util.ts because util.ts is large and unfocused, and easily creates dependency cycles for other files that depend on it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mbg added 8 commits October 16, 2026 21:39
@mbg
Move ConfigurationError out of util.ts
8bdea82
@mbg
Move HTTPError out of util.ts
071544a
@mbg
Move wrapError and getErrorMessage out of util.ts
a76419a
@mbg
Move isDiskConfigurationError out of codeql.ts
929f5c0
@mbg
Move codeQlVersionAtLeast out of util.ts and into CodeQL
9c72af5
@mbg
Mark additional imports in util.ts as type-only
86bc444
@mbg
Move more GitHub-related definitions from util.ts to github.ts
02283e9
@mbg
Remove InstanceURL from util.ts
dc2ed81
Copilot AI max review requested due to automatic review settings October 16, 2026 21:55
@mbg
mbg requested a review from a team as a code owner October 16, 2026 21:55
@github-actions github-actions Bot added the size/L May be hard to review label Oct 16, 2026
Copilot started reviewing on behalf of mbg October 16, 2026 21:55
View session
Copilot AI reviewed Oct 16, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new CodeQL stub silently ignores supplied version-check overrides.

1 open issue
  • Medium severity Use isVersionAtLeast when resolving CodeQL overrides · New
1 file not reviewed
  • lib/entry-points.js: Excluded by your content exclusion settings
What changed in this PR

Refactors shared helpers out of util.ts to reduce coupling and dependency cycles in the CodeQL Action.

Changes:

  • Extracts error helpers and GitHub types into focused modules.
  • Moves environment initialization onto Env.
  • Moves CLI version comparison onto CodeQL and updates callers and tests.
File Description
src/​util.ts Removes relocated helpers and preserves compatibility exports.
src/​upload-sarif-action.ts Initializes the action environment through Env.
src/​upload-lib.test.ts Updates environment initialization.
src/​tools-download.test.ts Spies on the relocated error helper.
src/​setup/​repository.ts Imports InstanceURL from its owning module.
src/​setup/​repository.test.ts Updates environment initialization.
src/​setup-codeql.test.ts Updates environment initialization.
src/​setup-codeql-action.ts Initializes through the action environment.
src/​init-action.ts Uses the new initialization and version methods.
src/​github.ts Houses GitHub variant and version types.
src/​feature-flags/​offline-features.test.ts Updates environment initialization.
src/​feature-flags.ts Uses the CodeQL version method.
src/​feature-flags.test.ts Updates environment initialization.
src/​errors/​index.ts Centralizes error helpers and classes.
src/​environment.ts Adds initialization and simplifies environment types.
src/​database-upload.test.ts Updates environment initialization.
src/​config-utils.ts Uses the CodeQL version method.
src/​codeql.ts Adds version comparison and stub wiring.
src/​codeql.test.ts Updates environment initialization.
src/​autobuild-action.ts Passes the environment into status reporting.
src/​api-client.test.ts Updates environment initialization.
src/​analyze-action.ts Initializes through the action environment.
src/​actions-util.test.ts Tests initialization through Env.

Review effort: Max

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/codeql.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mbg
mbg requested a max review from Copilot October 19, 2026 16:40
Copilot started reviewing on behalf of mbg October 19, 2026 16:41
View session
Copilot AI reviewed Oct 19, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The stub version check can disagree with its reported version, affecting version-gated tests.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Make stub isVersionAtLeast use its returned getVersion

src/​codeql.ts:434

Could this default implementation call the returned stub's getVersion(), as the real implementation does? createStubCodeQL({}).isVersionAtLeast("1.0.0") returns false even though getVersion() reports "1.0.0". It also ignores replacements of getVersion on the returned stub because it reads partialCodeql instead. Version-gated tests can therefore take a different branch from the one implied by the stub's reported version, unlike the previous helper.

1 resolved since last review
  • Medium severity Use isVersionAtLeast when resolving CodeQL overrides
1 file not reviewed
  • lib/entry-points.js: Excluded by your content exclusion settings

Review effort: Max

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mbg added 5 commits October 21, 2026 16:57
@mbg
Remove unused type parameters from Env classes
774bc19
@mbg
Move initializeEnvironment out of util.ts
7def528
@mbg
Fix resolveFunction call
44f1c73
@mbg
Improve typing of resolveFunction
c29909a
@mbg
Merge branch 'main' into mbg/refactor-util/errors
5c1005e
@mbg
mbg force-pushed the mbg/refactor-util/errors branch from eaaa622 to 5c1005e Compare October 21, 2026 15:58
mario-campos
mario-campos previously approved these changes Oct 29, 2026
View reviewed changes

@mario-campos mario-campos left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM! It would also be nice to have withTmpDir and withTmpFile moved to testing-utils.ts, as they are only used for testing IIRC.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg
Merge remote-tracking branch 'origin/main' into mbg/refactor-util/errors
fb9d453
@mbg
mbg dismissed mario-campos’s stale review via fb9d453 October 30, 2026 16:52
@mbg
Merge remote-tracking branch 'origin/main' into mbg/refactor-util/errors
ac9f257
@mbg
mbg requested a review from mario-campos November 2, 2026 14:29
mario-campos
mario-campos approved these changes Nov 2, 2026
View reviewed changes
@mbg
mbg added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit b35c6c6 Nov 2, 2026
230 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mbg
mbg deleted the mbg/refactor-util/errors branch November 2, 2026 16:14
This was referenced Nov 3, 2026
Merge main into releases/v4 #4286
Merged
Merge releases/v4 into releases/v3 #4291
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@mario-campos mario-campos mario-campos approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size/L May be hard to review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mbg @mario-campos
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.