Skip to content

GH-79: feat(core): add optional Logger to PollerDeps — poller logs through injected logger#80

Merged
alekspetrov merged 1 commit into
mainfrom
pilot/GH-79
Jul 6, 2026
Merged

GH-79: feat(core): add optional Logger to PollerDeps — poller logs through injected logger#80
alekspetrov merged 1 commit into
mainfrom
pilot/GH-79

Conversation

@alekspetrov

Copy link
Copy Markdown
Contributor

Summary

Automated PR created by Pilot for task GH-79.

Closes #79

Changes

GitHub Issue #79: feat(core): add optional Logger to PollerDeps — poller logs through injected logger

Problem

sdkcore.PollerDeps has no Logger field, so the poller loop in sdk/integrations/github (and any code it calls) logs through slog.Default(). Consumers embedding the poller cannot attribute its log lines.

Live incident (qf-studio/pilot, 2026-07-06): the SDK github poller failed every poll for ~25 minutes with msg="Failed to fetch issues" 401 errors carrying no component= tag — the operator could not tell which of nine pollers was failing. The consumer-side fix (qf-studio/pilot PR #3919) tags everything the consumer logs itself, but the poller's internal lines stay untagged until the SDK accepts a logger.

Change

  1. Add Logger *slog.Logger to sdkcore.PollerDeps. Semantics: nil → fall back to slog.Default() (zero behavior change for existing consumers).
  2. sdk/integrations/github poller stores the resolved logger at construction and uses it for ALL its log lines (poll loop, dispatch, retry scheduler, board sync paths). Grep for slog. / p.logger in sdk/integrations/github/poller.go — every line goes through the injected logger.
  3. Golden lock: sdk/core is API-locked via TestPublicAPILocked. Adding the field is additive — re-bless with go test ./sdk/core/... -update and commit the regenerated golden. Do not remove or rename existing fields.

Acceptance

  • PollerDeps{} (nil Logger) → identical behavior/output to today.
  • Non-nil Logger receives every poller-originated log line; nothing from the poller reaches slog.Default() when a Logger is set.
  • Golden file updated additive-only; TestPublicAPILocked green.
  • Table-driven test: construct poller with a captured slog handler, run one poll cycle against a stub, assert lines arrive on the injected handler.

Refs

  • qf-studio/pilot PR #3919 (consumer-side fail-loud fix; documents this gap)
  • qf-studio/pilot TASK-368 M7 4d ledger

…ttribution

nil Logger falls back to slog.Default() (zero behavior change); a non-nil
Logger receives every poller-originated log line, including the sequential
mode's merge-wait path. sdk/core golden re-blessed additive-only.
@alekspetrov
alekspetrov merged commit ff1fe0b into main Jul 6, 2026
3 checks passed
@alekspetrov
alekspetrov deleted the pilot/GH-79 branch July 6, 2026 13:31
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.

feat(core): add optional Logger to PollerDeps — poller logs through injected logger

1 participant