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 →
- Unit-test
vars/steps with JenkinsPipelineUnit and Spock. - Release by semver tag; consumers pin
@v1, a moving major tag, while you testv2on canary pipelines. - Have a test pipeline that loads the PR branch with
library identifier: 'ci-lib@refs/pull/..'against sample repos. - 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.
More on Jenkins Shared Libraries, Credentials and Security
Ten teams copy the same 80-line "build and push image" stage. What do you do?BeginnerA pipeline needs an AWS secret key and a DB password. How do you provide them without exposing them in logs?BeginnerCredentials are stored in Jenkins; the security team wants no long-lived cloud keys at all.AdvancedA developer asks for admin access to Jenkins to "fix their job". How do you handle it?BeginnerA pipeline from a fork PR should not be able to read production credentials.IntermediateThe team wants the Jenkins configuration reproducible and reviewable. What tooling do you use?Intermediate