Skip to content

Conversation

@henrymercer
Copy link
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 henrymercer requested a review from a team as a code owner November 5, 2025 18:57
@github-actions github-actions bot added the size/S Should be easy to review label Nov 5, 2025
Copy link
Contributor

Copilot AI left a 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 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

Copy link
Contributor

@esbena esbena left a comment

Choose a reason for hiding this comment

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

❤️

@henrymercer henrymercer merged commit 71d0a56 into main Nov 6, 2025
247 checks passed
@henrymercer henrymercer deleted the henrymercer/type-fun branch November 6, 2025 10:47
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