FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Use generic types for durations in status report by henrymercer · Pull Request #3278 · github/codeql-action · GitHub

Repository navigation

Use generic types for durations in status report - #3278

Merged
henrymercer merged 1 commit into
mainfrom
henrymercer/type-fun
Nov 6, 2025
Merged

henrymercer merged 1 commit into
mainfrom
henrymercer/type-fun

Conversation

Copy link
Copy Markdown
Contributor

This means we don't need to update this interface for every new language.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Which use cases does this change impact?

Dev/test only

How did/will you validate this change?

The code compiles

If something goes wrong after this change is released, what are the mitigation and rollback strategies?

  • Rollback - Change can only be disabled by rolling back the release or releasing a new version with a fix.

How will you know if something goes wrong after this change is released?

n/a, dev only change

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

This means we don't need to update this interface for every new language.
Copilot AI review requested due to automatic review settings November 5, 2025 18:57
henrymercer requested a review from a team as a code owner November 5, 2025 18:57
github-actions Bot added the size/S Should be easy to review label Nov 5, 2025

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull Request Overview

This PR refactors the QueriesStatusReport interface to use TypeScript mapped types instead of manually listing each language-specific field. The refactoring reduces code duplication by generating field names dynamically from the KnownLanguage enum.

Key changes:

  • Replaced ~90 lines of repetitive field definitions with concise mapped type definitions
  • Introduced two helper types (RunQueriesDurationStatusReport and InterpretResultsDurationStatusReport) that generate language-specific field names
  • The QueriesStatusReport interface now extends these mapped types

esbena 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

❤️

henrymercer merged commit 71d0a56 into main Nov 6, 2025
henrymercer deleted the henrymercer/type-fun branch November 6, 2025 10:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Should be easy to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL