Skip to content

Trouble with spring after moving / renaming packages? #81

Closed
@exterm

Description

@exterm

We're running into situations where packwerk check or packs check returns incorrect results in some situations, like after changing branches. I believe that this is due to an interaction (or lack thereof) between packs-rails and spring.

Is anyone else seeing this problem?

I just (seemingly) fixed this on a project I am working on.

It looks like the explanation is the following:

packs-rails sets up autoload paths by detecting package.ymls. So moving packs around, renaming them, deleting packs or creating new ones leads to the autoload paths being changed. The application has to be restarted for that. Which means spring needs to watch all the package.ymls. I just did a Dir["packs/**/package.yml"],each { |f| Spring.watch(f) } to fix it for us.

But if this is the actual explanation, everybody setting up packs-rails naively should have this problem, and I haven't been hearing much about it. Does this ring a bell for anyone?

If this is actually a common problem, maybe we can have packs-rails set up the spring watches implicitly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions