Disadvantages of SCM Lightweight Checkout?

Hi, We have many pipeline jobs that work against a large Subversion repository. A full checkout of branch or trunk is about 2.5GB. Our repo also uses externals.

This means /var/lib/jenkins is ~250GB and growing. It seems very wasteful for Jenkins master to have to checkout the entire trunk just to get the jenkinsfiles. But I’m not sure that the alternative ‘Lightweight Checkout’ is useful.

The pipeline help, concerning Lightweight Checkout reads:

If selected, try to obtain the Pipeline script contents directly from the SCM without performing a full checkout. The advantage of this mode is its efficiency; however, you will not get any changelogs or polling based on the SCM. (If you use checkout scm during the build, this will populate the changelog and initialize polling.) Also build parameters will not be substituted into SCM configuration in this mode. Only selected SCM plugins support this mode.

Is it true that polling, in particular, does not work with a lightweight checkout?

Can anyone offer advice on how to get around large checkouts please?

Hey @DavidA2014, Thanks for stopping in.

I don’t actually have experience with Subversion so I can’t help you with it, but I have used light weight checkout with git.

Well it does… and it doesn’t :wink:

If your Jenkinsfile has checkout(scm) then you will get polling and changelog.

If your Jenkinsfile does not checkout the repository (very unlikely) or your Jenkinsfile is in a repository but not the same one as the source code (unlikely), then you will NOT get polling or changelog.

If you are already doing a full checkout then lightweight checkout will not be of any help, but if you are configuring your SCM to checkout something specific then lightweight will probably help. I’m not sure of the subversion terminology but in git it would be something like shallow or setting the depth parameter.

Hi @shadycuz, thanks for your reply.

My Jenkinsfile, itself, does not do checkout(scm), but the Jenkinsfile configuration in the GUI does do checkout(scm). I guess that it is what you are referring to?
Best regards

If you’re using declarative pipeline, there is an implicit checkout scm that happens at the start of the pipeline.

@MarkEWaite Thanks for your answer.