feat(dashboard): Add "Redeploy without cache" for cache-related build failures - #7187
feat(dashboard): Add "Redeploy without cache" for cache-related build failures#7187huzan-kazi wants to merge 4 commits into
Conversation
… failures The Release Pipeline detail page had no way to retry a build that failed due to a stale Docker build cache (BuildKit cache-key mismatch or a `--mount=type=cache` step) short of going to Desk and using the existing "Redeploy (No Cache)" button on the underlying Deploy Candidate Build. Exposes that same DeployCandidateBuild.redeploy(no_cache=True) method through press.api.bench.redeploy, and adds a "Redeploy Without Cache" button on the pipeline page that only appears when the active build's failure output actually looks cache-related, via a new is_cache_related_failure() check reused by DeployCandidateBuild.get_doc() to compute an is_cache_failure dashboard field. Deliberately reuses the existing standalone-rebuild redeploy flow rather than threading no_cache through the Release Pipeline workflow engine, to keep the change small; the resulting build is a fresh Deploy Candidate Build (visible under Desk / "Older Deploys") rather than a new tracked Release Pipeline entry. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (4): Last reviewed commit: "fix(deploy-candidate-build): Coerce no_c..." | Re-trigger Greptile |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (50.00%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #7187 +/- ##
===========================================
+ Coverage 59.23% 59.27% +0.04%
===========================================
Files 1009 1009
Lines 91940 92051 +111
Branches 1228 1228
===========================================
+ Hits 54457 54562 +105
- Misses 37460 37466 +6
Partials 23 23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Tick the box to add this pull request to the merge queue (same as
|
…ild.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
… false positives `--mount=type=cache` is boilerplate on nearly every "apps" stage RUN instruction in the generated Dockerfile, so its mere presence in a build's output doesn't mean the failure was actually caused by the cache — e.g. a genuinely broken import path (RollupError: Could not resolve "posthog.js") was being flagged as cache-related purely because it failed inside that same RUN step. Replaces it with specific, unambiguous cache failure signatures: yarn's "Incorrect integrity when fetching from the cache" and apt's "Could not get lock /var/cache/apt/archives/lock", alongside the existing BuildKit "failed to compute cache key". This keeps the "Redeploy Without Cache" button from showing up on failures that a no-cache rebuild wouldn't actually fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…elisted boundary no_cache was typed as bool but forwarded as-is through three whitelisted entry points (press.api.bench.redeploy, DeployCandidateBuild.redeploy, and the module-level redeploy). A false-like string value (e.g. no_cache="false") is truthy under Python's native bool(), so it could silently flip a request for a cached rebuild into an uncached one by the time it reaches the persisted build's no_cache field and the agent's `if self.no_cache: --no-cache` check. Applies the same bool(sbool(...)) coercion already used elsewhere in this file (format_config_value) at each boundary, so the value is a real bool before it's forwarded or persisted, regardless of how it was serialized on the way in. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
DeployCandidateBuild.redeploy(no_cache=True)(the same method the Desk button already uses) throughpress.api.bench.redeploy, and adds a "Redeploy Without Cache" button on the pipeline page.is_cache_related_failure()check is exposed viaDeployCandidateBuild.get_doc()as anis_cache_failuredashboard field, and the button is gated on that.Detecting a cache-related failure
no_cachemaps directly to Docker's--no-cacheflag, which only affects BuildKit's layer cache — it does not clear--mount=type=cachevolumes, which are a separate, persistent, builder-host-level cache shared across every build (none of the mounts inpress/docker/Dockerfileset anid=). So detection intentionally does not match on--mount=type=cachebeing present in the output — that's boilerplate on nearly every "apps" stage RUN instruction and fires on any failure in that stage, cache-related or not (verified against a real "missing import" build failure that isn't a cache issue at all). Instead it matches specific, unambiguous signatures for failures a--no-cacherebuild actually resolves:failed to compute cache key(BuildKit's own layer-cache-key resolution)Incorrect integrity when fetching from the cache(yarn)Could not get lock /var/cache/apt/archives/lock(apt)Boundary input handling
no_cacheis typed asboolbut is forwarded through three whitelisted entry points (press.api.bench.redeploy,DeployCandidateBuild.redeploy, and the module-levelredeploy). A false-like string value (e.g.no_cache="false") is truthy under Python's nativebool(), so it could silently flip a request for a cached rebuild into an uncached one by the time it reaches the persisted build'sno_cachefield and the agent'sif self.no_cache: --no-cachecheck. Each boundary now coerces withbool(sbool(no_cache)), the same pattern already used elsewhere inpress/api/bench.py(format_config_value).Note on scope
This reuses the existing standalone-rebuild redeploy flow rather than threading
no_cachethrough the Release Pipeline workflow engine, to keep the change small. The resulting build is a freshDeploy Candidate Build(visible under Desk / "Older Deploys") rather than a new tracked Release Pipeline entry — consistent with how the existing (non-cache) "Redeploy" action already behaves outside the pipeline view.Test plan
failed to compute cache key: ..., a yarn "Incorrect integrity when fetching from the cache" error, or an apt lock error) and confirm the "Redeploy Without Cache" button appears on the pipeline detail page.--mount=type=cachestep).no_cache=1and the browser navigates to it.press.api.bench.redeploywithno_cache="false"(string) and confirm the resulting build is not built with--no-cache.🤖 Generated with Claude Code