Skip to content

fix(tasks): bound imported MCP server DNS validation - #71449

Merged
richardsolomou merged 3 commits into
masterfrom
posthog-code/bound-imported-mcp-dns
Jul 16, 2026
Merged

fix(tasks): bound imported MCP server DNS validation#71449
richardsolomou merged 3 commits into
masterfrom
posthog-code/bound-imported-mcp-dns

Conversation

@richardsolomou

@richardsolomou richardsolomou commented Jul 16, 2026

Copy link
Copy Markdown
Member

Problem

Imported MCP server validation could let slow DNS lookups occupy request workers without a shared deadline.

Changes

Bound lookup time and global admission, give all accepted hosts a lookup slot, deduplicate hosts, and reject oversized lists before DNS work.

How did you test this code?

  • uv run hogli test posthog/security/test/test_url_validation.py
  • uv run hogli test products/tasks/backend/tests/test_presentation_serializers.py
  • uv run mypy posthog/security/url_validation.py products/tasks/backend/presentation/serializers.py; OpenAPI generation and preflight also pass.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Docs update

N/A. This changes internal validation behavior without changing the documented API.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

I used PostHog Code with /rs-address-pr-review, /rs-review-swarm, /improving-drf-endpoints, /implementing-mcp-tools, /writing-tests, and /setup-web-tests. The swarm caught executor queueing and worker-wave edge cases, which are covered by deterministic regression tests.


Created with PostHog Code

Generated-By: PostHog Code
Task-Id: b9edb226-a793-40c7-b04a-2fd194be62d0
@richardsolomou richardsolomou self-assigned this Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hey @richardsolomou! 👋

It looks like your git author email on this PR isn't your @posthog.com address (richard@solomou.dev). Since you're on the PostHog team, it's worth pointing your local git author email at your @posthog.com address. Why it matters:

  • Consistent work identity in git history — internal tooling that attributes commits to team members keys off your @posthog.com address.
  • Keeps team contributions easy to tell apart from external community ones when scanning history.

You can fix it for this repo with:

git config user.email "you@posthog.com"

Or set it globally with git config --global user.email "you@posthog.com". No need to redo this PR — just a nudge for next time. 🙂

Generated-By: PostHog Code
Task-Id: b9edb226-a793-40c7-b04a-2fd194be62d0
Generated-By: PostHog Code
Task-Id: b9edb226-a793-40c7-b04a-2fd194be62d0
@trunk-io

trunk-io Bot commented Jul 16, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@richardsolomou
richardsolomou marked this pull request as ready for review July 16, 2026 09:39
@richardsolomou
richardsolomou requested a review from a team July 16, 2026 09:39
@richardsolomou
richardsolomou enabled auto-merge (squash) July 16, 2026 09:41
@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(tasks): bound DNS resolution admissi..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🤖 CI report

Playwright — all passed

All tests passed.

View test results →

⚠️ Backend coverage — 91.0% of changed backend lines covered — 13 uncovered

🧪 Backend test coverage

Patch coverage — changed backend lines (products + core): ██████████████████░░ 91.0% (137 / 150)

File Patch Uncovered changed lines
posthog/security/url_validation.py 83.6% 80–83, 107–109, 185, 189, 193–194, 203
posthog/security/test/test_url_validation.py 98.0% 80

🤖 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 29487966912 -n patch-coverage), or the coverage-data block at the end of this comment.

Per-product line coverage (touched products)
Product Coverage Lines
platform_features ██░░░░░░░░░░░░░░░░░░ 12.1% 7 / 58
batch_exports ████████░░░░░░░░░░░░ 39.7% 8,414 / 21,220
demo ███████████░░░░░░░░░ 56.2% 1,497 / 2,663
warehouse_sources_queue ████████████░░░░░░░░ 59.2% 148 / 250
tasks █████████████░░░░░░░ 67.4% 25,804 / 38,268
data_tools ██████████████░░░░░░ 70.0% 63 / 90
ai_gateway ███████████████░░░░░ 75.0% 9 / 12
signals ████████████████░░░░ 79.1% 19,035 / 24,073
data_modeling ████████████████░░░░ 80.0% 4,834 / 6,045
cdp ████████████████░░░░ 80.7% 3,118 / 3,864
wizard ████████████████░░░░ 82.5% 772 / 936
notebooks █████████████████░░░ 84.3% 6,343 / 7,520
agent_platform █████████████████░░░ 84.7% 3,273 / 3,862
cohorts █████████████████░░░ 86.1% 4,022 / 4,671
actions █████████████████░░░ 86.6% 717 / 828
product_tours █████████████████░░░ 87.5% 1,266 / 1,447
exports ██████████████████░░ 88.3% 6,891 / 7,800
visual_review ██████████████████░░ 88.5% 5,565 / 6,287
business_knowledge ██████████████████░░ 88.5% 4,400 / 4,969
conversations ██████████████████░░ 88.9% 16,129 / 18,133
dashboards ██████████████████░░ 89.1% 5,719 / 6,418
mcp_analytics ██████████████████░░ 89.1% 2,502 / 2,807
error_tracking ██████████████████░░ 89.6% 9,738 / 10,872
alerts ██████████████████░░ 89.9% 3,638 / 4,046
engineering_analytics ██████████████████░░ 90.1% 5,105 / 5,665
streamlit_apps ██████████████████░░ 90.4% 2,499 / 2,764
slack_app ██████████████████░░ 90.6% 9,511 / 10,503
links ██████████████████░░ 90.6% 183 / 202
marketing_analytics ██████████████████░░ 90.8% 11,514 / 12,684
product_analytics ██████████████████░░ 91.1% 5,599 / 6,143
mcp_store ██████████████████░░ 91.8% 3,668 / 3,995
managed_migrations ██████████████████░░ 91.9% 908 / 988
data_warehouse ██████████████████░░ 92.1% 18,133 / 19,683
workflows ██████████████████░░ 92.4% 5,148 / 5,574
notifications ███████████████████░ 92.7% 1,026 / 1,107
web_analytics ███████████████████░ 92.7% 13,624 / 14,691
ai_observability ███████████████████░ 92.8% 14,868 / 16,019
surveys ███████████████████░ 92.9% 5,687 / 6,120
posthog_ai ███████████████████░ 93.2% 1,322 / 1,418
tracing ███████████████████░ 93.3% 2,435 / 2,611
approvals ███████████████████░ 93.3% 3,395 / 3,640
reminders ███████████████████░ 93.4% 468 / 501
early_access_features ███████████████████░ 93.8% 848 / 904
legal_documents ███████████████████░ 94.1% 1,568 / 1,667
endpoints ███████████████████░ 94.1% 8,606 / 9,143
skills ███████████████████░ 94.4% 2,827 / 2,995
revenue_analytics ███████████████████░ 94.5% 3,598 / 3,809
messaging ███████████████████░ 94.5% 2,530 / 2,677
review_hog ███████████████████░ 94.6% 6,532 / 6,905
logs ███████████████████░ 95.3% 9,528 / 9,994
experiments ███████████████████░ 95.6% 24,179 / 25,296
replay_vision ███████████████████░ 95.7% 13,354 / 13,952
growth ███████████████████░ 95.8% 2,837 / 2,960
annotations ███████████████████░ 96.2% 732 / 761
feature_flags ███████████████████░ 96.3% 16,118 / 16,741
warehouse_sources ███████████████████░ 96.3% 237,728 / 246,902
user_interviews ███████████████████░ 96.4% 2,242 / 2,325
access_control ███████████████████░ 96.8% 849 / 877
data_catalog ███████████████████░ 97.1% 2,034 / 2,095
customer_analytics ███████████████████░ 97.2% 7,480 / 7,698
analytics_platform ████████████████████ 98.0% 2,102 / 2,145
metrics ████████████████████ 98.2% 2,404 / 2,448
live_debugger ████████████████████ 99.2% 613 / 618
field_notes ████████████████████ 99.4% 158 / 159

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.

@richardsolomou
richardsolomou merged commit 9267ac7 into master Jul 16, 2026
311 of 326 checks passed
@richardsolomou
richardsolomou deleted the posthog-code/bound-imported-mcp-dns branch July 16, 2026 10:03
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-16 10:49 UTC Run
prod-us ✅ Deployed 2026-07-16 11:06 UTC Run
prod-eu ✅ Deployed 2026-07-16 11:05 UTC Run

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.

2 participants