crystal-lang / install-crystal

GitHub Action: Install Crystal programming language
https://crystal-lang.github.io/install-crystal/configurator.html
MIT License
68 stars 8 forks source link

fix: Nightly build failing to fetch artifacts #21

Closed marcdrury closed 1 year ago

marcdrury commented 1 year ago

Update CircleApiBase to use the path to v2 of circleci's API rather than v1.1.

The build artifacts for nightly build 75102 are only available for the URL of v2 of the API, which is currently causing attempts to install the nightly build to fail.

See below: https://circleci.com/api/v1.1/project/github/crystal-lang/crystal/75102/artifacts https://circleci.com/api/v2/project/github/crystal-lang/crystal/75102/artifacts

marcdrury commented 1 year ago

New commit makes the path to v2 of the circleci into a new variable so that other places where use of v1.1 is required aren't broken.

Blacksmoke16 commented 1 year ago

I was looking into this a bit as well and am very confused. I can confirm I can see the artifacts on the v2 API but the v1 API says Build not found. However if I curl, or use an incognito tab, both of them return Bad request.

It feels like this is either an issue with auth, or circle CI is having some issues. I also get an error when trying to view the artifacts on their UI as well: https://app.circleci.com/pipelines/github/crystal-lang/crystal/11513/workflows/28e0e92b-deaf-43ce-87f9-97955d908621/jobs/75102/artifacts Error: [Network Error] Failed to fetch, so not sure what's going on.

marcdrury commented 1 year ago

In incognito mode visiting https://circleci.com/api/v1.1/project/github/crystal-lang/crystal/75102 first will cause https://circleci.com/api/v2/project/github/crystal-lang/crystal/75102/artifacts to return the expected response. Seems pretty weird considering they're different versions of the API. 😵

straight-shoota commented 1 year ago

I can access the artifacts on both API endpoints now. My guess it there was some operational problems at circleci.

As I understand the API documentation v1 and v2 are just different interfaces for accessing the same data (https://circleci.com/docs/api-intro/). It certainly makes sense to upgrade to v2, but we should expect older artifacts to be available in that API version as well. We should update to the API v2 endpoint in all places.

Blacksmoke16 commented 1 year ago

Well that's even more bizarre then as I still can't access either via curl.

image

The other issue is it seems not all endpoints work on both versions. E.g. https://circleci.com/api/v2/project/github/crystal-lang/crystal/tree/master?filter=successful&shallow=true&limit=100&offset=0. And https://circleci.com/docs/api/v2/index.html doesn't even seem to mention you can access artifacts.

Blacksmoke16 commented 1 year ago

Today's build is showing the same behavior. Going to create a thread on their forums about it in the morning.

EDIT: https://discuss.circleci.com/t/issues-fetching-artifacts-vi-ui-and-api/47496

Blacksmoke16 commented 1 year ago

It was indeed a CircleCI issue and they have since rolled that change back. I confirmed both v1 and v2 API endpoints along with the UI are correctly returning the artifacts. Going to close this given it was fixed upstream.

straight-shoota commented 1 year ago

I suppose it might still make sense to upgrade to V2, though? Should we track that in an issue?