Files
devops-lib-gcp/docs/wiki/pages/build/config-only-detection.md
T
2026-08-26 02:02:24 +05:30

2.3 KiB
Raw Blame History

Generated 2026-05-12 at base-sha 28f54cf7bef9. Type: concept. 0 sources.

Config-Only Change Detection

When a commit only changes YAML config files (no source code), each language builder skips the compile/test/image-build steps and instead fetches the last-built image tag from GAR (Google Artifact Registry). This avoids rebuilding identical binaries when only configs changed.

Where it applies in this repo

Implemented independently in each language builder (src/com/meesho/stages/buildMaven.groovy, buildGo.groovy, buildNode.groovy, etc.).

The detection pattern varies slightly by builder but follows the same logic:

  1. Run git diff HEAD~1 -- configs/ (or git diff ORIG_HEAD -- configs/).
  2. If the diff is non-empty AND no source files changed → set appConfigChanges = true, skip compilation.
  3. Fetch the latest image tag from the artifact bucket (S3 or GCS) or GAR.
  4. Set env.TAG to the fetched tag.
  5. Proceed directly to deployArgoCD.run().

The check is gated by skip_s3_check in config.yaml. Setting skip_s3_check: true forces a full rebuild even when only configs changed.

Why this design

Config-only deployments are common at Meesho (dynamic config updates, feature flags). Rebuilding the entire Java or Go binary for a one-line YAML change wastes 310 minutes. By reusing the last image tag and skipping straight to ArgoCD deploy, the pipeline completes in ~1 minute for config-only changes.

The detection relies on git diff against the previous commit, so it only works when the commit history is linear. Force-pushes or squash merges may produce false negatives (full rebuild triggered unnecessarily).

Sources

(no raw/ sources at bootstrap)

Notes


← Wiki index