On Fri, Apr 23, 2021 at 6:26 AM Goyot, Martin <[email protected]> wrote:
> When should I choose one over the other ? > If possible, implement the full filesystem SPI; else, if possible, implement just the probe. > What is the impact of using the Probe instead of the FileSystem. > The probe is used for the limited but critical use case of picking “heads”. For example, someone sets up a multibranch Pipeline using the default recognizer that creates a branch project for each branch (or pull request) with a `Jenkinsfile` at top level. Your probe will be called to check whether a given branch/PR in fact has such a filename. The filesystem SPI provides richer functionality that supports more features. For example, `Jenkinsfile` can be loaded directly from the SCM somehow, without creating/updating a clone of the repo on the controller filesystem. (“lightweight” vs. “heavyweight checkout”) The `readTrusted` step can also load content directly from a versioned file without doing a full checkout on an agent. This is used implicitly in the `yamlFile` option to Declarative `agent kubernetes`, for example: it would be really annoying to create a generic agent pod just long enough to run an `scm checkout` ~ `git clone` solely to read a single ~1Kb YAML file, then throw away the first pod and create a second one with the actual build environment you want for your project (with some specific version of Ruby tooling, say). Since the `github-branch-source` implements the filesystem SPI, Jenkins is able to retrieve `Jenkinsfile` and `your-build-env.yaml` directly from the GH REST API efficiently, and the repo only ever need be cloned once, on the agent really doing your build. -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr15GR-0scWqt8mVgVZOnjQGkE_6FTS-EAhDh9OvHbmeEA%40mail.gmail.com.
