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-1/

Release Asset Gateway

Implement a Go helper that uploads release assets, downloads them with redirect-aware handling, and retrieves raw diff or patch content for comparisons.

Capabilities

Uploads release artifact streams

  • Streams a file into the release's asset upload endpoint using the provided name, media type, and size, returning the created asset's id, name, and browser download URL. @test

Redirect-aware downloads

  • With a redirect budget of zero, reports the redirect URL for an asset download without fetching the body. @test
  • With a positive redirect budget, follows redirects and returns the downloaded bytes. @test

Raw comparisons

  • Returns raw diff or patch text for either a commit range or pull request, matching the requested format, and rejects unsupported formats. @test

Implementation

@generates

API

type UploadInput struct {
    Owner      string
    Repo       string
    ReleaseID  int64
    AssetName  string
    MediaType  string
    Size       int64
    Content    io.Reader
}

type DownloadInput struct {
    Owner        string
    Repo         string
    AssetID      int64
    MaxRedirects int // 0 = return redirect URL immediately
}

type RawRequest struct {
    Owner   string
    Repo    string
    BaseRef string // optional when fetching a single pull request
    HeadRef string // commit SHA, branch, or pull request number
    Format  string // "diff" or "patch"
    IsPull  bool   // true when HeadRef refers to a pull request number
}

type AssetResult struct {
    ID           int64
    Name         string
    DownloadURL  string
}

type DownloadResult struct {
    Content     []byte
    RedirectURL string
}

func PublishReleaseAsset(ctx context.Context, input UploadInput) (*AssetResult, error)
func FetchReleaseAsset(ctx context.Context, input DownloadInput) (*DownloadResult, error)
func FetchRawComparison(ctx context.Context, req RawRequest) (string, error)

Dependencies { .dependencies }

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

Typed GitHub REST v3 client with helpers for uploads, release asset redirects, and raw diff/patch retrieval.

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

tile.json