dandelion icon indicating copy to clipboard operation
dandelion copied to clipboard

Submodules

Open scttnlsn opened this issue 12 years ago • 25 comments

Submodules are currently ignored during deployment. Once Rugged implements submodules (https://github.com/libgit2/rugged/pull/246) consider including them as part of the deployment.

scttnlsn avatar Mar 17 '14 19:03 scttnlsn

Looks like submodule support got into rugged: https://github.com/libgit2/rugged/pull/408

jtsternberg avatar Oct 13 '14 16:10 jtsternberg

Just throwing that in here as I would really like to see submodule deployment support. :)

jtsternberg avatar Oct 13 '14 16:10 jtsternberg

:+1:

pruett avatar Nov 03 '14 17:11 pruett

@scttnlsn Curious if you've had any thought towards incorporating submodules to the deployment?

jtsternberg avatar Mar 01 '15 22:03 jtsternberg

@jtsternberg I don't have the need for submodules myself at the moment so I probably won't get around to implementing them anytime soon. Pull requests are welcome!

scttnlsn avatar Mar 02 '15 17:03 scttnlsn

@scttnlsn I fully understand that sentiment! I may try to get my hands dirty if I ever a) get the free-time, or b) have the dying-need. :)

jtsternberg avatar Mar 02 '15 17:03 jtsternberg

:+1:

bobrocke avatar Apr 23 '15 00:04 bobrocke

If we can spec out the use case for submodules, I may spend some time working on it.

I'll kick off the discussion. How should we track the deployed version of each submodule? Should it be part of the same revision file as the main repository, or should each submodule contain its own copy of the revision file in a separate location?

TheLonelyGhost avatar Apr 29 '15 22:04 TheLonelyGhost

I'd say separate, in the same way that Git keeps a separate .gitmodules file.

bobrocke avatar Apr 29 '15 22:04 bobrocke

Agreed. Separate.

jtsternberg avatar Apr 30 '15 00:04 jtsternberg

Have you gotten enough feedback to proceed? I, for one, am looking forward to sub-module support.

bobrocke avatar May 01 '15 15:05 bobrocke

Yeah, I think separate files would be best. I'm wondering if it makes sense to just store a .revision file in each submodule directory on the server. Dandelion can detect if a given local path is a submodule and read the corresponding remote revision.

Here's some initial work I did to gracefully ignore submodules: https://github.com/scttnlsn/dandelion/tree/submodules

Previously it was raising an exception that @bobrocke was running into (https://github.com/scttnlsn/dandelion/issues/128).

scttnlsn avatar May 01 '15 16:05 scttnlsn

@scttnlsn That's what I was thinking too, but it would require further HTTP server rules forbidding access to .revision if it ends up in the doc root. I find that manageable but not sure if everyone else does.

What about how we want to deploy the submodules? I assume we'll recurse into each submodule directory, but how do we control the version specified with dandelion deploy [commit-ish]? If we have an application at v3 (most recent version is v4) and it depends on other sub-modules at specific versions, this breaks dandelion deploy [commit-ish], doesn't it?

Do we want to limit deploying with submodules to the currently checked-out commit regardless of specified commit-ish above?

TheLonelyGhost avatar May 01 '15 19:05 TheLonelyGhost

Apologies, I'm less familiar with submodules than nested git repositories.

TheLonelyGhost avatar May 01 '15 19:05 TheLonelyGhost

@TheLonelyGhost Those are all great questions. I don't personally have a use case for submodules so it would be great to hear from others who want this feature about how they intent to use it.

Another way I could see implementing this is forcing users to pin the submodule version that they want deployed (probably in a submodules section in dandelion.yml). The downside here is that updating a submodule in the working tree would not necessarily reflect what is deployed (unless the submodule revision was also updated in dandelion.yml). I think I would personally find this less confusing than just deploying whatever revision happens to be in the working tree.

Curious to hear from others.

scttnlsn avatar May 01 '15 21:05 scttnlsn

I'm not sure what nested Git repositories are, or how they may differ from submodules.

When I make an update that effects one or more submodules, I would expect the the submodules' changed files are uploaded along with whatever changes exist in the base repository. Each submodule has its own .git folder, show there should be a way to do the uploading recursively.

bobrocke avatar May 01 '15 21:05 bobrocke

Is this improvement still coming?

bobrocke avatar May 22 '15 19:05 bobrocke

@bobrocke I just pushed 0.4.11 which will now gracefully ignore submodules. This will allow you to deploy submodules as separate Dandelion repositories. There's still more work and discussion around having Dandelion deploy submodules automatically.

scttnlsn avatar May 23 '15 13:05 scttnlsn

Actually, use 0.4.12 now.

scttnlsn avatar May 23 '15 13:05 scttnlsn

@scttnlsn Thanks! That's an improvement.

What must be decided for automatic deployment?

bobrocke avatar May 23 '15 13:05 bobrocke

Since I last posted I've had more of a chance to actually use git submodules. Now I know that a submodule (git repository) has the currently checked-out commit versioned in the parent's working copy as if it is another file. This reduces a lot of the complexity from my perspective.

The main question I have is how to hook into the submodule functionality in Rugged. Haven't had much experience with native ruby extensions unless they were well documented and I don't see much on submodules there...

TheLonelyGhost avatar May 26 '15 22:05 TheLonelyGhost

Note, this is likely on hold until #129 (problems with Rugged v0.22.2) is resolved. Submodule support was in the Rugged update.

TheLonelyGhost avatar May 27 '15 18:05 TheLonelyGhost

Any progress to report?

bobrocke avatar Jun 27 '15 20:06 bobrocke

Since #129 is resolved by sticking with Rugged v0.22.1b1 and that version appears to contain the merged pull request from libgit2/rugged#475, it appears this is greenlit for development again.

As for progress, none so far on my end. Unable to devote time to this at the moment with my work schedule. I still see several big obstacles in implementing this, but the biggest would be lack of documentation for rugged. I haven't looked into the branch for this that @scttnlsn started since it was mentioned above, but it might be of more help than I realize.

Would definitely be available to review a pull request if someone wants to take a stab at this.

TheLonelyGhost avatar Jul 13 '15 18:07 TheLonelyGhost

+1

dionysiusmarquis avatar Oct 21 '15 15:10 dionysiusmarquis