| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Just a note: this adds a changelog.output_dir configuration option, which is useful for monorepos where changelogs need to be written at the package root rather than the repository root. It's a small, self-contained feature that shouldn't conflict with the v11 refactoring. See #1407 for the broader context on my use case. No rush on the review. |
Sorry, something went wrong.
|
It has been 90 days since the last update on this confirmed PR. @python-semantic-release/team can you provide an update on the status of this PR? |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Purpose
This PR adds a new changelog.output_dir configuration option that allows users to specify the destination directory for changelog output.
This feature is particularly valuable for monorepo setups where PSR runs from a package subdirectory but needs to write changelogs to a consolidated documentation directory, and also when users use shared remote templates (see #1404) across multiple projects but still want fine grained control over where the changelog is written.
Rationale
In monorepo environments, users often want to:
Before this PR, achieving this required complex shell scripts to copy/move changelog files. The previous monorepo documentation reflected this complexity, requiring users to understand intricate template customization just to place changelogs in a different directory.
The new output_dir option provides a simple way to specify the changelog destination:
This single line replaces what previously required custom templates and shell scripts. The Advanced Example in the monorepo documentation has been completely rewritten to use output_dir, reducing complexity significantly while enabling the same (and more) functionality.
Bug Fix: Custom Templates Now Render to CWD
This PR also fixes an inconsistency when using custom template directories from a subdirectory.
Before:
After:
The old behavior was inconsistent: when running from a subdirectory (e.g., packages/pkg1/), template_dir was resolved relative to CWD, but destination_dir was always hardcoded to the repository root. This caused templates to be read from the subdirectory but output to be written to the repo root.
With this fix, both template reading and output writing are consistent: relative to CWD when output_dir="." (default), or to the explicitly configured output_dir. I'm expecting this to be related to #845, and could potentially fix it.
How did you test?
Unit Tests (tests/unit/semantic_release/cli/test_config.py)
End-to-End Tests (tests/e2e/cmd_changelog/test_changelog.py)
Backward Compatibility
How to Verify
Basic usage: Set output_dir in config and run semantic-release changelog
Verify changelog is written to docs/CHANGELOG.md
Monorepo scenario: From a package subdirectory with:
Run semantic-release changelog and verify output location
Update mode: Create an existing changelog in output_dir, run with mode = "update", verify it reads and updates the correct file
Backward compatibility: Existing config with changelog_file = "docs/CHANGELOG.md" (no output_dir) should continue working
PR Completion Checklist
Reviewed & followed the Contributor Guidelines
Changes Implemented & Validation pipeline succeeds
Commits follow the Conventional Commits standard
and are separated into the proper commit type and scope (recommended order: test, build, feat/fix, docs)
Appropriate Unit tests added/updated
Appropriate End-to-End tests added/updated
Appropriate Documentation added/updated and syntax validated for sphinx build (see Contributor Guidelines)