Shopify / Shopify/packwerk

[Bug Report] Getting "There were stale violations found, please run `packwerk update-todo`" even there is no stale violations

Open
#369 7 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
I'm getting "There were stale violations found, please run packwerk update-todo" when I run check command againts some files.
For this you have to have one violation in several files.

For example:

# This file contains a list of dependencies that are not part of the long term plan for the
# 'packs/one' package.
# We should generally work to reduce this list over time.
#
# You can regenerate this file using the following command:
#
# bin/packwerk update-todo
---
".":
  "::ApplicationController":
    violations:
    - dependency
    files:
    - packs/one/bar.rb
    - packs/one/baz.rb

To Reproduce

  1. Create a dependency violation in the first file.
  2. Create the same dependency violation in another file within the same package.
  3. Run packwerk update-todo in order to generate package_todo.yml file.
  4. Run packwerk check path/to/the/first_file.rb.

Actual Behaviour

  • Command returns 1 status.
  • Command output contains info about stale violations.
📦 Finished in X.XX seconds

No offenses detected
There were stale violations found, please run `packwerk update-todo`

Expected Behaviour

  • Command returns 0 status
  • Command output has no info about stale violations

Version Information

  • Packwerk: 3.1.0
  • Ruby: 3.2.1

Additional Context
3.0.1 has no this problem

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 using packwerk update-todo and packwerk check path/to/the/first_file.rb with the same violation in multiple files. Compare the behavior with Packwerk 3.0.1 and 3.1.0, then verify that the targeted check returns status 0 without stale-violation output.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.