这是indexloc提供的服务,不要输入任何密码
Skip to content

Fix: Detect changes in workspace dependencies #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pksunkara
Copy link
Owner

Previously, cargo-workspaces would not detect changes to packages if only a [workspace.dependencies] entry they used was modified in the root Cargo.toml. This was because change detection was solely based on files modified within the package's own directory.

This commit modifies the get_changed_pkgs function to:

  1. Check if the root Cargo.toml has been modified.
  2. If so, parse the old and current versions of the root Cargo.toml.
  3. Identify which specific dependencies in [workspace.dependencies] have been added, removed, or had their versions changed.
  4. Iterate through all workspace packages, parse their Cargo.toml files, and determine if they use any of the workspace dependencies that were identified as changed.
  5. Mark such packages as changed, in addition to those already identified by direct file modifications within their directories.

This ensures that packages are correctly identified as changed when their effective dependencies are altered via the [workspace.dependencies] table, addressing issue #173.

Previously, `cargo-workspaces` would not detect changes to packages if only
a `[workspace.dependencies]` entry they used was modified in the root
`Cargo.toml`. This was because change detection was solely based on files
modified within the package's own directory.

This commit modifies the `get_changed_pkgs` function to:
1. Check if the root `Cargo.toml` has been modified.
2. If so, parse the old and current versions of the root `Cargo.toml`.
3. Identify which specific dependencies in `[workspace.dependencies]` have been
   added, removed, or had their versions changed.
4. Iterate through all workspace packages, parse their `Cargo.toml` files,
   and determine if they use any of the workspace dependencies that were
   identified as changed.
5. Mark such packages as changed, in addition to those already identified
   by direct file modifications within their directories.

This ensures that packages are correctly identified as changed when their
effective dependencies are altered via the `[workspace.dependencies]` table,
addressing issue #173.
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.

Workspace dependency bumps don't count as changes Support changed for workspace dependencies
1 participant