Skip to content

fix(scripts): normalize line endings before matching versions - #274

Merged
donghaoren merged 1 commit into
apple:mainfrom
PerryLink:fix/version-check-line-endings
Oct 6, 2026
Merged

donghaoren merged 1 commit into
apple:mainfrom
PerryLink:fix/version-check-line-endings

Conversation

@PerryLink

Copy link
Copy Markdown
Contributor

scripts/check-versions.mjs reads each version source and matches it with LF-only patterns. Git for Windows checks out with core.autocrlf=true and the repo has no .gitattributes, so uv.lock lands on disk as CRLF and its pattern never matches:

packages/embedding-atlas/package.json        0.25.0
package-lock.json                            0.25.0
packages/backend/pyproject.toml              0.25.0
packages/backend/embedding_atlas/version.py  0.25.0
uv.lock                                      (not found)
packages/viewer/src/constants.ts             0.25.0
packages/docs/examples/examples.data.ts      0.25.0

Error: version numbers are inconsistent.

uv.lock in this checkout has 4811 CRLF pairs and zero bare LF, so the mismatch is purely a checkout artefact -- the version really is there.

Normalizing line endings inside read() fixes every source at once, whatever git did on the way out:

uv.lock                                      0.25.0

All versions match: 0.25.0

CI runs on ubuntu-latest only, so this never fails there; it only affects contributors and anyone running npm test on Windows, where it fails at the first step (test:versions).

A * text=auto eol=lf .gitattributes would also fix it, but that changes how every file in the repo is checked out. Normalizing in the reader is the smaller change -- happy to switch if you would rather have the .gitattributes.

@domoritz domoritz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the fix. I don't think we need that long of a comment. Let's remove it.

@PerryLink
PerryLink force-pushed the fix/version-check-line-endings branch from 3cb8af4 to d99ed2a Compare October 6, 2026 10:35
@PerryLink

PerryLink commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Removed it -- the diff is a single line now (+1/-1).

Thanks for the review.

One heads-up while you are here: the CI Build run for this PR is held at action_required, because it is a first-time-contributor fork PR, so the workflow needs a maintainer to approve the run before it will execute. Since the main ruleset requires the Build and Test job, this PR will stay blocked until that run is approved. Nothing on the code side is outstanding.

@donghaoren
donghaoren enabled auto-merge (squash) October 6, 2026 16:22
@donghaoren
donghaoren merged commit 66809ff into apple:main Oct 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants