-
Notifications
You must be signed in to change notification settings - Fork 0
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
App integration with repos #10
Comments
So yeah, count me in for |
While we're on the subject of close app/repo coupling, the structure of PLUSHU_REPOS_DIR has to match PLUSHU_APPS_DIR, as this is the mechanism by which apps and repos mirror each other. This... might cause trouble in certain scenarios (specifically involving super-plugins that only partially obscure other plugin contexts), and should maybe be reconsidered. Probably deserves at least a little more thought when I'm not so tired. |
Perhaps |
Actually, wouldn't these integration plugins also be handling linked moving, copying, and deleting? So maybe they should just be |
Yeah, I'm really leaning towards making this one bi-directional plugin. Although I guess I could see a scenario where I don't want deleting an app attached to a repo to delete the repo - like, a scenario where repos are the primary focus, and apps are optional things you can add or remove to them... Ehh, I think that would merit its own forked version of this plugin (since you pretty much only want one less hook - repos would still want to move with apps, and vice versa - and the copying of an app with a repo copy would be a question for the implementation, and letting each of these be separate would mean eight separate plugins that you'd probably manage with a meta-plugin anyway). |
On the other hand, it's kind of a meta-plugin thing anyway, so maybe each of these would be its own plugin:
The copy ones could even have linking variants (so one repo updates two apps) or something like that. (I think in that case you'd have to track the linked instances of the repo externally, for git-update-hook, and it would probably be a separate plushook anyway. But eh, it's conceivable.) |
Also, note that apps-creating-repos needs to be taken out of this plugin (apps:create &c calling out to create-repo). (Done in 2392c53.) |
Honestly, the naming headache alone is enough to make me want to make this into one app-repo-binding plugin. |
Wait, crap, how do you prevent these from creating an infinite loop (the rename-repo triggering a rename-app, which in turn creates another rename-repo)? I think that's why this needs to be one plugin (where each entry point runs the delegation plushook with an environment variable semaphore that says "don't recurse"). Alternately, you could go back to the repos-on-top scenario where all app behaviors are triggered by repo behaviors (I think that's why I originally wanted to model it that way). However, that means baking an assumption into the apps model, and, yes, it means you can't have a system with repos by themselves. So I think that's a worse solution than the semaphore approach. |
I'd say that takes care of that. |
The latest thinking in #5 and plushu/plushu-git#9 has involved apps being created whenever a repo is created.
However, I think that's a faulty assumption - maybe we want to create repos without apps attached (or apps without repos, if we're somehow using some other kind of mechanism for apps' code). Maybe the creation of a repo alongside an app should be made into a plugin, with the reverse (creating apps whenever a repo gets created) also being a plugin (not sure if they should be the same plugin).
The real thing that needs to get fixed is the assumption between plushu-git-apps and plushu-buildstep, that receiving a push to a repo should start a build, and that a build should create an app.
(Actually, building doesn't really create an app, it just sort of implicitly/coincidentally does it because it creates the directory hierarchy to the cache directory, which includes creating the app directory, which is all that happens in Plusku when create-app gets plushooked.)
Instead, receiving needs to check for the existence of an app attached to a repo before trying to build it, and buildstep (for safety reasons / to match the freedom around the receive and deploy steps) needs to institute the same check.
The only way an app should be created is via
create-app
getting plushooked.The text was updated successfully, but these errors were encountered: