Shopify / Shopify/packwerk

[Bug Report] deprecated_references.yml files erroneously removed if running `packwerk update-deprecations` with the `--package` argument

Open
#306 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Ruby
Stars
1.9k
Forks
121
Avg merge
2m
Merged PRs (30d)
1

Description

Description

Since #199 was released, running packwerk update-deprecations --packages=components/some_component in order to save time by only updating one component instead of everything now causes all deprecated_references.yml files other than those in the specified component to be deleted when they shouldn't be.

To Reproduce

  • Have a project with more than one deprecated_references.yml file
  • Run packwerk update-deprecations --packages=<one of the multiple packages> or packwerk update-deprecations <one of the multiple packages>

Expected Behaviour

Only the deprecated_references.yml file in the specified package(s) should be changed, all others should be untouched.

Version Information

  • Packwerk: v2.2.2
  • Ruby: 3.2.0 MRI
  • OS: Mac OS 13.1

Additional Context

This might be intentional, but the expected behaviour described above is how packwerk used to behave before #199 was released. I've been using the ability to update only a single package for a long time to save time (as suggested by the docs) because running it on our whole repository takes about 30s, whereas running on just the one package is often only 4-5s.

This is not a huge issue, as the (I think new?) cache option reduces the time to run update-deprecations on the whole repository to only about 6s once cached vs 3-4s for a single package, but the new behaviour is surprising

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with multiple packages and run the packwerk update-deprecations command both with and without --packages. Start at the update-deprecations entry point and trace package filtering and deprecated_references.yml handling. Done means files outside the selected package remain untouched, while selected package files are updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.