6.3 KiB
6.3 KiB
Generated 2026-05-21 at base-sha 5399a5ddc36b. Type: top-level. 6 sources.
Build dispatch
buildObjHelper.groovy is the central switch from the build_tool parameter (set in the service Jenkinsfile) to the stage class that actually runs. vars/buildPipeline.groovy:12 calls buildObjHelper.run(param.build_tool) and assigns the return to buildObj; everything from then on flows through that object.
The switch (buildObjHelper.groovy:5-30)
build_tool value |
Stage class | Source |
|---|---|---|
maven |
buildMaven |
src/com/meesho/stages/buildMaven.groovy |
maven-* (e.g. maven-3.3-jdk-17) |
buildMaven |
same |
docker |
buildDocker |
src/com/meesho/stages/buildDocker.groovy |
python-* (e.g. python-3.10) |
buildPython |
src/com/meesho/stages/buildPython.groovy |
node-* (e.g. node-16) |
buildNode |
src/com/meesho/stages/buildNode.groovy |
go* (e.g. go1.21) |
buildGo |
src/com/meesho/stages/buildGo.groovy |
gradle |
buildGradle |
src/com/meesho/stages/buildGradle.groovy |
php |
buildPhp |
src/com/meesho/stages/buildPhp.groovy |
| any other value | defaultBuild (silent no-op) |
(default case at line 28) |
There is no sbt case and no rust case, despite what older docs may have implied (both have been reconciled out — see review-learnings.md for the audit trail).
Per-language quirks worth knowing
buildMaven
- CAC validation runs before build (
buildMaven.groovy:186-201). - Sonar scan triggered with
withSonarQubeEnv(line 245) againstsonarqube-prdviaconstructParam.groovy:172. - Quality-gate timeout: 600s on prd, 360s elsewhere (lines 286-296).
- JFrog push gated on branch ∈
{master, main}ORpush_to_jfrog=true(lines 377, 410). S3 push gated on branch ∈{master, main, gcp-main, gcp-master}ORpush_to_s3=true(lines 462, 497).
buildGo
sonar_scan()(lines 212-270) downloads the Go binary AND the sonar-scanner zip viacurlinside the build stage itself (lines 227, 236) — there is no fileExists check onsonar-project.propertiesbefore the scan (line 220).- Go test failures are caught and logged but do not propagate as pipeline failure (lines 232-235):
echo "Go tests failed, but the pipeline will continue.". env.hot_fix = true(set byhotFix.groovy:11) skips Sonar AND the quality gate (lines 25-28).- Multi-module builds run in
parallel { }(lines 161-179). - Docker push wrapped by
retryDockerPush(5 attempts, 3s sleep) — see 05-cross-cutting.
buildNode
getNpmRc(lines 63-68) fetchesMEESHO_NPMRC_SECRETfrom AWS Secrets Manager or Vault and writes it to.npmrcin the workspace.- Inline
.envwrites forGITHUB_TOKENandSONARcredentials (lines 283-312) — note: there is notruncate -s 0 .envcleanup pattern; that was a historical PR concern that has been resolved. DOCKER_BUILDKIT=0is set explicitly (lines 387, 392, 400, 405) — BuildKit is disabled, not enabled. TheBUILDKITacronym entry indocs/acronyms.mdwas reconciled accordingly.- Docker push via
retryDockerPush(line 389).
buildPython
- Docker build with module support (lines 89-210) — no Sonar scan (unlike Maven / Go / Node).
- Duplicate-key bug in
docker_bindingsmap at lines 75 and 78 — second assignment overwrites the first. Flagged in BUGS report.
buildGradle
branch_name = 'repo'hard-coded at lines 252 and 285 — the subsequent comparison against'master'/'main'therefore never matches the real branch. Flagged in BUGS report; do not assumebranch_nameis dynamic there.- Uses
xqto querybuild.gradle(lines 255-256, 260, 288-289, 293) —xqis an XML query tool and Gradle files are Groovy/Kotlin DSL, not XML. Flagged.
Adding a new build_tool
- Create
src/com/meesho/stages/build<Lang>.groovywith arun(Map param)method. - Add a
caseinbuildObjHelper.groovy— either a literal (case 'rust') or a regex (case ~/^rust-.*/) for versioned variants. - Add
resources/com/meesho/<lang>-Dockerfile,<lang>-values.yaml,<lang>-deployment.yaml. - There is no unit test to add — push the branch and validate via
@Library('devops-lib@<branch>')in a sandbox service Jenkinsfile.
See also: 04-deploy-flow, 05-cross-cutting, docs/architecture.md.