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

Theme management in Whippet #41

Closed
harry-m opened this issue Mar 31, 2016 · 6 comments · Fixed by #46
Closed

Theme management in Whippet #41

harry-m opened this issue Mar 31, 2016 · 6 comments · Fixed by #46

Comments

@harry-m
Copy link
Contributor

harry-m commented Mar 31, 2016

In order to remove submodules from site repos, we need to be able to manage themes using a "themes" file - in exactly the same way as plugins are currently managed.

There is a set of repos in GovPress github at wordpress-themes/2012,2013,2014 etc. The root repo URL for the themes file should be git@git.dxw.net:wordpress-themes/ (double check this).

As for plugins, existing themes in directories should be untouched. Whippet should only look at themes listed in the themes file.

When this is working, we'll start migrating sites over to this feature.

@mallorydxw
Copy link
Contributor

Here's my thinking:

(TODO list moved to #46)

Maybe at a later date we can add plugins to the new dependency management files.

The reason we should write a new module from scratch instead of basing the work on the existing plugins module is because yesterday I tried to write tests for the plugin module and it's rather difficult. So we'd need to do a lot of work before we can start adding new features via TDD.

@mallorydxw
Copy link
Contributor

Note about the format of whippet.json:

{
  "src": {
    "plugins": "git@git.dxw.net:wordpress-plugins/",
    "themes": "git@git.dxw.net:wordpress-themes/"
  },
    "plugins": [
      {"name": "foo"},                                                                                                                                                                                                                 
      {"name": "bar"},
      {"name": "bat", "version": "v1.5"},
      {"name": "baz", "src": "git@github.com:dxw/baz"},
      {"name": "bert", "version": "v1.5", "src": "git@github.com:dxw/bert"}
    ],
    "themes": [
    ]
}

Composer stores a hash in composer.lock. Why do they do that? Should we do that too?

@harry-m
Copy link
Contributor Author

harry-m commented Apr 1, 2016

I'd still rather not move to json. It creates a migration headache.

Why not a themes file and themes.lock?

EDIT - missed your comment about TDD. OK then. But I think if we're going to have this we should include plugins in it now. We'll also need a command to convert existing repos to whippet.json.

@mallorydxw
Copy link
Contributor

EDIT - missed your comment about TDD.

Yeah, I'd like to use the code that's already there, but if I don't write tests there's just going to be a headache later on when we try and change it and we have no tests.

But I think if we're going to have this we should include plugins in it now.

Makes sense. I'll add it to the TODO list.

We'll also need a command to convert existing repos to whippet.json.

Yep. That should be fairly straightforward. In fact, we can have it so that if you run whippet deps install or whippet deps update, it will automatically convert plugins/plugins.lock to whippet.json/whippet.lock and just give the user a message telling them to delete the old files and add the new ones to git.

@harry-m
Copy link
Contributor Author

harry-m commented Apr 1, 2016

Sounds good.

@mallorydxw mallorydxw mentioned this issue Apr 1, 2016
53 tasks
@mallorydxw
Copy link
Contributor

The TODO list was getting unmanageably large to be contained in a comment, so I created a PR: #46

mallorydxw added a commit that referenced this issue Jul 22, 2016
- Add Modules/Helpers/FileLocator
- Look for plugins or whippet.json files
- Add Modules/Helpers/Dependencies
- Add Modules/Helpers/WhippetLock
- Add Modules/Dependencies
- Pre-DRY tests
- Handle already-cloned repos
- Add fromString/fromFile static methods to WhippetLock
- Show useful output
- s/Dependencies/DependenciesInstaller/
- Move new classes out of Modules\Helpers
- Check the hash before installing
- Move some test helpers into a separate trait
- Output errors
- Add DependenciesUpdater
- Add update command
- Add paths to gitignore
- Add plugins to DependenciesInstall
- Add plugins to DependenciesUpdater
- Add dependencies migrate command
- mv WhippetLock Files/WhippetLock
- Move some functionality from DependenciesUpdate into WhippetLock
- Rename dependencies, and update FileLocator usage
    - Rename Dependencies* classes
    - Pass directory instead of FileLocator
- Add isErr check to Migration
- Update: test for failed git command
- FileLocator: update message
- s/FileLocator/DirectoryLocator/
- DirectoryLocator: Prevent bug with plugins directory
- migrate: Pretty-print whippet.json
- Pretty-print whippet.lock
- Do not bork on missing whippet.lock
- Dependencies: Ignore plugins file entirely
- Print sensible error if plugins file not found
- Add getNullFactory() to tests
- Move JSON parsing/file writing out of WhippetLock into abstract class
- Support explicit src
- Allow themes/plugins without refs
- Catch failing clones
- Catch failing checkouts
- fromString and fromFile return result objects
- Blank lockfile: show a message
- Blank json file: show message
- Tests: don't override that method
- Don't output warning on missing .gitignore
- Add Files/WhippetJson
- Handle removing previously-installed dependencies from gitignore
- Migration: do not overwrite existing whippet.json
- Fix a couple of bugs in Updater
    - Bubble errors properly
    - Don't bork if whippet.lock is missing
- Dependencies/Updater: refactor for readability
- Dependencies/Installer: refactor for readability
- Dependencies/Migration: refactor for readability
- Make deps an alias for dependencies
- Catch a broken JSON issue
- Add deprecation notice to plugins install/upgrade
- Update whippet_init to find whippet.json
- deploy: use Dependencies/Installer if possible
- Modify the deprecation notice for internal use of Module/Plugin
- Replace DirectoryLocator with ProjectDirectory
- Improve getFactory() test helper
- Do not directly instantiate other classes in tests
- Instantiate Installer correctly
- DRY
- Update README

Fixes: #41
mallorydxw added a commit that referenced this issue Jul 22, 2016
- Add Modules/Helpers/FileLocator
- Look for plugins or whippet.json files
- Add Modules/Helpers/Dependencies
- Add Modules/Helpers/WhippetLock
- Add Modules/Dependencies
- Pre-DRY tests
- Handle already-cloned repos
- Add fromString/fromFile static methods to WhippetLock
- Show useful output
- s/Dependencies/DependenciesInstaller/
- Move new classes out of Modules\Helpers
- Check the hash before installing
- Move some test helpers into a separate trait
- Output errors
- Add DependenciesUpdater
- Add update command
- Add paths to gitignore
- Add plugins to DependenciesInstall
- Add plugins to DependenciesUpdater
- Add dependencies migrate command
- mv WhippetLock Files/WhippetLock
- Move some functionality from DependenciesUpdate into WhippetLock
- Rename dependencies, and update FileLocator usage
    - Rename Dependencies* classes
    - Pass directory instead of FileLocator
- Add isErr check to Migration
- Update: test for failed git command
- FileLocator: update message
- s/FileLocator/DirectoryLocator/
- DirectoryLocator: Prevent bug with plugins directory
- migrate: Pretty-print whippet.json
- Pretty-print whippet.lock
- Do not bork on missing whippet.lock
- Dependencies: Ignore plugins file entirely
- Print sensible error if plugins file not found
- Add getNullFactory() to tests
- Move JSON parsing/file writing out of WhippetLock into abstract class
- Support explicit src
- Allow themes/plugins without refs
- Catch failing clones
- Catch failing checkouts
- fromString and fromFile return result objects
- Blank lockfile: show a message
- Blank json file: show message
- Tests: don't override that method
- Don't output warning on missing .gitignore
- Add Files/WhippetJson
- Handle removing previously-installed dependencies from gitignore
- Migration: do not overwrite existing whippet.json
- Fix a couple of bugs in Updater
    - Bubble errors properly
    - Don't bork if whippet.lock is missing
- Dependencies/Updater: refactor for readability
- Dependencies/Installer: refactor for readability
- Dependencies/Migration: refactor for readability
- Make deps an alias for dependencies
- Catch a broken JSON issue
- Add deprecation notice to plugins install/upgrade
- Update whippet_init to find whippet.json
- deploy: use Dependencies/Installer if possible
- Modify the deprecation notice for internal use of Module/Plugin
- Replace DirectoryLocator with ProjectDirectory
- Improve getFactory() test helper
- Do not directly instantiate other classes in tests
- Instantiate Installer correctly
- DRY
- Update README
- Lock sebastian/environment at a version that supports PHP 5.5

Fixes: #41
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