Skip to content

Default Mixpanel ingestion host to EU region#427

Merged
akolotov merged 5 commits into
mainfrom
claude/awesome-pike-03e78f
Jul 2, 2026
Merged

Default Mixpanel ingestion host to EU region#427
akolotov merged 5 commits into
mainfrom
claude/awesome-pike-03e78f

Conversation

@akolotov

@akolotov akolotov commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Flips the shipped default of the mixpanel_api_host config field to api-eu.mixpanel.com so analytics events are ingested directly in the EU region, and removes the empty-string override of BLOCKSCOUT_MIXPANEL_API_HOST from the two shipped artifacts (Dockerfile, .env.example).

Closes #426.

Why

The central analytics project uses EU data residency and had been relying on Mixpanel's legacy US→EU forwarding, which was sunset on 2026-07-01. The server previously defaulted to the SDK's built-in US endpoint (api.mixpanel.com), so after the sunset events would no longer reach the EU project. Additionally, Dockerfile and .env.example set BLOCKSCOUT_MIXPANEL_API_HOST="" — pydantic reads that empty string as an explicit override, which would silently route ingestion back to US and defeat the new default. Both shipped artifacts now leave the variable commented out so the config default takes effect, while still allowing a runtime override (e.g. -e BLOCKSCOUT_MIXPANEL_API_HOST=api.mixpanel.com) for US or other-region projects.

What changed

  • blockscout_mcp_server/config.pymixpanel_api_host default changed from "" to "api-eu.mixpanel.com", with an inline comment explaining the EU-default rationale and the US override path. analytics.py is deliberately untouched: its existing routing already sends any non-empty host through a custom Consumer.
  • Dockerfile / .env.example — the active empty-value assignments are commented out (mirroring the existing token line), so no shipped artifact overrides the new default; the surrounding comments explain the override path.
  • Tests — added config tests (default / env-override / empty-string-preserved) and analytics routing tests (non-empty host → custom Consumer; empty host → SDK default), and made the existing analytics tests hermetic under the new EU default by patching analytics.Consumer alongside analytics.Mixpanel.
  • Version bump0.17.0.dev3 in pyproject.toml, blockscout_mcp_server/__init__.py, and server.json (in lockstep, per the version-management rule).

Notes for reviewers

  • SPEC.md is intentionally unchanged — this is a low-level config default; the Direct Analytics section documents the token and gating, not the host/region, so no SPEC prose would add value here.
  • mcpb/manifest.json and mcpb/manifest-dev.json are intentionally not bumped — neither the server field nor the tools list changed (per 135-mcpb-manifest-version.mdc).
  • No integration tests were required or added: no tool/helper/data-transformation surface changed and no real Mixpanel network path is exercised in tests.

Verification

  • uv run pytest849 passed, 88 deselected
  • uv run ruff check . → All checks passed
  • uv run ruff format --check . → 164 files already formatted

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Analytics now defaults to the EU Mixpanel endpoint, making region selection clearer out of the box.
  • Documentation
    • Updated example environment settings with guidance for stdio mode and how to switch Mixpanel regions.
  • Bug Fixes
    • Improved runtime configuration so the Mixpanel host is no longer forced to an empty value unless explicitly set.

akolotov and others added 3 commits July 1, 2026 16:43
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@akolotov, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e4df66c3-e88c-469d-a1e1-6051405324c6

📥 Commits

Reviewing files that changed from the base of the PR and between 2ea103f and 0056db9.

📒 Files selected for processing (1)
  • tests/test_analytics.py

Walkthrough

Changes the default Mixpanel analytics ingestion host from an empty string (US default) to api-eu.mixpanel.com, updates Dockerfile and .env.example accordingly, adds/updates tests for config defaulting and Mixpanel client construction, and bumps the package version to 0.17.0.dev3 in three metadata files.

Changes

Mixpanel EU Default Host

Layer / File(s) Summary
Default Mixpanel host configuration and deployment files
blockscout_mcp_server/config.py, Dockerfile, .env.example
mixpanel_api_host now defaults to api-eu.mixpanel.com; Dockerfile no longer overrides it with an empty-string ENV; .env.example documents EU default, US override (empty string), and other regional host options.
Tests for Mixpanel host defaulting and client construction
tests/test_config.py, tests/test_analytics.py
New tests validate default/override/empty-string behavior of mixpanel_api_host; new tests validate _get_mixpanel_client() constructs a custom Consumer for non-empty hosts and skips it for empty hosts; existing tracking tests updated to patch Consumer alongside Mixpanel.

Version Bump

Layer / File(s) Summary
Version metadata bump
blockscout_mcp_server/__init__.py, pyproject.toml, server.json
Package version updated from 0.17.0.dev1 to 0.17.0.dev3 in all three files.

Related Issues: #426 — Default Mixpanel host targets US, breaking EU data-residency ingestion after forwarding sunset.

Suggested labels: bug, analytics, configuration

Suggested reviewers: none identified

Poem:
A rabbit hopped from West to East,
No more forwarding for the feast,
EU events now find their way,
Config bumped, tests display,
Version ticks to dev-three at least.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Version bumps in init.py, pyproject.toml, and server.json are unrelated to the Mixpanel host fix. Move the version-only changes to a separate release PR or remove them if they are not required for this fix.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: defaulting Mixpanel ingestion to the EU region.
Linked Issues check ✅ Passed The PR satisfies #426 by defaulting Mixpanel to api-eu.mixpanel.com and updating shipped artifacts and tests to preserve overrides.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/awesome-pike-03e78f

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@akolotov akolotov changed the title Default Mixpanel ingestion host to EU region (api-eu.mixpanel.com) Default Mixpanel ingestion host to EU region Jul 2, 2026
The empty value is an intentional, tested path (empty -> SDK default US
host), so "Do NOT set it to an empty value" mischaracterized a supported
option as forbidden. Describe empty as the US selector instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@akolotov akolotov marked this pull request as ready for review July 2, 2026 01:23
@akolotov akolotov merged commit d04baa7 into main Jul 2, 2026
6 of 7 checks passed
@akolotov akolotov deleted the claude/awesome-pike-03e78f branch July 2, 2026 18:48
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.

Default Mixpanel host targets US, breaking EU data-residency ingestion after forwarding sunset

1 participant