fix: Filter junk from GitHub attachment import, and turn it on by default - #691
Conversation
- Skip attachments authored by [bot] logins (permanent bot_author skip); a new .uploads.yml ingestBotAttachments knob re-admits them on the webhook path - Skip images under 200px on either side (too_small), via a new detectImageDimensions header sniffer in guards.ts (PNG/GIF/JPEG/WebP, fail-open on undecodable headers) - Flip the ingestGithubAttachments auto default to on: linked repos with the App installed import attachments without touching settings; explicit workspace/repo opt-outs still win - Document imported attachments on /docs/github-app and both knobs on /docs/comment-config; update the settings toggle copy and unset paint, uploads ingest help, and docs/cli.md
🦋 Changeset detectedLatest commit: c529b74 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (2)
🚫 Excluded labels (none allowed) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Why
Bots (e.g.
claude[bot]on buildinternet/sunny#1173) embed small decorative GIFs, badges, and status images in PR/issue comments, and the attachment importer was mirroring them into workspaces as junk. Separately, importing required flipping a knob, so most linked repos never got the feature.What
Junk filters in the ingest reconcile core (
apps/api/src/github-ingest.ts):*[bot]login are a permanentbot_authorskip — never fetched, never ledgered. Applies to the webhook path and manualuploads ingestalike.too_smallskip, using a newdetectImageDimensionshelper inguards.tsthat reads PNG/GIF/JPEG/WebP dimensions straight from the header. Undecodable headers fail open (index tier; originals stay on GitHub).New knob:
ingestBotAttachments: truein.uploads.yml(or as a workspace default) re-admits bot media on the webhook path. Added to the canonical@uploads/comment-config, the CLI's generated copy, and the golden parity fixture.Default flip:
ingestGithubAttachmentsnow defaults to on inAUTO_COMMENT_OPTIONS. Workspaces or repos that explicitly set it off keep their setting; the settings toggle now paints unset as on.Docs: new "Imported attachments" section on
/docs/github-app, both knobs documented in/docs/comment-config(its "presentation only" framing corrected),uploads ingesthelp text anddocs/cli.mdupdated.Notes
Testing