feat: add /codeboarding-feedback command to capture PR feedback via PostHog#32
Merged
Conversation
…ostHog On an issue_comment whose first word is /codeboarding-feedback, the guard forwards the comment text and PR context to PostHog as an explicit codeboarding_feedback_submitted event, reacts to the comment, and exits before any checkout, engine setup, or LLM-key handling — so feedback never runs the analysis path. - scripts/submit_feedback.py: stdlib-only sender. Strips the command token (newlines preserved), caps at feedback_max_chars, sends one event, swallows all send failures, and never prints the feedback body. Mirrors Core's PostHog key/host defaults and DO_NOT_TRACK / CODEBOARDING_TELEMETRY opt-outs. - action.yml: feedback_command + feedback_max_chars inputs; feedback branch and env in the guard; a 👍 Acknowledge feedback step gated on feedback_received. - README: Feedback command subsection, Inputs rows, and opt-out docs that state plainly this is explicit user feedback (text + PR context), not anonymous telemetry. - tests/test_submit_feedback.py: 26 stdlib unittest cases (extraction, multiline, truncation, opt-outs, host override, JSON shape, no-leak).
Architecture review · 14 components changedgraph LR
n_Analysis_Orchestrator["Analysis Orchestrator"]
n_Structural_Diffing_Engine["Structural Diffing Engine"]
n_Mermaid_Visualization_Engine["Mermaid Visualization Engine"]
n_UX_Integration_Layer["UX #amp; Integration Layer"]
n_Analysis_Orchestrator -- "orchestrates codebase scanning and diff extract…" --> n_Structural_Diffing_Engine
n_Analysis_Orchestrator -- "provides analysis metadata for final reporting" --> n_UX_Integration_Layer
n_Structural_Diffing_Engine -- "provides structural change data for diagram gen…" --> n_Mermaid_Visualization_Engine
n_Mermaid_Visualization_Engine -- "queries specific file changes for component ren…" --> n_Structural_Diffing_Engine
n_Mermaid_Visualization_Engine -- "provides rendered diagrams for GitHub comments" --> n_UX_Integration_Layer
n_UX_Integration_Layer -- "triggers feedback loops and telemetry based on…" --> n_Analysis_Orchestrator
classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
class n_Structural_Diffing_Engine,n_UX_Integration_Layer modified;
linkStyle 5 stroke:#0b5d23,stroke-width:2px;
linkStyle 0,1,2,3,4 stroke:#7d4e00,stroke-width:2px;
Colors indicate component changes compared to Structural Diffing Engine : 1 file changed
UX & Integration Layer : 1 file changed
Explore this PR’s architecture in your browser or VS Code. codeboarding-action · run 27483242044 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a lightweight
/codeboarding-feedback <message>PR-comment command. When a comment's first word is/codeboarding-feedback, the action sends the message text and PR context to CodeBoarding via PostHog as an explicitcodeboarding_feedback_submittedevent, reacts 👍 to the comment, and exits before any checkout, engine setup, cache restore, or LLM-key handling — it never runs the expensive analysis path.Implements
feedback_plan.md.How
scripts/submit_feedback.py— stdlib-only (no new deps; runs before engine setup). Strips the command token (internal newlines preserved, outer whitespace trimmed), caps text atfeedback_max_chars, POSTs one event to PostHog/i/v0/e/, swallows every send failure, and never prints the feedback body. Mirrors Core'stelemetry/service.py: same default public ingest key,CODEBOARDING_POSTHOG_KEY/CODEBOARDING_POSTHOG_HOSToverrides, andDO_NOT_TRACK/CODEBOARDING_TELEMETRY=falseopt-outs.action.yml— newfeedback_command(default/codeboarding-feedback) andfeedback_max_chars(default4000) inputs; an early feedback branch in the guard step (before the trigger/trusted-collaborator checks) that runs the script and exits withskip=true+feedback_received=true; a newAcknowledge feedbackstep gated onfeedback_received. The existingAcknowledge commandstep stays scoped to analysis (skip != 'true').README.md— a "Feedback command" subsection, two Inputs-table rows, and opt-out docs that state plainly this is explicit user-submitted feedback (the text you wrote + who wrote it + PR context), not anonymous telemetry.tests/test_submit_feedback.py— 26 stdlibunittestcases.Event
codeboarding_feedback_submitted,distinct_id = github-user:<sender_id>(fallbackgithub-run:<run_id>),source = github_action_feedback, withfeedback_text(capped),feedback_length,feedback_truncated,repository,repository_id,pr_number,comment_id,comment_url,author_association,sender_login,sender_id,run_id,run_attempt,action_ref.Trust model
The feedback branch runs no PR-head code and sends no source, so — per the plan — it is intentionally not gated on author association; the calling workflow's own
if:condition is the control point. The dogfood workflow already restricts comment triggers toOWNER/MEMBER/COLLABORATOR, and itsstartsWith('/codeboarding')filter already matches/codeboarding-feedback, so no workflow change is needed.Verification
Notes
repository,sender_login, and the user-writtenfeedback_text. That is appropriate for explicit feedback and is documented in the README.