Skip to content

fix(images): fetch-github-driver-versions.js fetchReleases fetches only 100 releases (no pagination) #53

@castrojo

Description

@castrojo

Problem

scripts/fetch-github-driver-versions.js fetchReleases() calls the GitHub Releases API with per_page=100 but does not follow Link header pagination. Once a repository has more than 100 releases, the oldest releases are silently dropped from the driver version history timeline.

At current release cadence (~daily releases for bluefin), this ceiling will be reached within approximately 3 months for repos that don't already exceed it.

Fix

Implement Link header pagination in fetchReleases():

async function fetchReleases(owner, repo) {
  const releases = [];
  let url = `https://api.github.com/repos/${owner}/${repo}/releases?per_page=100`;
  while (url) {
    const response = await fetchWithAuth(url);
    const page = await response.json();
    releases.push(...page);
    const link = response.headers.get('link');
    const next = link?.match(/<([^>]+)>;\s*rel="next"/)?.[1];
    url = next ?? null;
    // Stop early if we've fetched beyond the display window
    if (releases.length > 0 && isOlderThanWindow(releases.at(-1))) break;
  }
  return releases;
}

Add an early-exit guard based on the display window (e.g., 90 days) to avoid over-fetching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions