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 — Improve type checking of test macros by henrymercer · Pull Request #3873 · github/codeql-action

Conversation

@henrymercer

@henrymercer henrymercer commented May 6, 2026

Copy link
Copy Markdown
Contributor

When invoked via test or test.serial, detailed argument types are erased and we lose some type safety.

This PR wraps macro invocations in helper functions to ensure each of the arguments to the macros is type checked properly.

Dev/test only change.

Sorry, something went wrong.

Uh oh!

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

All reactions
henrymercer added 18 commits May 6, 2026 14:12
@henrymercer
Add typed wrapper for checkOverlayEnablementMacro
bb46cb9
@henrymercer
Add typed wrapper for parsePacksMacro
c9b4614
@henrymercer
Add typed wrapper for parsePacksErrorMacro
5d8e363
@henrymercer
Add typed wrapper for invalidPackNameMacro
2424923
@henrymercer
Add typed wrapper for packSpecPrettyPrintingMacro
aa9aa2a
@henrymercer
Add typed wrapper for calculateAugmentationMacro
bfb5926
@henrymercer
Add typed wrapper for calculateAugmentationErrorMacro
2a05095
@henrymercer
Add typed wrapper for sendFailedStatusReportMacro
c8ef3e4
@henrymercer
Add typed wrapper for getCredentialsMacro
198be5a
@henrymercer
Add typed wrapper for wrapFailureMacro
2b77d7c
@henrymercer
Add typed wrapper for createInitWithConfigStatusReportMacro
9fd1b43
@henrymercer
Add typed wrapper for downloadOverlayBaseDatabaseFromCacheMacro
356809c
@henrymercer
Add typed wrapper for checkPacksForOverlayCompatibilityMacro
44e4709
@henrymercer
Add typed wrapper for postProcessAndUploadSarifMacro
67e427b
@henrymercer
Add typed wrapper for shouldPerformDiffInformedAnalysisMacro
51cc915
@henrymercer
Add typed wrapper for injectedConfigMacro
cd00cbb
@henrymercer
Add typed wrapper for toolcacheInputFallbackMacro
231b974
@henrymercer
Add typed wrapper for skippedUploadMacro
4104e68
Copilot AI review requested due to automatic review settings May 6, 2026 13:21
@henrymercer
henrymercer requested a review from a team as a code owner May 6, 2026 13:21
@github-actions github-actions Bot added the size/XL May be very hard to review label May 6, 2026
Copilot started reviewing on behalf of henrymercer May 6, 2026 13:21
View session
Copilot AI reviewed May 6, 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.

Pull request overview

This PR improves TypeScript type checking in the AVA test suite by introducing small wrapper functions around test.macro(...) invocations, so macro arguments are type-checked at the wrapper call sites (instead of being erased/widened when passed directly through test(...)/test.serial(...)).

Changes:

  • Added typed wrapper helper functions around several AVA macros to preserve argument type checking.
  • Renamed some macro constants to *Macro and updated call sites to use the new wrappers.
  • Minor refactor in one test loop to iterate over BuiltInLanguage values when generating repeated test cases.
Show a summary per file
File Description
src/upload-sarif.test.ts Adds testPostProcessAndUploadSarif(...) wrapper around the upload macro.
src/status-report.test.ts Renames macro constant and adds testCreateInitWithConfigStatusReport(...) wrapper.
src/start-proxy.test.ts Renames macros and adds wrappers for sendFailedStatusReport, getCredentials, and wrapFailure macro usage.
src/setup-codeql.test.ts Adds testToolcacheInputFallback(...) wrapper around the toolcache fallback macro.
src/overlay/caching.test.ts Renames macro constant and adds testDownloadOverlayBaseDatabaseFromCache(...) wrapper.
src/init.test.ts Renames macro constant and adds testCheckPacksForOverlayCompatibility(...) wrapper.
src/init-action-post-helper.test.ts Renames macro constant and adds testSkippedUpload(...) wrapper.
src/diff-informed-analysis-utils.test.ts Renames macro constant and adds testShouldPerformDiffInformedAnalysis(...) wrapper.
src/config/db-config.test.ts Adds wrappers for several macros (parsePacks, invalid pack names, pretty printing, augmentation tests).
src/config-utils.test.ts Adds testCheckOverlayEnablement(...) wrapper and updates repeated test generation loop.
src/codeql.test.ts Adds testInjectedConfig(...) wrapper around the injected config macro.

Copilot's findings

  • Files reviewed: 11/11 changed files
  • Comments generated: 1

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/codeql.test.ts Resolved

Uh oh!

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

@henrymercer
Improve testInjectedConfig type
c3b2b04
@henrymercer henrymercer closed this May 6, 2026
@henrymercer
henrymercer deleted the henrymercer/typed-test-macros branch May 6, 2026 13:35
@mbg mbg mentioned this pull request May 7, 2026
Add more strongly typed wrapper around test.macro #3883
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

Uh oh!

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

Assignees

No one assigned

Labels

size/XL May be very 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.

2 participants

@henrymercer
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 01402775 — 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.