Skip to content

feat(monorepo): add workspace.nestedPackages to give a file to the most specific package - #1270

Merged
BryanFRD merged 1 commit into
mainfrom
feat/nested-packages-exclusive
Oct 4, 2026
Merged

BryanFRD merged 1 commit into
mainfrom
feat/nested-packages-exclusive

Conversation

@BryanFRD

@BryanFRD BryanFRD commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Closes #1258.

When one package's path contains another's (FerrLabs/FerrVault: operator at ., CLI at cli), a file under the inner path counts for both, so a CLI-only commit also releases the operator.

New opt-in key workspace.nestedPackages:

  • shared (default): unchanged behaviour.
  • exclusive: each changed file goes to the package with the longest matching path, so a nested package owns its subtree. sharedPaths still count as an explicit opt-in.

Applied everywhere a file is attributed to a package: touch detection, commit scoping for the bump and changelog, recovered releases, ferrflow diff and ferrflow why (which now reports a file owned by a nested package as unmatched).

Notes:

  • PackageConfig::is_touched_by takes the nested paths as a third argument. The library API is not semver-guarded (config structs gain public fields in minors), and a two-argument wrapper would be dead code in the binary, so no wrapper.
  • Schema (both spellings), EN config table and EN/FR monorepo docs updated.
  • Tests: unit tests on the attribution rule and on Config::nested_package_paths, plus why tests on a real repo for both modes.

@BryanFRD
BryanFRD enabled auto-merge (squash) October 4, 2026 17:59

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking. The ownership logic is now in one place (owns_file / relative_path), every caller passes nested through, and why agrees with the touch check. A three-level chain (root > app > plugin) resolves to the innermost package. shared mode keeps today's behaviour because the list is empty. I found no other path-prefix ownership code in the repo that skips the exclusion.

Nit: src/config/package.rs tests need a blank line between no_changed_files_is_not_a_touch and fn nested.

@BryanFRD
BryanFRD merged commit b17b271 into main Oct 4, 2026
33 checks passed
@BryanFRD
BryanFRD deleted the feat/nested-packages-exclusive branch October 4, 2026 18:01
ferrflow Bot added a commit that referenced this pull request Oct 4, 2026
## [7.28.0] - 2026-10-04

### Features

- feat(monorepo): add workspace.nestedPackages to give a file to the most specific package (#1270)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(monorepo): give a changed file to the most specific package only

1 participant