fix(args): resolve --workdir to a repo-relative include path - #1627
fix(args): resolve --workdir to a repo-relative include path#1627Jorge-Polanco-Roque wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1627 +/- ##
==========================================
- Coverage 53.30% 53.22% -0.08%
==========================================
Files 28 28
Lines 2625 2631 +6
==========================================
+ Hits 1399 1400 +1
- Misses 1226 1231 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
37d0306 to
45b7c6d
Compare
|
Thanks for the CI run — I pushed a fix for the failing Root cause: the I reproduced the exact CI invocation locally ( The remaining Lints and Build Nix flake failures look unrelated to this change: the clippy errors ( And as noted above: I'm glad to have this closed or folded into the larger workdir/include-path rework you mentioned — it's meant only as a minimal stopgap for the empty-output regression. |
|
Pushed a fix for the failing Lints check — clippy is now green ( The remaining red checks look unrelated to this change:
Happy to rebase or adjust if you'd like. |
cbdd99d to
217fb07
Compare
|
Looks good overall, but please fix merge conflicts, drop the unrelated lint changes and add a fixture test to fully cover #1369 |
cb87a7f to
dcbaf89
Compare
|
Thanks for the review! Addressed all three:
|
) Setting `--workdir` produced an empty changelog because the derived include pattern was built from the raw workdir (an absolute or cwd-relative path), while diff paths are matched relative to the repository root. The pattern therefore matched nothing. Resolve the workdir against the repository root after discovery and add a repo-relative include pattern instead. When the workdir is the repository root, no filter is added so every commit is kept. Fixes orhun#1369
dcbaf89 to
571e984
Compare
Fixes #1369.
Problem
Pointing
--workdirat the repository root produces an empty changelog.Root cause
When
--workdiris set, the changelog is scoped by turning the workdir path into an include pattern. That pattern was absolute (built fromworkdir.join("")), but diff paths are relative to the repo root — so an absolute pattern matches nothing and the changelog comes out empty.Approach
Resolve
--workdirto a repo-relative include pattern insideprocess_repository. Ifworkdirresolves to the repo root itself, no filter is added so everything is kept. Removed the old absolute-pattern assignment inrun_with_changelog_modifier.Testing
test-workdir-repo-rootfixture (commit.sh+expected.md) and wired it intotest-fixtures.ymlwith--workdir "$PWD", which exercises the previously-broken absolute-path case. It produces the full changelog with the fix and empty output without it.Note on formatting: my added lines are within your
max_width/comment_widthand add no imports, so they match your nightly rustfmt config; I don't have nightly locally, so a quickcargo +nightly fmton your side is worth a glance.A note on direction
I noticed you're planning a more holistic rework of the workdir/include-path handling and that @o1x3 offered to help. This is a minimal, test-backed fix for the empty-output regression specifically — happy for it to serve as a stopgap or a reference for the larger refactor, and equally happy to close it if you'd rather fold it into that work. Per CONTRIBUTING I'm flagging it here rather than assuming a direction; let me know how you'd like to proceed.