You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(automator): honour releases.generate_notes config when creating GitHub releases (#144)
Fixes a silent bug where release-regent always passed
generate_release_notes: false
to the GitHub API regardless of the releases.generate_notes setting in
release-regent.toml, making the documented default of true have no
effect at runtime.
closes#141
## What Changed
- Added `generate_release_notes: bool` field to `AutomatorConfig`
(default `false`,
preserving existing runtime behaviour).
- Replaced the hardcoded `false` literal in `CreateReleaseParams` inside
`ReleaseAutomator::automate()` with
`self.config.generate_release_notes`.
- Threaded `repo_config.releases.generate_notes` into `AutomatorConfig`
in
`lib.rs::handle_release_pr_merged` so the value flows from config file
to API call.
- Changed `default_generate_notes()` in `config.rs` from `true` to
`false` so the
schema default matches the runtime default, eliminating the
contradiction.
## Why
`AutomatorConfig` had no field for this setting, so there was no path
from the
`releases.generate_notes` config key to the GitHub API call. Users who
relied on the
documented default (`true`) or who explicitly set `generate_notes =
true` would never
get GitHub's auto-generated release notes. Users who set `false` got the
same behaviour
as users who set `true`, making the config key entirely inert.
## How
The fix follows the existing pattern for other `AutomatorConfig` fields:
add the field
to the struct, supply a sensible default, and set it from `repo_config`
at the
construction site in `handle_release_pr_merged`. No new abstractions
were introduced.
## Testing Evidence
- **Test Coverage:** Added two new async tests in
`release_automator_tests.rs`:
`test_automate_generate_release_notes_true_sets_flag_in_api_call` and
`test_automate_generate_release_notes_false_clears_flag_in_api_call`.
Both inspect
the `CreateReleaseParams` recorded by the test double to assert the
correct flag value.
- **Test Results:** All 39 `release_automator` tests pass; no
regressions.
- **Manual Testing:** Not applicable — the fix is fully covered by the
unit test double.
## Reviewer Guidance
- Confirm the new default (`false`) is the right choice; users who
previously relied on
the (broken) documented default of `true` will now need to set
`generate_notes = true`
explicitly in their config — consider whether a changelog note or
migration hint is warranted.
- The `releases.generate_notes` field in `ReleasesConfig` and the new
`AutomatorConfig::generate_release_notes` field are intentionally
separate: one is
the user-facing config type, the other is the internal automator config.
- No breaking changes to public API; `AutomatorConfig::default()`
behaviour is unchanged
(`generate_release_notes: false`).
0 commit comments