Skip to content

feat: snapshot_download_gh() should only display job_ids that contain snapshot artifacts #2321

@schloerke

Description

@schloerke

When testing, I have many jobs that run other than R CMD check which will never contain artifacts that end in -snapshots.

I'm proposing that testthat:::gh_find_job() only ask about jobs who actually contain an artifact.

Artifacts can be found (in batches of up to 100) via /repos/OWNER/REPO/actions/runs/RUN_ID/artifacts endpoint. Given we already know the RUN_ID, downloading 1 extra info for clarity seems like an OK tradeoff.

Docs: https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts

Truncated example output from endpoint:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions