Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harden sanitizeLog against incorrect matches on TypeScript versions. #60794

Merged
merged 3 commits into from
Dec 17, 2024

Conversation

DanielRosenwasser
Copy link
Member

Background

Because we don't want to update every server log baseline on every TypeScript version change, we sanitize server logs based on the current TypeScript version. Specifically, we replace occurrences of the full version with FakeVersion, and replace occurrences of the major.minor version with tsFakeMajor.Minor.

Problem

When TypeScript updating to 5.7.3, the baselines were incorrectly updated because we have a server test with a package at the version 15.7.3. This is not the first time we hit this issue, and historically we have gotten around it by just changing the version of the test package.

Proposed Fix

@andrewbranch's suggestion was to switch to a regex and add boundaries to the beginning/end. This doesn't entirely fix the issue, but it does harden the test runner by avoiding a match of 5.7.3 within 15.7.3.

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

Seems fine to me; would rather this and a cherry-pick to release-5.7 rather than manual changes.

src/harness/tsserverLogger.ts Outdated Show resolved Hide resolved
src/harness/tsserverLogger.ts Outdated Show resolved Hide resolved
DanielRosenwasser and others added 2 commits December 17, 2024 11:57
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
@DanielRosenwasser DanielRosenwasser merged commit 7be4b2c into main Dec 17, 2024
32 checks passed
@DanielRosenwasser DanielRosenwasser deleted the tsVersionsInSanitizeLog branch December 17, 2024 20:56
@DanielRosenwasser
Copy link
Member Author

@typescript-bot cherry-pick to release-5.7

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 17, 2024

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
cherry-pick to release-5.7 ✅ Started ✅ Results

typescript-bot pushed a commit that referenced this pull request Dec 17, 2024
#60794)

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
@typescript-bot
Copy link
Collaborator

Hey, @DanielRosenwasser! I've created #60798 for you.

DanielRosenwasser added a commit that referenced this pull request Dec 17, 2024
…e-5.7 (#60798)

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants