[CI] (3393d57) flask/flask3-social-media#876
Conversation
|
Now I have all the evidence I need. Two critical issues found:
PR Evaluation ReportSummaryThis PR integrates PostHog analytics into a Flask social media microblog application. It adds the
Confidence score: 3/5 🤔
File changes
App sanity check ❌
Issues
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog added to requirements.txt |
| PostHog client initialized | No | Uses incorrect keyword api_key= instead of project_api_key=; will crash on startup. enable_exception_autocapture=True and atexit.register are correct patterns. |
| capture() | Yes | 12 meaningful events captured across auth, social, and API flows with correct distinct_id and properties |
| identify() | N/A | Server-only app |
| Error tracking | No | Flask docs require manual capture_exception() in error handlers since Flask's built-in handlers prevent autocapture from working. No capture_exception() calls in app/errors/handlers.py. |
| Reverse proxy | N/A | Server-only app |
Issues
- Incorrect constructor parameter name:
api_key=is not a valid parameter forPosthog(). The correct parameter name isproject_api_key. This prevents the app from starting. [CRITICAL] - Missing manual
capture_exception()in Flask error handlers: The Flask docs explicitly state thatenable_exception_autocapture=Trueis insufficient for Flask because Flask's built-in error handlers catch exceptions before PostHog can. The500error handler inapp/errors/handlers.pyshould callposthog_client.capture_exception(error). [MEDIUM] posthog_client.set()uses invalid positional argument syntax: Theset()method signature isdef set(self, **kwargs)— it only accepts keyword arguments. The callsposthog_client.set(str(user.id), {'username': user.username})will raiseTypeError. [CRITICAL]
Other completed criteria
- API key loaded from environment variable via
app.config['POSTHOG_PROJECT_TOKEN'] - Host correctly configured to
https://us.i.posthog.comwith env var override atexit.register(posthog_client.shutdown)ensures clean shutdown- Instance-based
Posthog()constructor used (not module-level config) enable_exception_autocapture=Truepassed (correct intent, insufficient for Flask)
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
app/auth/routes.py |
user_signed_up, user_logged_in, user_logged_out, password_reset_requested, password_reset_completed |
Full auth lifecycle coverage with signup_method and login_method properties |
app/main/routes.py |
post_created, profile_edited, user_followed, user_unfollowed, message_sent, posts_export_started |
Comprehensive social engagement tracking with contextual properties (language, recipient/followed user IDs, message_length) |
app/api/users.py |
api_user_created |
API user creation with signup_method: 'api' property |
Issues
usernameset viaset()with invalid syntax: Person property setting ({'username': user.username}) is a good idea but will fail at runtime due to the positional argument issue. Even if fixed,usernameis borderline PII — however since it's set via person properties (not event properties), this is acceptable. [CRITICAL]
Other completed criteria
- Events represent real user actions mapping to actual product flows (signup, login, post, follow, message)
- Events enable product insights — can build registration funnels, engagement trends, retention analysis
- Events include relevant enriched properties (
login_method,signup_method,language,followed_user_id,recipient_user_id,message_length) - No PII in event properties — user IDs are database IDs, not emails;
usernameis in person properties viaset(), not incapture()event properties - Event naming is descriptive and consistent using
snake_caseverb format
Reviewed by wizard workbench PR evaluator
Automated wizard CI run
Source: wizard-pr
Trigger ID:
3393d57App:
flask/flask3-social-mediaApp directory:
apps/flask/flask3-social-mediaWorkbench branch:
wizard-ci-3393d57-flask-flask3-social-mediaWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-03-17T00:05:44.267Z
Duration: 478.7s