Skip to content

fix(ci): unbreak eslint and the multi-semantic-release git fixtures - #407

Merged
prisis merged 2 commits into
mainfrom
fix/lint-and-git-fixtures
Aug 20, 2026
Merged

fix(ci): unbreak eslint and the multi-semantic-release git fixtures#407
prisis merged 2 commits into
mainfrom
fix/lint-and-git-fixtures

Conversation

@prisis

@prisis prisis commented Aug 20, 2026

Copy link
Copy Markdown
Member

Two independent breakages found while chasing the red pipelines on #403/#404/#405. Both are on main today, neither comes from those branches.

1. lint:eslint fails on a clean checkout (commit 2)

pnpm run lint:eslint reports nine errors on plain main, so the Lint (eslint, types, attw) job is red on every pull request:

  • six eslint-disable comments no longer match a reported problem — vitest/require-mock-type-parameters in rc.test.ts, rc-unmocked.test.ts and semantic-release-clean-package-json/__tests__/index.test.ts, @typescript-eslint/naming-convention in bin/cli.test.ts. With reportUnusedDisableDirectives those are errors. Deleted.
  • release-notes-preset-compat.test.ts calls generateNotes from @semantic-release/release-notes-generator, which ships no type declarations, so the call and its result are typed as error and trip no-unsafe-call/no-unsafe-assignment. Declared the module next to the other untyped semantic-release modules in src/types/semantic-release.d.ts.
  • the same file's JSDoc names the package unquoted, which reads as an inline tag (jsdoc/escape-inline-tags). Quoted.

After this, pnpm run lint:eslint and pnpm run lint:types both pass repo-wide.

2. The git fixtures inherit the developer's git setup (commit 1)

25 of multi-semantic-release's integration tests fail locally on a machine configured the way most are today. Three separate causes, all in __tests__/helpers/git.ts:

GIT_DIR and friends. Git exports GIT_DIR, GIT_INDEX_FILE, GIT_OBJECT_DIRECTORY and GIT_WORK_TREE to its hooks, and they take precedence over cwd — for the helper's own calls and for the semantic-release runs the tests spawn. Run the suite from a hook, which the repo's own lint-staged config does (vitest related on a changed test file), and the fixtures operate on the repository being committed to.

This is not theoretical: it happened to me while preparing this branch. The pre-commit hook ran these tests, a fixture's git add/git commit went to the real index, and the commit that came out deleted 389 files — the whole repository — because the tree it committed was a fixture's. I reset it; nothing was pushed. The helper now drops those variables at import.

Verified both ways, with GIT_DIR/GIT_INDEX_FILE/GIT_WORK_TREE pointed at a scratch repo:

before: 2 failed (2)   after: 2 passed (2)   scratch index: unchanged

and the commit of this very change went through the real pre-commit hook without disturbing the index.

The remote's default branch. gitInitRemote runs git init --bare, so the remote's HEAD follows the developer's init.defaultBranch. For anyone not on master that HEAD names a branch which is never pushed, and semantic-release dies with git fetch --tags → "couldn't find remote ref HEAD". Now created with --initial-branch=master, matching what gitInit makes.

Tag signing. tag.gpgsign = true in a global config turns the plain git tag <name> <sha> semantic-release runs into a signed tag, which needs a message it does not pass: "fatal: no tag message?". The helper already disabled commit.gpgsign; it now disables tag.gpgsign too.

With all three, multi-semantic-release.test.ts and bin/cli.test.ts go from 25 failures to 29/29 passing locally.

Not fixed here

  • bin/cli.test.ts runs right at the 5 s per-test timeout on a loaded machine and times out intermittently; it passes on its own. Worth a longer testTimeout, but that is a separate call.
  • prettier --check fails on three files in semantic-release-pnpm that nothing here touches. CI does not run prettier, so it is not blocking.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MqVjBDe8SkgMK7LpDpgjJ7

prisis and others added 2 commits August 20, 2026 08:05
…er's git setup

The fixture helper inherited three things from whoever ran the tests, and
each of them broke the suite — 25 of the integration tests fail on a
machine that is set up the way most are today:

- git exports `GIT_DIR`/`GIT_INDEX_FILE` and friends to its hooks, and
  they take precedence over `cwd`. Run the tests from a git hook — the
  `lint-staged` `vitest related`, for instance — and every git call in
  this helper operates on the repository being committed to instead of
  the fixture, up to and including replacing its index with a fixture's
  contents. Scrub those variables for every invocation.
- the bare remote is created with the local `init.defaultBranch`, so for
  anyone not defaulting to `master` its HEAD points at a branch that is
  never pushed, and semantic-release fails with "couldn't find remote ref
  HEAD". Create it with `--initial-branch=master`, the branch `gitInit`
  makes.
- `tag.gpgsign = true` in a global config turns the plain
  `git tag <name> <sha>` semantic-release runs into a signed tag, which
  needs a message it does not pass: "fatal: no tag message?". The helper
  already disables `commit.gpgsign`; disable `tag.gpgsign` too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MqVjBDe8SkgMK7LpDpgjJ7
`pnpm run lint:eslint` fails on a clean checkout of main with nine
errors, so the Lint job is red on every pull request:

- six `eslint-disable` comments no longer match a reported problem
  (`vitest/require-mock-type-parameters`, `@typescript-eslint/naming-convention`),
  which `reportUnusedDisableDirectives` reports as errors — delete them;
- `release-notes-preset-compat.test.ts` calls `generateNotes` from
  `@semantic-release/release-notes-generator`, which ships no type
  declarations, so the call and its result are typed as `error` and trip
  `no-unsafe-call`/`no-unsafe-assignment` — declare the module alongside
  the other untyped semantic-release modules;
- the same file's JSDoc mentions the package name unquoted, which reads
  as an inline tag — quote it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MqVjBDe8SkgMK7LpDpgjJ7
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@prisis, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f148bda5-e2b0-4101-a672-6fb927ff6b4b

📥 Commits

Reviewing files that changed from the base of the PR and between aad7d28 and b60faae.

📒 Files selected for processing (7)
  • packages/multi-semantic-release/__tests__/bin/cli.test.ts
  • packages/multi-semantic-release/__tests__/helpers/git.ts
  • packages/multi-semantic-release/__tests__/release-notes-preset-compat.test.ts
  • packages/multi-semantic-release/src/types/semantic-release.d.ts
  • packages/rc/__tests__/rc-unmocked.test.ts
  • packages/rc/__tests__/rc.test.ts
  • packages/semantic-release-clean-package-json/__tests__/index.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.48%. Comparing base (71c4ed4) to head (b60faae).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #407      +/-   ##
==========================================
+ Coverage   86.67%   87.48%   +0.81%     
==========================================
  Files          47       26      -21     
  Lines        1426      983     -443     
  Branches      387      279     -108     
==========================================
- Hits         1236      860     -376     
+ Misses        178      113      -65     
+ Partials       12       10       -2     
Flag Coverage Δ
multi-semantic-release 87.70% <ø> (ø)
rc 95.45% <ø> (ø)
semantic-release-clean-package-json 76.19% <ø> (ø)
semantic-release-pnpm ?
see 22 files with indirect coverage changes
🚀 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.

@prisis
prisis merged commit b5efc89 into main Aug 20, 2026
33 of 34 checks passed
@prisis
prisis deleted the fix/lint-and-git-fixtures branch August 20, 2026 07:29
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.

1 participant