Skip to content
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

whippet.lock needs to be cleared before running whippet deps update #78

Open
mallorydxw opened this issue Aug 9, 2016 · 5 comments
Open

Comments

@mallorydxw
Copy link
Contributor

mallorydxw commented Aug 9, 2016

% cat whippet.json 
{
    "src": {
        "plugins": "git@git.dxw.net:wordpress-plugins/"
    },
    "plugins": [
        {"name": "advanced-custom-fields"},
    ]
}
% cat whippet.lock 
{
    "hash": "5fd32d33dbb1ac21d471bb7b4fbf2a120f439ba3",
    "plugins": [
        {
            "name": "advanced-custom-fields",
            "src": "git@git.dxw.net:wordpress-plugins/advanced-custom-fields",
            "revision": "df26f74c9b10cae9f773c861218ced9cca03c63c"
        }
}
% vim whippet.json
[...]
% cat whippet.json
{
    "src": {
        "plugins": "git@git.dxw.net:wordpress-plugins/"
    },
    "plugins": [
        {"name": "advanced-custom-fields-pro"},
    ]
}
% whippet deps update
[Updating plugins/advanced-custom-fields-pro]
% cat whippet.lock
{
    "hash": "5fd32d33dbb1ac21d471bb7b4fbf2a120f439ba3",
    "plugins": [
        {
            "name": "advanced-custom-fields",
            "src": "git@git.dxw.net:wordpress-plugins/advanced-custom-fields",
            "revision": "df26f74c9b10cae9f773c861218ced9cca03c63c"
        },
        {
            "name": "advanced-custom-fields-pro",
            "src": "git@git.dxw.net:wordpress-plugins/advanced-custom-fields-pro",
            "revision": "4c61ecd39e80eb295897b5cd7b3a05aa3ce15c70"
        }
}
@mallorydxw
Copy link
Contributor Author

The problem here is that plugins missing from whippet.json are not being removed from whippet.lock.

@dgmstuart
Copy link
Contributor

👍
OK here's what my understanding of the desired functionality is:

  • whippet deps update
    • always trash the old lockfile and rebuild it from scratch based on whatever is in whippet.json
    • (note that the equivalent bundle update accepts an optional list of gem names and only updates those. Presumably we're not proposing to implement this at this time)
  • whippet deps install
    • when nothing has been added or removed, do nothing
    • when a plugin is found in whippet.json which isn't in whippet.lock, add it
    • when a plugin is found in whippet.lock which isn't in whippet.json, remove it. Don't change the locked versions of any other plugins.
    • when a plugin version restriction in whippet.json is incompatible with the version locked inwhippet.lock`, update just that plugin - don't change the locked versions of any other plugins.

@mallorydxw
Copy link
Contributor Author

That's not quite what I'm going for here.

install never modifies whippet.lock, and it always goes by the contents of whippet.lock. I think it looks at whippet.json once, but only to check that the checksum is correct (and provide a warning that somebody may have forgotten to run update).

update reads the contents of whippet.json and builds a new whippet.lock (and updates .gitignore) based on that. And then it runs install.

@dgmstuart
Copy link
Contributor

Huh. OK, so it's super different to bundler then (a lot simpler). Sorry to add to the noise.

If we want to lock specific versions that the project works on I guess we add those to the whippet.json and we can't rely on the whippet.lock like we can (on the equivalent in ruby).

@mallorydxw
Copy link
Contributor Author

Huh. OK, so it's super different to bundler then (a lot simpler). Sorry to add to the noise.

Simplicity is the goal :)

If we want to lock specific versions that the project works on I guess we add those to the whippet.json and we can't rely on the whippet.lock like we can (on the equivalent in ruby).

Yep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants