Interview Prep/Jenkins/Shared libraries & multibranch

A shared library change merged to `main` broke 200 pipelines within minutes. How do you prevent a repeat?

IntermediateScenarioShared libraries & multibranch
Answer

Situation read → Pipelines loaded the library's default version main, so every merge was an instant global rollout.

What I'd do →

  1. Set the global library's default version to a tag (v1), and have Jenkinsfiles pin @Library('shack-lib@v1').
  2. Release flow: PR with JenkinsPipelineUnit tests, merge, tag v1.7.0, run a canary set of pipelines on a staging controller, then move the v1 tag.
  3. Disable "Allow default version to be overridden" on production, or provide a separate shack-lib-dev config for testing branches.
  4. Roll back by moving v1 back to the previous tag.

Why → Tags turn library releases into deliberate, reversible events.

Interview tip → Say "the library is production code that runs unsandboxed, so it gets a release process".

All Jenkins questions Roadmap: Jenkins

More on Shared libraries & multibranch