WIP: release: declare the commit-analyzer preset, and publish to the repository the run belongs to #1201

Closed
notquiteog wants to merge 1 commit from pr/release-tooling into main
notquiteog commented 2026-11-09 17:06:14 +00:00 (Migrated from github.com)

Two things that stop a release from a clean checkout. Both turned up by running one.

The preset is a package, and nothing declares it. .releaserc.json asks both @semantic-release/commit-analyzer and release-notes-generator for the conventionalcommits preset. There is no lock file, so a fresh npm install resolves without it and semantic-release stops at MODULE_NOT_FOUND as soon as it analyzes commits.

Pinned to 8.0.0: both plugins depend on conventional-changelog-writer@^8, and the 10.x preset is written for writer 10 — I tried it first and the notes step died inside a handlebars template.

The release targets package.json's repository, not the run's. On this repository those are the same string and this changes nothing. On a fork they are not: semantic-release compares the fork's main against this repository's, decides it is "behind the remote one", and publishes nothing — while the workflow reports success, which is the worst way to fail. Passing --repository-url for the repository the run belongs to fixes that and is a no-op upstream.

Found while releasing a fork; the first fix is not fork-specific at all.

🤖 Generated with Claude Code

Two things that stop a release from a clean checkout. Both turned up by running one. **The preset is a package, and nothing declares it.** `.releaserc.json` asks both `@semantic-release/commit-analyzer` and `release-notes-generator` for the `conventionalcommits` preset. There is no lock file, so a fresh `npm install` resolves without it and semantic-release stops at `MODULE_NOT_FOUND` as soon as it analyzes commits. Pinned to **8.0.0**: both plugins depend on `conventional-changelog-writer@^8`, and the 10.x preset is written for writer 10 — I tried it first and the notes step died inside a handlebars template. **The release targets package.json's repository, not the run's.** On this repository those are the same string and this changes nothing. On a fork they are not: semantic-release compares the fork's `main` against *this* repository's, decides it is "behind the remote one", and publishes nothing — while the workflow reports success, which is the worst way to fail. Passing `--repository-url` for the repository the run belongs to fixes that and is a no-op upstream. Found while releasing a fork; the first fix is not fork-specific at all. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
hckrman101 (Migrated from github.com) reviewed 2026-11-09 17:06:14 +00:00
hckrman101 commented 2026-11-09 17:54:53 +00:00 (Migrated from github.com)

Looks good, but maybe let's hold on for @NotRexed to take a look at #1059 which replaces this system

Looks good, but maybe let's hold on for @NotRexed to take a look at https://git.magicbean.dev/MagicBeanDev/Hookshot/pulls/1059 which replaces this system
itaskaev2 commented 2026-11-09 20:46:42 +00:00 (Migrated from github.com)

This fixes the failure the Release job on main has right now, for example https://github.com/NotRexed/Hookshot/actions/runs/42682985998/job/129382203911 (the push of #1183). semantic-release loads its plugins, finds 120 commits since v2.0.11, and then stops in the analyzeCommits step of @semantic-release/commit-analyzer with Error: Cannot find module 'conventional-changelog-conventionalcommits' (MODULE_NOT_FOUND). Every Release run that reached commit analysis since 2026-11-08 has failed this way (66 runs). The green runs never got that far: they stopped at "No version tag yet" or at "The local branch main is behind the remote one".

The cause is the one described here. .releaserc.json sets "preset": "conventionalcommits" for @semantic-release/commit-analyzer and @semantic-release/release-notes-generator. That preset is its own package, and nothing in the dependency tree pulls it in (both plugins only depend on conventional-changelog-angular), so it is not installed unless package.json declares it.

I checked this branch locally (Node 24.16, npm 11.13) with the workflow's own npm install --no-audit --no-fund --ignore-scripts, and ran both plugins with the plugin config from .releaserc.json, on a few sample Conventional Commits and on the 120 real commits from v2.0.11 to ac3bd44:

  • package.json from main (320 packages, the same count as the CI log): analyzeCommits and generateNotes both fail with Cannot find module 'conventional-changelog-conventionalcommits'.
  • package.json from this PR (npm adds 1 package, [email protected]): both succeed. The samples give a minor release, or a major one with a breaking change. The real commits give a patch release, 2.0.12, with 13 entries under Bug Fixes.
  • semantic-release --dry-run --no-ci in a scratch repository with a v2.0.11 tag and a local bare remote (no token) runs verifyConditions, analyzeCommits, verifyRelease and generateNotes and prints the notes for 2.1.0. With only the preset package removed from node_modules, it stops at the same analyzeCommits error as CI.

The 8.0.0 pin is right. With 10.4.1, analyzeCommits works but generateNotes fails with conventional-changelog-conventionalcommits requires conventional-changelog-writer@9 or newer, because both plugins resolve conventional-changelog-writer 8.4.0.

I did not test the steps after generateNotes (the changelog.py prepare step, the release commit and the tag push), because they need the repository's token. Note that the first Release run after this is merged will try to cut a real release (2.0.12 with the commits on main today). If #1059 is merged instead, this PR is not needed: #1059 deletes package.json and replaces the semantic-release step, so the two PRs also conflict.

This fixes the failure the Release job on main has right now, for example https://github.com/NotRexed/Hookshot/actions/runs/42682985998/job/129382203911 (the push of #1183). semantic-release loads its plugins, finds 120 commits since v2.0.11, and then stops in the analyzeCommits step of `@semantic-release/commit-analyzer` with `Error: Cannot find module 'conventional-changelog-conventionalcommits'` (MODULE_NOT_FOUND). Every Release run that reached commit analysis since 2026-11-08 has failed this way (66 runs). The green runs never got that far: they stopped at "No version tag yet" or at "The local branch main is behind the remote one". The cause is the one described here. `.releaserc.json` sets `"preset": "conventionalcommits"` for `@semantic-release/commit-analyzer` and `@semantic-release/release-notes-generator`. That preset is its own package, and nothing in the dependency tree pulls it in (both plugins only depend on `conventional-changelog-angular`), so it is not installed unless package.json declares it. I checked this branch locally (Node 24.16, npm 11.13) with the workflow's own `npm install --no-audit --no-fund --ignore-scripts`, and ran both plugins with the plugin config from `.releaserc.json`, on a few sample Conventional Commits and on the 120 real commits from v2.0.11 to ac3bd44: - package.json from main (320 packages, the same count as the CI log): analyzeCommits and generateNotes both fail with `Cannot find module 'conventional-changelog-conventionalcommits'`. - package.json from this PR (npm adds 1 package, `[email protected]`): both succeed. The samples give a minor release, or a major one with a breaking change. The real commits give a patch release, 2.0.12, with 13 entries under Bug Fixes. - `semantic-release --dry-run --no-ci` in a scratch repository with a v2.0.11 tag and a local bare remote (no token) runs verifyConditions, analyzeCommits, verifyRelease and generateNotes and prints the notes for 2.1.0. With only the preset package removed from node_modules, it stops at the same analyzeCommits error as CI. The 8.0.0 pin is right. With 10.4.1, analyzeCommits works but generateNotes fails with `conventional-changelog-conventionalcommits requires conventional-changelog-writer@9 or newer`, because both plugins resolve `conventional-changelog-writer` 8.4.0. I did not test the steps after generateNotes (the changelog.py prepare step, the release commit and the tag push), because they need the repository's token. Note that the first Release run after this is merged will try to cut a real release (2.0.12 with the commits on main today). If #1059 is merged instead, this PR is not needed: #1059 deletes package.json and replaces the semantic-release step, so the two PRs also conflict.
hckrman101 (Migrated from github.com) reviewed 2026-11-09 23:07:51 +00:00
hckrman101 (Migrated from github.com) left a comment
No description provided.
-- let's hold off just a bit, don't want to turn this on atm
NotRexed commented 2026-11-11 21:21:59 +00:00 (Migrated from github.com)

Thanks. Releases moved from semantic-release to release-please (#1059), and package.json is gone from main, so this preset no longer has anything to configure. Closing as superseded.

Thanks. Releases moved from semantic-release to release-please (#1059), and package.json is gone from main, so this preset no longer has anything to configure. Closing as superseded.
Commenting is not possible because the repository is archived.
No description provided.