paketo-buildpacks / icu

Apache License 2.0
2 stars 2 forks source link

Fix flaky dependency version retrieval #344

Open sophiewigmore opened 1 year ago

sophiewigmore commented 1 year ago

Expected Behavior

Dependency workflow version retrieval should work seamlessly.

Current Behavior

The retrieval step fails every few days with a flake, see #336, and the passes again. It would be great if we could figure out what the issue is and make that code more resilient so we have less toil associated with dependency workflow failures

ryanmoran commented 1 year ago

This appears to be a common issue across almost all of the repos that retrieve from GitHub. We aren't using an API token when we make the request and so in some cases we get rate-limited.

sophiewigmore commented 1 year ago

Some examples of errors I've seen:

  1. In Passenger: panic: json: cannot unmarshal object into Go value of type []github.GithubReleaseNamesDTO

  2. In ICU: 2023/01/03 12:23:30 received a non 200 status code: status code 403 received

robdimsdale commented 1 year ago

the second failure mode seems entirely consistent with rate-limiting. The first might be unrelated - just a bad response

ryanmoran commented 1 year ago

I think the first case shows up in instances where we aren't checking the status code, so we don't error on a 403 and then try to unmarshal a JSON response that doesn't match our struct and error out.

robdimsdale commented 1 year ago

Also related: https://github.com/paketo-buildpacks/github-config/issues/653

That issue won't cover buildpack-specific dependency code, but it does cover the same types of failure modes in the common tooling.

robdimsdale commented 1 year ago

Also https://github.com/joshuatcasey/libdependency/pull/25 will fix this issue for buildpacks that use libdependency (e.g. passenger)