RHINENG-24144: Add Jenkinsfile for GitHub Branch Source migration#801
Open
saurabhpimpalgaokar123 wants to merge 1 commit intoRedHatInsights:pcp-zeroconffrom
Open
Conversation
Reviewer's GuideAdds a Jenkins declarative pipeline to support GitHub Branch Source–based CI, wiring Vault-managed credentials into PR checks and build/deploy jobs and archiving artifacts for all runs. Sequence diagram for Jenkins pipeline execution on PR vs main branchsequenceDiagram
participant gh as GitHub
participant jb as Jenkins
participant pl as Jenkins_pipeline
participant hv as Vault
participant sh_pr as pr_check_sh
participant sh_bd as build_deploy_sh
gh->>jb: Webhook event (push or PR)
jb->>pl: Start pipeline from Jenkinsfile
alt Change request (PR)
pl->>pl: Evaluate changeRequest()
pl->>hv: withVault(configuration, secrets)
hv-->>pl: Export OC_LOGIN_TOKEN_DEV, OC_LOGIN_SERVER_DEV,
hv-->>pl: OC_LOGIN_TOKEN, OC_LOGIN_SERVER,
hv-->>pl: QUAY_USER, QUAY_TOKEN,
hv-->>pl: GITHUB_TOKEN, GITHUB_API_URL,
hv-->>pl: RH_REGISTRY_USER, RH_REGISTRY_TOKEN
pl->>sh_pr: sh bash pr_check.sh
sh_pr-->>pl: PR checks completed
else Not a change request (main or release branch)
pl->>pl: Evaluate not changeRequest()
pl->>hv: withVault(configuration, secrets)
hv-->>pl: Export all required env vars
pl->>sh_bd: sh bash build_deploy.sh
sh_bd-->>pl: Build and deploy completed
end
pl->>pl: post always
pl->>gh: archiveArtifacts artifacts artifacts/**/*
pl->>pl: cleanWs()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The pipeline assumes
VAULT_ADDRESSandVAULT_CREDS_IDparameters are always present and valid; consider adding an early guard (e.g., a short validation stage or awhen { expression { ... } }check) that fails fast with a clear message if these parameters are missing or empty.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The pipeline assumes `VAULT_ADDRESS` and `VAULT_CREDS_ID` parameters are always present and valid; consider adding an early guard (e.g., a short validation stage or a `when { expression { ... } }` check) that fails fast with a clear message if these parameters are missing or empty.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Title 💥
Please title this PR with a summary of the change, along with the JIRA card number.
Suggested formats:
Feel free to remove this section from PR description once done.
Why do we need this change? 💭
Please include the context of this change here.
Documentation update? 📝
Security Checklist 🔒
Upon raising this PR please go through RedHatInsights/secure-coding-checklist
💂♂️ Checklist 🎯
ROS RHEL GitHub label usage for executing a desired test suite
Select the appropriate GitHub label to control which ROS RHEL backend tests run for this PR (Labels can be added before or after commits are pushed):
Note: Changing a Label on a PR with an already-tested commit will not trigger a new test run
Available ROS RHEL labels:
Additional 📣
Feel free to add any other relevant details such as links, notes, screenshots, here.
Summary by Sourcery
Build: