Skip to content

Extract shared fullsend install helpers from action.yml and install-fullsend-cli #5511

Description

@rh-hemartin

Problem

action.yml (root) and .github/actions/install-fullsend-cli/action.yml duplicate several blocks of install logic verbatim:

  • OS/arch normalization (runner values to Go release conventions) -- identical 11-line block in both files
  • SHA-to-tag resolution -- same goal, different implementations (curl + manual pagination vs gh api --paginate)
  • retry_curl -- defined twice within action.yml itself (detect step and download step)
  • Source-build clone -- nearly identical shallow-fetch-with-full-clone-fallback pattern

This duplication has already caused the same bug to be patched in both places independently (the jq-injection fix in the SHA-to-tag resolution was one bug fixed twice in a prior review round of #5357).

Proposal

Create .github/scripts/fullsend-install-lib.sh exporting shared functions:

  • retry_curl -- retry wrapper with exponential backoff
  • resolve_runner_platform -- normalize RUNNER_OS/RUNNER_ARCH to Go conventions
  • resolve_sha_to_tag -- look up a 40-char SHA in repo tags, return matching release tag
  • clone_at_ref -- shallow-clone with full-clone fallback for bare SHAs

Both action files source the library instead of inlining the logic.

Align the pagination approach

action.yml uses curl with a manual max_pages=50 cap (no stated rationale for the number), while install-fullsend-cli/action.yml uses gh api --paginate with no cap. The shared resolve_sha_to_tag function should pick one strategy -- either gh api --paginate (no manual cap) or a documented cap with a clear reason for the bound.

Resolve the tag once upstream instead of per-stage-job

The six stage workflows (reusable-code/fix/triage/review/retro/prioritize.yml) each call install-fullsend-cli independently with no cache, so every job/matrix branch re-runs the SHA-to-tag lookup for the same SHA. reusable-dispatch.yml already caches its CLI install via actions/cache keyed on fullsend-cli-${mode}-${job.workflow_sha}, but the stage workflows have no equivalent. Cheap today (66 tags, fits one page) but scales poorly if tag count or fan-out grows. When extracting the shared lib, consider resolving the tag once in a shared route job (or in reusable-dispatch.yml) and passing it down to stage jobs as an input.

Blocked by

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedBlocked by another issue or external dependency

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions