Skip to content

feat: import Forgejo pull requests and snapshots during project add #545

Description

@mrcfps

Problem

looper project add skips pull-request discovery and snapshot capture for Forgejo projects. Existing open PRs therefore do not get the same initial inventory, status visibility, and snapshot-backed operator experience as GitHub projects.

Forgejo snapshots are captured only when later role execution happens, which makes a newly added project appear incomplete until automation touches each PR.

Desired outcome

Add provider-aware initial PR discovery and snapshot capture for Forgejo projects.

Scope

  • Discover existing open Forgejo PRs during project add.
  • Capture normalized PR metadata, head/base SHAs, labels, author, draft/state, diff summary, and available review/check state.
  • Support existing snapshot modes or clearly define Forgejo equivalents.
  • Queue bounded asynchronous snapshot work for large repositories.
  • Refresh snapshots through polling/webhook reconciliation.
  • Use provider-qualified repository identity.

Authority and trade-off

The authority is fresh Forgejo PR state. Snapshots are cached observations for status and drift detection, not authority for side-effecting actions.

Concrete failure prevented: missing existing work and misleading project/status output after onboarding.

Cost: project-add latency, API pagination, diff size, storage growth, stale snapshots, and migration of snapshot keys.

A simpler approach of waiting for Reviewer discovery is insufficient because project inventory and operator status should not depend on enabling or triggering a role.

Acceptance criteria

  • Project add reports discovered Forgejo PR and snapshot counts.
  • Existing open PRs appear in project/PR status without first running Reviewer.
  • Snapshot keys do not collide across providers.
  • Full, async, and off modes have explicit Forgejo behavior.
  • Large diffs and long comment histories are bounded.
  • Side effects always re-read Forgejo rather than trusting a snapshot.
  • Contract and live sandbox tests cover initial import, refresh, deletion/closure, and partial failure.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions