A release pipeline needs two approvals: QA lead, then a release manager, each from a different group. How do you model it?
IntermediateScenarioPipeline design & Jenkinsfile decisions
Answer
Situation read → Sequential gates with different submitters and audit.
What I'd do →
- Two stages with stage-level
inputand no agent:stage('QA sign-off') { options { timeout(time: 1, unit: 'DAYS') } input { message 'QA approved?'; submitter 'qa-leads'; submitterParameter 'QA_APPROVER' } steps { echo "QA: ${QA_APPROVER}" } } stage('Release approval') { options { timeout(time: 1, unit: 'DAYS') } input { message 'Release to prod?'; submitter 'release-managers'; submitterParameter 'RM_APPROVER' } steps { echo "RM: ${RM_APPROVER}" } } - Write approver names into
currentBuild.descriptionand the change ticket. - Ensure the same person cannot approve both (check
QA_APPROVER != RM_APPROVERand fail).
Why → Group-restricted submitters plus recorded identities give separation of duties.
Interview tip → Mention that admins can always approve, so keep the admin group small.
More on Pipeline design & Jenkinsfile decisions
A team's PR builds pile up: every push to an open PR starts a new 25-minute build while the old one keeps running. What do you change?BeginnerA deploy pipeline waits on `input` for approval, and on Monday you find 14 pods sitting idle since Friday. Fix it.IntermediateUnit tests, lint, dependency audit and SAST run sequentially and take 22 minutes. How do you restructure the pipeline?BeginnerDevelopers want to rerun only the deploy stage when it fails due to a flaky cluster API, without rebuilding the image. What do you offer?IntermediateA pipeline must run integration tests against a shared staging database that can only handle one test run at a time across four different repos. How do you coordinate?IntermediateA library must be tested on Node 18, 20 and 22, on Linux and Windows, but Node 18 on Windows is not supported. Design the stage.Intermediate