Skip to content

fix(tasks): restrict modal VMs to custom images - #70656

Merged
tatoalo merged 1 commit into
masterfrom
posthog-code/restrict-custom-image-vms
Jul 14, 2026
Merged

fix(tasks): restrict modal VMs to custom images#70656
tatoalo merged 1 commit into
masterfrom
posthog-code/restrict-custom-image-vms

Conversation

@tatoalo

@tatoalo tatoalo commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Problem

The Modal VM rollout flag currently allows every manually created cloud run onto the VM runtime. The rollout is intended to cover manual runs that actually need a custom sandbox image.

Changes

  • Require a resolved, ready custom image before a user_created run can use the Modal VM runtime through the feature flag.
  • Preserve explicit runtime overrides used by image-builder sessions.
  • Add bounded custom image build lifecycle metrics for started, succeeded, failed, and scan-rejected outcomes.

@tatoalo tatoalo self-assigned this Jul 14, 2026
@tatoalo
tatoalo marked this pull request as ready for review July 14, 2026 09:33
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team July 14, 2026 09:34
@PostHog PostHog deleted a comment from github-actions Bot Jul 14, 2026
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(tasks): restrict modal VMs to custom..." | Re-trigger Greptile

Comment thread products/tasks/backend/facade/api.py
Comment thread products/tasks/backend/temporal/build_image/activities.py
Comment thread products/tasks/backend/temporal/build_image/activities.py
@tatoalo
tatoalo force-pushed the posthog-code/restrict-custom-image-vms branch from 5ed3667 to 13d34f6 Compare July 14, 2026 09:44
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

🤖 CI report

⚠️ Backend coverage — 67.0% of changed backend lines covered — 11 uncovered

🧪 Backend test coverage

Patch coverage — changed backend lines (products + core): █████████████░░░░░░░ 67.0% (23 / 34)

File Patch Uncovered changed lines
products/tasks/backend/temporal/process_task/activities/get_task_processing_context.py 0.0% 366–367, 372, 389–390
products/tasks/backend/temporal/process_task/activities/tests/test_get_task_processing_context.py 0.0% 647, 655, 726
products/tasks/backend/temporal/build_image/activities.py 25.0% 140, 327, 358

🤖 Agents: add a test covering the lines above, or note why under "How did you test this code?". Machine-readable gap list: the patch-coverage artifact on this run (gh run download 29324684513 -n patch-coverage), or the coverage-data block at the end of this comment.

Per-product line coverage (touched products)
Product Coverage Lines
tasks █████████████░░░░░░░ 66.8% 24,759 / 37,057

Report-only. Patch coverage = changed backend lines covered vs origin/master. Sorted lowest first.
Known gaps: lines covered only by Temporal tests show as uncovered; core line numbers may drift if master changed the same file.

@trunk-io

trunk-io Bot commented Jul 14, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@tatoalo tatoalo added the stamphog Request AI approval (no full review) label Jul 14, 2026
@veria-ai

veria-ai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 1 · PR risk: 0/10

@stamphog stamphog Bot removed the stamphog Request AI approval (no full review) label Jul 14, 2026
Generated-By: PostHog Code
Task-Id: bf2043a7-7d19-4dac-9d50-c0f1780de97a

fix(tasks): widen metric labels for mypy

Generated-By: PostHog Code
Task-Id: bf2043a7-7d19-4dac-9d50-c0f1780de97a

fix(tasks): address custom image rollout reviews

Generated-By: PostHog Code
Task-Id: bf2043a7-7d19-4dac-9d50-c0f1780de97a

fix(tasks): require custom images for modal VMs

Generated-By: PostHog Code
Task-Id: bf2043a7-7d19-4dac-9d50-c0f1780de97a
@tatoalo
tatoalo force-pushed the posthog-code/restrict-custom-image-vms branch from 654165c to a6520a7 Compare July 14, 2026 10:10
@tatoalo tatoalo added the stamphog Request AI approval (no full review) label Jul 14, 2026

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security-sensitive VM sandbox gating fix, but all reviewer concerns (hex-security-app, greptile-apps, veria-ai) were concretely addressed in the diff and confirmed resolved, with a final clean security re-review; author is on the owning team with strong familiarity.

  • Author wrote 100% of the modified lines and has 134 merged PRs in these paths (familiarity STRONG).
  • 👍 on the PR from greptile-apps[bot], hex-security-app[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 39L, 4F substantive, 96L/7F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1c-medium (96L, 7F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ dac9236 · reviewed head a6520a7

@PostHog PostHog deleted a comment from stamphog Bot Jul 14, 2026
@tatoalo
tatoalo enabled auto-merge (squash) July 14, 2026 10:27
@tatoalo
tatoalo merged commit 50c6137 into master Jul 14, 2026
263 checks passed
@tatoalo
tatoalo deleted the posthog-code/restrict-custom-image-vms branch July 14, 2026 10:31
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-14 10:58 UTC Run
prod-us ✅ Deployed 2026-07-14 11:23 UTC Run
prod-eu ✅ Deployed 2026-07-14 11:13 UTC Run

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

Labels

stamphog Request AI approval (no full review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants