googleapis / googleapis/release-please
exclude-paths filters out empty Release-As commits in manifest mode
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 588
- Avg merge
- 12h 16m
- Merged PRs (30d)
- 7
Description
#### Environment details
- OS: macOS 26.6 (local investigation); observed in a GitHub Actions `ubuntu-latest` run
- Node.js version: v26.5.0
- npm version: 11.17.0
- `release-please` version: 17.11.2 (current main checkout); Grafana Alloy’s runner depends on `release-please: ^17.11.1`
#### Steps to reproduce
1. Configure manifest mode with an excluded path:
```json
{
"packages": {
".": {
"release-type": "node",
"exclude-paths": ["syntax"]
}
}
}
```
2. Merge an empty commit containing a `Release-As` footer:
```sh
git commit --allow-empty \
-m "chore: force a release" \
-m "Release-As: 1.0.1"
```
3. Run Release Please in manifest mode.
#### Expected behavior
Release Please creates a release PR for the root package at `1.0.1`.
Empty commits are intentionally included in manifest-mode processing to support the documented `Release-As` workflow. An empty commit has no changed files, so it cannot be determined to contain changes exclusively under an excluded path.
#### Actual behavior
No release PR is created for the package configured with `exclude-paths`.
`CommitExclude.shouldInclude()` filters the empty commit’s `files: []` array and then calls `every()`. Since `[].every(...)` is `true`, the predicate concludes that all files are excluded and removes the commit before versioning and changelog generation. The `Release-As` footer is parsed, but never reaches the release strategy.
#### Observed downstream
Grafana Alloy’s root package config excludes `syntax`. On its `release/v1.19` branch, PR [grafana/alloy#6991](https://github.com/grafana/alloy/pull/6991) merged an empty commit whose PR-body override includes:
```text
BEGIN_COMMIT_OVERRIDE
fix: Align latest patch release with correct git tag (#6991)
Release-As: v1.19.2
END_COMMIT_OVERRIDE
```
The subsequent [Release Please run](https://github.com/grafana/alloy/actions/runs/32995647564) did not create the expected root release PR. That workflow uses `--root-only`, so the root package is the relevant release target.
#### Related issues
- #1905 documents that empty `Release-As` commits are expected to produce releases in manifest mode; it concerns targeting a subset of components.
- #2301 reports the same `exclude-paths` and empty `Release-As` interaction, but also describes a separate non-empty-commit symptom.
A narrow fix would retain commits when `files` is absent or empty, while continuing to exclude commits whose changed files are all under configured excluded paths.
Prospective fix located [here](https://github.com/googleapis/release-please/compare/main...jharvey10:release-please:fix/preserve-empty-commits-with-excluded-paths?diff=split&w)
Contributor guide
Research direction
Start at CommitExclude.shouldInclude() and reproduce the manifest-mode case with an empty Release-As commit and an exclude-paths configuration. Check the existing filtering coverage around this entry point, then verify that the empty commit reaches versioning while non-empty commits whose files are all excluded remain filtered out.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, node.js, typescript
- Domain
- release
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100