fleet(github): WS-11 GitHub issues absorber for fleet intake#7
Merged
Conversation
…intake Implements the GitHub issues absorber (Absorbers::Issues) that normalizes GitHub issue webhook events to the standard fleet work item format, with bot detection, fleet-label dedup, action filtering, and byte-safe description truncation. Includes IssuesActor subscription actor, WebhookSetup mixin for auto-registering webhooks and fleet labels on target repos, and shared Absorbers::Helpers utilities. - Absorbers::Helpers: bot_generated?, has_fleet_label?, ignored?, work_item_fingerprint, generate_work_item_id, transport_connected? - Absorbers::Issues: absorb (normalize → cache → publish), normalize populates instructions: [], context: [], pipeline, config defaults - Absorbers::IssuesActor: subscription actor with pattern 'github.issues.*' - Absorbers::WebhookSetup: setup_fleet_webhook mixin (idempotent, validates webhook_id, creates fleet:* labels) - Wired into lib/legion/extensions/github.rb - 61 specs, 0 failures; 0 rubocop offenses
Fix spec contamination: webhook_setup_spec now uses anonymous module stubs instead of reopening the real runner modules, preventing list_webhooks override from breaking repository_webhooks_spec in full-suite runs.
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.
Summary
Absorbers::Issues— normalizes GitHub issue webhook events to fleet work items with bot detection, fleet-label dedup, action filtering, and byte-safe description truncationAbsorbers::IssuesActor— subscription actor withpattern 'github.issues.*'that delegates to the Issues absorberAbsorbers::WebhookSetupmixin — idempotent webhook registration + fleet label creation (fleet:received,fleet:implementing,fleet:pr-open,fleet:escalated)Absorbers::Helpers— shared utilities (bot detection, label check, fingerprinting,transport_connected?)Design adherence (from 12-github-absorber.md)
set_nx— assessor is the single dedup authority; absorber only does source-specific dedup (bot filter, label check, action filter)fleet:payload:{work_item_id}(24h TTL); AMQP message carries only the reference keypublish_to_assessor— extractstask_idfromRunner::Status.generate_task_idHash, setsmaster_id: task_id,function: 'assess'(String)instructions: []andcontext: []populated on every work itembody.bytesize > max_bytes ? body.byteslice(0, max_bytes).scrub('')with runtime fallback to 32768{ absorbed: false, reason: :publish_failed }returned, not swallowedTest plan
bundle exec rspec spec/absorbers/)bundle exec rubocop lib/legion/extensions/github/absorbers/ spec/absorbers/)Absorbers::Issues.absorbreturnsabsorbed: falsefor bots, already-claimed, ignored actionsWebhookSetup#setup_fleet_webhookis idempotent (returnsexisting: trueif webhook exists)WebhookSetup#setup_fleet_webhookreturnssuccess: falsewhencreate_webhookreturns no idDepends on
publish_to_assessorto deliver; absorber skips silently in lite modeFiles changed