Skip to content

No retry resolving the R version in setup-r (api.r-hub.io/rversions) #1086

Description

@nbenn

The R version is resolved in determineVersion() with a single GET to api.r-hub.io/rversions/resolve/... via getJSON(), which is a bare fetch with no retry:

  • let os: string = OS != "linux" ? OS : await getLinuxPlatform();
    let url: string =
    "https://api.r-hub.io/rversions/resolve/" + version + "/" + os;
    if (ARCH) {
    url = url + "/" + ARCH;
    }
    var tags = await getJSON<IRVersion>(url);
  • async function getJSON<T>(url: string): Promise<T | undefined> {
    const response = await fetch(url, {
    headers: { "User-Agent": "setup-r" },
    });
    if (!response.ok) return undefined;
    return (await response.json()) as T;
    }

A transient timeout resolving the version therefore fails the job (Error: Request timeout: /rversions/resolve/release/linux-ubuntu-24.04/x86_64).

I realise retry has been raised and declined before (#189, #755); this is narrower — just that one resolve GET. Would a small retry-with-backoff (3–5 attempts) around it be worth considering? Happy to open a PR if so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions