Interview Prep/CI/CD/Jenkins Shared Libraries, Credentials and Security

A shared library change broke 50 pipelines at once. How do you prevent a repeat?

AdvancedScenarioJenkins Shared Libraries, Credentials and Security
Answer

Situation read → Library changes were released with no testing and no staged rollout.

What I'd do →

  1. Unit-test vars/ steps with JenkinsPipelineUnit and Spock.
  2. Release by semver tag; consumers pin @v1, a moving major tag, while you test v2 on canary pipelines.
  3. Have a test pipeline that loads the PR branch with library identifier: 'ci-lib@refs/pull/..' against sample repos.
  4. Keep the previous tag available for instant rollback.

Why → A shared library is a dependency like any other and needs versioning, tests and canaries.

Interview tip → Mention that backwards compatibility rules for the library API matter.

All CI/CD questions

More on Jenkins Shared Libraries, Credentials and Security