Skip to content

feat(#5959): consolidate GitLab poll into single auto-promoting schedule - #6074

Merged
ggallen merged 1 commit into
mainfrom
agent/5959-consolidate-poll-schedule
Aug 10, 2026
Merged

feat(#5959): consolidate GitLab poll into single auto-promoting schedule#6074
ggallen merged 1 commit into
mainfrom
agent/5959-consolidate-poll-schedule

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Consolidates the dual fast/full GitLab poll schedules into a single */5 * * * * schedule with automatic full-poll promotion. The poller now decides at runtime whether to run a fast poll (slash commands only) or a full poll (all events) based on how long it's been since the last full poll.

Changes

  • internal/cli/repos_gitlab.go: setupGitLabPipelineSchedules now creates a single "fullsend poll" schedule at */5 * * * * with no FULLSEND_POLL_MODE variable. Removed the enterprise/free tier distinction and the glClient parameter.
  • internal/poll/poll.go: Added shouldFullPoll method that reads FULLSEND_LAST_POLL_AT_FULL to decide mode. If 15+ minutes have elapsed (or first run), a full poll runs; otherwise a fast poll.
  • internal/poll/types.go: Removed SlashCommandsOnly from Options, added FullPollInterval for configurability.
  • internal/poll/state.go: Changed watermarkVarName, dispatchedKeysVarName, failedKeysVarName to use the runtime slashCommandsOnly field instead of the removed option.
  • internal/cli/poll.go: Removed --poll-mode flag and FULLSEND_POLL_MODE env var handling.
  • Tests: Updated all affected tests with new auto-promotion tests covering first run, recent full poll, stale full poll, exact boundary, custom interval, invalid timestamp, and read errors.

Testing

  • All internal/poll/... tests pass with race detection
  • All changed internal/cli/... tests pass
  • go vet passes on changed packages
  • Pre-commit could not run (network policy in sandbox); post-script runs it authoritatively

Closes #5959

Post-script verification

  • Branch is not main/master (agent/5959-consolidate-poll-schedule)
  • Secret scan passed (gitleaks — cff7d7e11d65d7dc90533f06ec2cd472a3a2a3c2..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner August 10, 2026 21:37
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Aug 10, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 10, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:39 PM UTC · Completed 9:51 PM UTC

Commit: c4f9cce · View workflow run →

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.75510% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/cli/poll.go 66.66% 5 Missing ⚠️
internal/cli/repos.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review

Findings

Low

  • [edge-case] internal/poll/poll.goshouldFullPoll uses time.Since(lastFull) to compare the CI runner's wall clock against a timestamp potentially written by a different runner. Clock skew between runners on the same GitLab instance is typically sub-second, making the 15-minute full-poll promotion interval approximate but not functionally problematic. The fail-open design (defaulting to full poll on any error) ensures no events are missed.

  • [CLI-interface-removal] internal/cli/poll.go — The --poll-mode CLI flag has been removed from the hidden fullsend poll command. Risk is low since the command is hidden and deployed schedules used FULLSEND_POLL_MODE (env var), not the CLI flag. Existing installations are migrated when repos install is re-run.

  • [env-var-removal] internal/cli/poll.go — The FULLSEND_POLL_MODE environment variable is no longer read. Deployed GitLab pipeline schedules from prior installations may still set this variable; it will be silently ignored. The auto-promotion logic produces correct behavior regardless.

Previous run

Review

Findings

Medium

  • [scope-creep-beyond-authorization] internal/cli/repos_gitlab.go:173 — The PR removes tier-adaptive schedule creation. The original design created a 60-minute schedule (0 * * * *) for Free tier to respect GitLab's minimum schedule interval constraint. The new implementation unconditionally creates a */5 * * * * schedule, which will fail on Free tier (gitlab.com without Premium/Ultimate) because Free tier's minimum interval is 60 minutes. The ADR update acknowledges this ("eliminates the tier distinction"), and off-system polling is already documented as a supported alternative for Free tier users. Note that on re-install, old working schedules are deleted before the new schedule creation is attempted — if creation fails on Free tier, the user is left with no poll schedule.
    Remediation: Document in the ADR update that Free tier in-CI polling is no longer supported with the single-schedule design, and that Free tier users should use off-system polling (already described in the ADR's "GitLab tier considerations" section). Alternatively, restore tier detection and create an hourly schedule for Free tier.

  • [incomplete-architecture-update] docs/ADRs/0067-gitlab-cron-polling-event-dispatch.md:324 — The ADR update annotation correctly lists superseded sections ("Multi-frequency polling" and related references), but several other sections remain stale: the "Cron poller" introduction still states "5 minutes on Premium/Ultimate, 60 minutes on Free tier"; the "GitLab tier considerations" table and Free tier paragraph still describe the old dual-schedule architecture; and the Consequences section references "5–60 minute delay" and "up to 5 minutes on Premium, 60 minutes on Free."
    Remediation: Either add these sections to the superseded list in the update annotation, or add inline annotations to each stale section noting the change from GitLab: consolidate fast/full poll into a single schedule #5959.

Low

  • [CLI-interface-removal] internal/cli/poll.go — The --poll-mode CLI flag has been removed from the hidden fullsend poll command. Risk is low since the command is hidden and deployed schedules used FULLSEND_POLL_MODE (env var), not the CLI flag. Existing installations are migrated when repos install is re-run (deletes old schedules, creates new one without this variable).

  • [env-var-removal] internal/cli/poll.go — The FULLSEND_POLL_MODE environment variable is no longer read. Deployed GitLab pipeline schedules from prior installations may still set this variable; it will be silently ignored. The auto-promotion logic produces correct behavior regardless — the variable is simply unused. On re-install, old schedules are deleted and replaced without this variable.


Labels: PR modifies GitLab poll dispatch scheduling and install-time schedule setup in Go.

Previous run (2)

Review

Findings

Medium

  • [stale-doc] docs/ADRs/0067-gitlab-cron-polling-event-dispatch.md:306 — The "Multi-frequency polling" section (lines 306–320) describes a dual-schedule architecture (fast poll every 5 min + full poll every 15 min with separate schedules) that this PR replaces with a single 5-minute schedule using auto-promotion via shouldFullPoll(). Related references at lines 355 and 367–374 also describe the old mechanism.
    Remediation: Add an annotation block to the ADR following the existing convention (e.g., the Update (2026-07, #5556) block) documenting that the dual-schedule design was replaced by auto-promotion in GitLab: consolidate fast/full poll into a single schedule #5959.

Low

  • [struct-field-alignment] internal/poll/types.go:14 — The FullPollInterval inline comment starts at a different column than neighboring field comments (PipelineRef, PollJobURL, DispatchSecret) in the Options struct, due to the longer time.Duration type name.
  • [field-naming-convention] internal/poll/poll.go:28 — The slashCommandsOnly field is the only field in the Poller struct with an inline comment; other fields have no inline comments. Consider removing it or adding comments to other non-obvious fields for consistency.

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Aug 10, 2026
@ggallen
ggallen force-pushed the agent/5959-consolidate-poll-schedule branch from c4f9cce to 2706641 Compare August 10, 2026 21:58
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 10, 2026

Copy link
Copy Markdown

🤖 Review · ❌ Terminated · Started 9:59 PM UTC · Ended 10:17 PM UTC

Commit: 2706641 · View workflow run →

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

Site preview

Preview: https://a48ea2f4-site.fullsend-ai.workers.dev

Commit: 353a8acc009f6d26ec05d5f4ffbfc0293244a0f8

@fullsend-ai-review fullsend-ai-review Bot added component/dispatch Workflow dispatch and triggers component/install CLI install and app setup go Pull requests that update go code labels Aug 10, 2026
@fullsend-ai-review

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:59 PM UTC · Completed 10:17 PM UTC

Commit: 2706641 · View workflow run →

Replace the dual fast/full poll schedules with a single schedule that
runs every 5 minutes and auto-promotes to a full poll when 15+ minutes
have elapsed since the last full poll.

Changes:
- setupGitLabPipelineSchedules now creates one schedule ("fullsend poll"
  at */5) for all tiers, removing the enterprise/free distinction and
  the FULLSEND_POLL_MODE variable.
- Poller.Run auto-selects poll mode at the start of each cycle by
  reading FULLSEND_LAST_POLL_AT_FULL: if the watermark is absent or
  15+ minutes old, a full poll runs; otherwise a fast (slash-commands-
  only) poll runs.
- Options.SlashCommandsOnly removed; replaced by runtime auto-promotion
  logic in shouldFullPoll. Options.FullPollInterval added for
  configurability (defaults to 15 min).
- CLI --poll-mode flag and FULLSEND_POLL_MODE env var removed.

Closes #5959

Signed-off-by: Claude <noreply@anthropic.com>
Signed-off-by: Greg Allen <gallen@redhat.com>
@ggallen
ggallen force-pushed the agent/5959-consolidate-poll-schedule branch from 2706641 to 353a8ac Compare August 10, 2026 22:19
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 10, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:21 PM UTC · Completed 10:37 PM UTC

Commit: 353a8ac · View workflow run →

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge and removed requires-manual-review Review requires human judgment labels Aug 10, 2026
@ggallen
ggallen added this pull request to the merge queue Aug 10, 2026
Merged via the queue into main with commit 277a2a8 Aug 10, 2026
24 checks passed
@ggallen
ggallen deleted the agent/5959-consolidate-poll-schedule branch August 10, 2026 23:40
@fullsend-ai-retro

fullsend-ai-retro Bot commented Aug 10, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 11:43 PM UTC · Completed 11:57 PM UTC

Commit: 353a8ac · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #6074 — Consolidate GitLab poll into single auto-promoting schedule

Verdict: Well-functioning workflow with minimal rework. No new proposals warranted — all improvement opportunities are covered by existing issues.

Timeline

  1. Aug 5, 22:12 UTC — Issue #5959 created. Triage agent ran (run 31051810439), applied labels.
  2. Aug 10, 21:19 — Human (ggallen) triggered /fs-code. Code agent ran (run 31433288305), produced 260+/210- across 12 files with 87.8% patch coverage.
  3. Aug 10, 21:37 — PR #6074 opened by code agent.
  4. Aug 10, 21:38–21:51 — Review 1 (run 31434753918) found 1 medium (stale docs) + 2 lows (struct alignment, inline comment consistency).
  5. Aug 10, 21:57 — Human dismissed the struct alignment finding (gofmt controls it) and fixed the inline comment.
  6. Aug 10, 21:58 — Human force-pushed → Review 2 (run 31436299308) found 2 mediums: scope-creep (Free tier impact) and incomplete ADR update.
  7. Aug 10, 22:19 — Human force-pushed with ADR documentation for Free tier impact → Review 3 (run 31437845915) approved with only low-severity observations.
  8. Aug 10, 23:31 — Human approved. 23:40 — Merged.

Total: 6 agent runs (1 triage, 1 code, 3 reviews, 1 retro). Agents repo: fullsend-ai/agents at 6bdcab6.

Review quality assessment

Positive signals:

  • The review agent's medium finding about Free tier scope-creep was accurate and valuable — it identified a real behavioral regression where Free tier users could lose their poll schedule on reinstall. The human addressed it by documenting the change in the ADR.
  • The review agent showed strong longitudinal tracking across 3 iterations: it dropped resolved findings and correctly promoted the PR to approved after both medium concerns were addressed.
  • Low-severity findings on the final review (clock skew edge case, CLI interface removal, env var removal) were reasonable observations appropriate to their severity.

One false positive: The struct-field-alignment finding on internal/poll/types.go flagged comment column alignment that is actually controlled by gofmt. The human correctly dismissed it, noting the columns were already identical (position 31 after tab). This is evidence for existing issue #2387 (review agent should verify functional equivalence before flagging style-only syntax variants).

Rework rate

Two force-pushes to address genuine review findings — reasonable for a 12-file architectural change. The first push addressed the inline comment cosmetic; the second added Free tier documentation in the ADR. Both were substantive changes, not rebase-only pushes, so existing re-review dedup proposals (#4401, #1390) would not have applied.

Token cost

Three review runs totaled ~48 minutes of compute. Each was substantively needed (different commit SHAs with different code). No redundant work identified.

Status reporting anomaly

Review 2 (run 31436299308) was initially reported as "Terminated" at 21:59 UTC, then updated to "Success" at 22:17 UTC. This is additional evidence for existing issue #2572 (review status comment shows Terminated then posts a second Success comment for the same run).

Autonomy readiness

The review agent's performance on this PR supports its growing track record on Go infrastructure changes. It caught the most significant issue (Free tier impact) that the code agent missed, and correctly approved after resolution. The human's unique contributions were: (1) domain knowledge to dismiss the gofmt false positive, (2) the architectural decision to document rather than restore tier detection, and (3) final approval. The false positive on struct alignment is a gap that #2387 would close.

Existing issues with new evidence from this retro

  • #2572 — Review 2 exhibited the Terminated→Success status pattern.
  • #2387 — Struct alignment finding dismissed because gofmt controls it.
  • #5848 — Code agent removed --poll-mode flag without updating CLI docs; the review agent caught the gap via its scope-creep finding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/dispatch Workflow dispatch and triggers component/install CLI install and app setup go Pull requests that update go code ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitLab: consolidate fast/full poll into a single schedule

1 participant