Lektor projects track lego branch tip instead of specific commit
In most of our Lektor repositories, .gitmodules
is set up to track the tip of main
instead of a specific commit. This is causing issues with GitLab CI when GIT_STRATEGY = fetch
(the default) is used, because when a job starts it doesn't use the --remote
flag as part of the git submodule update
command (upstream issue).
To work around this, we recently switched to GIT_STRATEGY = clone
which isn't as efficient especially for large projects because it nukes the repository cached on the runner at the start of every job.
Ultimately we should discuss whether this is the best approach to using lego in our Lektor projects, because bad commits there can cascade and lead to broken websites. Right now this kind of breakage could be difficult to spot because commits to lego don't trigger CI builds in dependent projects, although setting this up is definitely feasible.
Another approach would be to use submodules to point to specific commits, which is what they were designed for originally. The caveat is that more manual work would be required to update lego in multiple projects at once, although this too can be made relatively straightforward with a little script-work.
Personally I think the specific-commit approach is what we should be using here, because having websites track lego looks to me like one big juicy foot-gun.