Skip to content

fix(vscode): relax @rstest/core version requirement#914

Merged
fi3ework merged 1 commit intomainfrom
vscode-relax
Jan 28, 2026
Merged

fix(vscode): relax @rstest/core version requirement#914
fi3ework merged 1 commit intomainfrom
vscode-relax

Conversation

@fi3ework
Copy link
Copy Markdown
Member

@fi3ework fi3ework commented Jan 28, 2026

Summary

human input:

relax the annoying notification 😅.


  • Remove the strict version match requirement between extension and @rstest/core
  • Introduce MIN_CORE_VERSION (initially 0.6.0) as the manual compatibility baseline
  • Show a warning only when the local @rstest/core version is lower than the minimum required
  • Add semver dependency for robust version comparison and bundling
  • Add unit tests for version checking logic

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings January 28, 2026 08:44
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @fi3ework, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines how the Rstest VS Code extension manages its dependency on the @rstest/core package. Previously, it enforced a strict version match, which could lead to unnecessary warnings. The updated approach introduces a minimum compatible core version, providing more flexibility while still ensuring stability. Users will now only receive a warning if their @rstest/core version is genuinely outdated and potentially incompatible, improving the overall user experience and reducing friction during development.

Highlights

  • Relaxed Version Requirement: The strict version matching requirement between the VS Code extension and @rstest/core has been removed, allowing for more flexible compatibility.
  • Minimum Core Version Baseline: A MIN_CORE_VERSION (set to 0.6.0) has been introduced to define the lowest compatible @rstest/core version for the extension.
  • Conditional Warning System: Users will now only receive a warning if their local @rstest/core version is strictly lower than the MIN_CORE_VERSION, rather than for any version mismatch.
  • Semantic Versioning Library: The semver library has been added as a dependency to provide robust and accurate semantic version comparison capabilities.
  • Unit Tests for Version Logic: New unit tests have been implemented to thoroughly validate the new version checking logic, ensuring its correctness across various scenarios.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
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 relaxes the VS Code extension’s coupling to @rstest/core, introducing a minimum compatible core version check instead of requiring exact version equality, and adds unit tests around the new logic.

Changes:

  • Add MIN_CORE_VERSION and semver-based version comparison helpers (shouldWarnCoreVersion, formatCoreVersionWarningMessage) in packages/vscode/src/versionCheck.ts.
  • Update packages/vscode/src/master.ts to log version mismatches at debug level and only show a user warning when the local @rstest/core is below the minimum required version.
  • Add semver and @types/semver dependencies and introduce focused unit tests in packages/vscode/tests/unit/versionCheck.test.ts to validate version checking behavior, including prereleases and missing versions.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pnpm-lock.yaml Locks new semver and @types/semver dependencies used for version checking in the VS Code extension package.
packages/vscode/package.json Declares semver and @types/semver as dev dependencies for the extension, enabling typed semver comparisons.
packages/vscode/src/versionCheck.ts Introduces a centralized minimum core version constant and semver-based helper functions for deciding when to warn and formatting the warning message.
packages/vscode/src/master.ts Integrates the new version check: logs any core/extension version difference, and shows a warning only when @rstest/core is below MIN_CORE_VERSION, guarded to display at most once.
packages/vscode/tests/unit/versionCheck.test.ts Adds unit tests that pin MIN_CORE_VERSION and verify shouldWarnCoreVersion semantics across lower/equal/higher and prerelease versions, plus the missing-version case.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fi3ework fi3ework enabled auto-merge (squash) January 28, 2026 08:50
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively addresses the strict version requirement for @rstest/core by introducing a more flexible minimum version check. The implementation is clean, with the new logic well-encapsulated in versionCheck.ts and backed by solid unit tests. This change will significantly improve the user experience for the VS Code extension. I have one suggestion to enhance type safety in the new versionCheck.ts file.

Comment on lines +16 to +18
export function formatCoreVersionWarningMessage(coreVersion?: string): string {
return `Rstest extension requires local @rstest/core >= ${MIN_CORE_VERSION}, but found ${coreVersion ?? 'unknown'}. Please upgrade @rstest/core.`;
}
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.

medium

The coreVersion parameter can be made non-optional. This function is only called from master.ts after shouldWarnCoreVersion(coreVersion) has returned true. The implementation of shouldWarnCoreVersion guarantees that coreVersion is a defined string in this scenario.

Changing the signature to formatCoreVersionWarningMessage(coreVersion: string) improves the function's contract and type safety. As a result, the nullish coalescing operator (?? 'unknown') is no longer needed.

Suggested change
export function formatCoreVersionWarningMessage(coreVersion?: string): string {
return `Rstest extension requires local @rstest/core >= ${MIN_CORE_VERSION}, but found ${coreVersion ?? 'unknown'}. Please upgrade @rstest/core.`;
}
export function formatCoreVersionWarningMessage(coreVersion: string): string {
return `Rstest extension requires local @rstest/core >= ${MIN_CORE_VERSION}, but found ${coreVersion}. Please upgrade @rstest/core.`;
}

@fi3ework fi3ework merged commit 47bbcaa into main Jan 28, 2026
18 checks passed
@fi3ework fi3ework deleted the vscode-relax branch January 28, 2026 09:00
@fi3ework fi3ework mentioned this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants