CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/golang-github-com-google-go-github

Go client library for accessing the GitHub API v3

Agent Success

Agent success rate when using this tile

65%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.14x

Baseline

Agent success rate without this tile

57%

Overview
Eval results
Files

task.mdevals/scenario-3/

GitHub Webhook Delivery Pager

Build a small library that lists repository webhooks with page-number pagination and walks webhook delivery history with cursor-based pagination, exposing navigation data so callers can follow subsequent pages or stop when finished.

Capabilities

Offset pagination for hooks

  • Lists repository webhooks for an owner/repo using page number and page size, returning hook summaries along with page navigation values (current, next, previous, first, last) derived from the response. @test

Cursor pagination for deliveries

  • Lists deliveries for a specific webhook using cursor tokens (after/before/page token) and a page size, returning delivery summaries plus the next/previous cursor tokens needed to continue traversal. @test

Delivery aggregation

  • Provides a helper that accumulates up to maxDeliveries items by following delivery cursors until the limit is hit or no further pages are available, keeping the newest-first ordering used by the API. @test

Implementation

@generates

API

type HookSummary struct {
	ID        int64
	Name      string
	TargetURL string
	Active    bool
}

type HookPageResult struct {
	Hooks     []HookSummary
	Page      int
	NextPage  int
	PrevPage  int
	FirstPage int
	LastPage  int
}

type DeliverySummary struct {
	ID         int64
	Event      string
	Status     string
	Redelivery bool
}

type DeliveryPageResult struct {
	Deliveries []DeliverySummary
	After      string
	Before     string
	NextCursor string
	HasNext    bool
	HasPrev    bool
}

type Pager interface {
	ListHooks(ctx context.Context, owner, repo string, page, perPage int) (HookPageResult, error)
	ListDeliveries(ctx context.Context, owner, repo string, hookID int64, after, before string, perPage int) (DeliveryPageResult, error)
	CollectDeliveries(ctx context.Context, owner, repo string, hookID int64, maxDeliveries int, perPage int) ([]DeliverySummary, error)
}

// NewPager returns an implementation backed by a GitHub REST client.
// token may be empty for unauthenticated requests.
func NewPager(httpClient *http.Client, token string) Pager

Dependencies { .dependencies }

github.com/google/go-github/v80/github { .dependency }

Typed GitHub REST client with pagination helpers.

net/http { .dependency }

HTTP client configuration.

tessl i tessl/golang-github-com-google-go-github@79.0.1

tile.json