Skip to content

Conversation

@fabiovincenzi
Copy link
Contributor

@fabiovincenzi fabiovincenzi commented Jan 23, 2026

Fixes: #1318.
This PR adds Windows to the CI test matrix and fixes cross-platform compatibility issues.

CI Changes

  • Add windows-latest to the OS matrix
  • Enable Windows Developer Mode in CI for npm symlinks support
  • Skip Cypress e2e tests on Windows
  • Remove unnecessary MongoDB dependency and version matrix (see below)

Cross-Platform Fixes

  • Replace bash script fix-shebang.sh with Node.js fix-shebang.js
  • Add cross-env package for Windows-compatible environment variables in npm scripts

The preReceive tests are skipped because they test Unix shell hook execution, which is not applicable on Windows.

@netlify
Copy link

netlify bot commented Jan 23, 2026

Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

Name Link
🔨 Latest commit 636e22f
🔍 Latest deploy log https://app.netlify.com/projects/endearing-brigadeiros-63f9d0/deploys/6981e744deefd600083c6c5d

@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.40%. Comparing base (4a21364) to head (636e22f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1361   +/-   ##
=======================================
  Coverage   80.40%   80.40%           
=======================================
  Files          65       65           
  Lines        4608     4608           
  Branches      775      775           
=======================================
  Hits         3705     3705           
  Misses        888      888           
  Partials       15       15           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fabiovincenzi fabiovincenzi requested review from a team, jescalada and kriswest and removed request for kriswest January 28, 2026 09:17
@fabiovincenzi fabiovincenzi mentioned this pull request Jan 30, 2026
16 tasks
Copy link
Contributor

@jescalada jescalada left a comment

Choose a reason for hiding this comment

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

The tests look good!

Wondering if we could keep the MongoDB combinations in the CI and think about whether we need a Windows CI execution since Windows test support is more of a quality-of-life thing for Windows development...

on:
push:
branches: [main]
branches: [main, windows-failing-tests]
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to revert this if not testing anymore!

Suggested change
branches: [main, windows-failing-tests]
branches: [main]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right used for testing

with:
node-version: ${{ matrix.node-version }}

- name: Start MongoDB
Copy link
Contributor

Choose a reason for hiding this comment

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

Any specific reason to remove MongoDB from the test matrix and steps?

Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed that we already have 6 CI combinations (20, 22, 24) x (Windows, Ubuntu), so adding the 3 Mongo versions would result in 18 CI runs, spending way too many resources in CI runs.

Perhaps we could keep the CI execution as it is, and then add a ci-windows.yml file separately? Not sure if this makes the most sense - Windows is not really meant to be a "supported" OS beyond development since GitProxy would usually be deployed on a Unix machine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MongoDB was originally added to the CI in November 2020 (f8d5f9f) when it was the default database.

However, at some point the default was changed to use the file-based database, and now MongoDB is enabled: false by default in proxy.config.json. Additionally, when NODE_ENV=test, the tests use neDB in-memory (see src/db/file/*.ts with inMemoryOnly: true), so they never actually connect to MongoDB.

This means MongoDB has been running in CI without being used by tests for quite some time.

Regarding Windows: I agree it's more of a quality-of-life feature for development. Having 6 combinations (3 Node × 2 OS) seems reasonable to me, but I'm open to moving Windows to a separate workflow if preferred. What do you think?

vi.mock('fs', { spy: true });

describe('Pre-Receive Hook Execution', () => {
describe.skipIf(process.platform === 'win32')('Pre-Receive Hook Execution', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Might as well add a warning here and in prereceive.ts in the rare case this is being used on Windows 🤔

Suggested change
describe.skipIf(process.platform === 'win32')('Pre-Receive Hook Execution', () => {
// Pre-receive is not currently supported on Windows
describe.skipIf(process.platform === 'win32')('Pre-Receive Hook Execution', () => {

'git',
['config', 'receive.unpackLimit', '0'],
expect.objectContaining({ cwd: '/path/to/repo' }),
expect.objectContaining({ cwd: path.join('path', 'to', 'repo') }),
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏼

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.

Fix failing tests on Windows

2 participants