Skip to content

fix(chip-ingress): retry transient proto ref lookups - #2886

Draft
cawthorne wants to merge 1 commit into
mainfrom
fix/chip-ingress-proto-ref-retry
Draft

cawthorne wants to merge 1 commit into
mainfrom
fix/chip-ingress-proto-ref-retry

Conversation

@cawthorne

Copy link
Copy Markdown
Contributor

What

resolveRefSHA() now retries transient failures from the commit lookup and no longer reports them as a missing ref:

  • up to 4 attempts, backing off from 500ms
  • retried: 5xx, 429, 403 secondary rate limits, and transport errors (DNS/TLS/timeouts)
  • 404 still yields ref "..." not found; anything else is returned wrapped, so callers see the real status

Why

local_cre failed to start the Chip Ingress stack on a transient GitHub API failure:

failed to start Chip Ingress stack: failed to register protos: cannot resolve ref "fa1d775e2138": ref "fa1d775e2138" not found

The same short SHA had been resolved successfully five minutes earlier in the same job, so the ref was valid. resolveRefSHA discarded every error from Repositories.GetCommit and returned ref not found, which made a transient 5xx/403/timeout indistinguishable from a bad pin. It also made no retries.

Tests

New protos_test.go (same package, httptest + go-github client):

  • tag / branch / short-SHA resolution
  • 404 -> ref not found
  • persistent 500 -> error contains 500 and is not reported as not found
  • 502 then 200 -> succeeds on the retry

go test ./chip_ingress_set/ -run TestResolveRef -v passes.

Note: the chip_ingress_set package does not build on current main with the module's containerd/containerd/v2 => v2.1.5 replace — buildkit v0.29.0 needs the newer remotes symbols. To run the tests I pointed that replace at v2.2.2 locally and did not commit it; the package still needs that dependency fix separately.

resolveRefSHA collapsed every error from the commit lookup into "ref not found", so a transient GitHub API failure surfaced as a bad pin and failed local CRE startup. Retry 5xx, 429, secondary rate limits and transport errors, and return the underlying error when it is not a 404.
@github-actions

Copy link
Copy Markdown

📊 API Diff Results

No changes detected for module github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose

View full report

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant