Skip to content

fix(build): Correct container mounts#6428

Merged
Aradhya-Tripathi merged 1 commit into
developfrom
container-mounts-fix
May 13, 2026
Merged

fix(build): Correct container mounts#6428
Aradhya-Tripathi merged 1 commit into
developfrom
container-mounts-fix

Conversation

@Aradhya-Tripathi

@Aradhya-Tripathi Aradhya-Tripathi commented May 13, 2026

Copy link
Copy Markdown
Contributor

Purely for self hosted deployments correctly add container mounts in the Dockerfile

@Aradhya-Tripathi Aradhya-Tripathi merged commit 265ff11 into develop May 13, 2026
6 of 8 checks passed
@Aradhya-Tripathi Aradhya-Tripathi deleted the container-mounts-fix branch May 13, 2026 12:50
@greptile-apps

greptile-apps Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a bug where container_mounts was never populated on the DeployCandidate before the Dockerfile was rendered, causing custom volume mount directories to be silently omitted from built images.

  • Adds the missing self.candidate._set_container_mounts() call in send_build_instructions_and_add_build_steps, mirroring the existing _set_additional_packages() pattern, so that doc.container_mounts is set before _generate_dockerfile() renders the Jinja template that iterates over it.

Confidence Score: 5/5

Safe to merge — adds a single missing method call that mirrors an already-established pattern.

The change is a one-line addition that restores expected behaviour: _set_container_mounts() populates candidate.container_mounts which the Dockerfile template loops over. Without this call the loop silently produced no output, so custom bind-mount directories were never created inside built images. The fix is consistent with how _set_additional_packages() is called immediately before it, and frappe.get_all() safely returns an empty list when no mounts are configured, making the change low-risk for groups without any Release Group Mount records.

No files require special attention.

Important Files Changed

Filename Overview
press/press/doctype/deploy_candidate_build/deploy_candidate_build.py Adds the missing _set_container_mounts() call before Dockerfile generation so doc.container_mounts is populated when the template renders the custom-mount loop.

Sequence Diagram

sequenceDiagram
    participant DCB as DeployCandidateBuild
    participant DC as DeployCandidate (candidate)
    participant DB as Database
    participant T as Dockerfile Template

    DCB->>DC: _set_additional_packages()
    DC-->>DC: "self.additional_packages = [...]"

    Note over DCB,DC: NEW (this PR)
    DCB->>DC: _set_container_mounts()
    DC->>DB: frappe.get_all("Release Group Mount", ...)
    DB-->>DC: "[{destination: ...}, ...]"
    DC-->>DC: "self.container_mounts = [...]"

    DCB->>DCB: _generate_dockerfile()
    DCB->>T: "render(doc=self.candidate)"
    T-->>T: iterate doc.additional_packages ✓
    T-->>T: iterate doc.container_mounts ✓ (was empty without fix)
    T-->>DCB: rendered Dockerfile string
Loading

Reviews (1): Last reviewed commit: "fix(build): Correctly set container moun..." | Re-trigger Greptile

@codecov

codecov Bot commented May 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.79%. Comparing base (338d06d) to head (c8e924c).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #6428   +/-   ##
========================================
  Coverage    49.79%   49.79%           
========================================
  Files          945      945           
  Lines        78271    78272    +1     
  Branches       355      355           
========================================
+ Hits         38976    38978    +2     
+ Misses       39272    39271    -1     
  Partials        23       23           
Flag Coverage Δ
dashboard 59.73% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant