scientific-python / upload-nightly-action

This action is used to upload nightly builds of your package.
https://anaconda.org/scientific-python-nightly-wheels
BSD 3-Clause "New" or "Revised" License
7 stars 10 forks source link

jq parsing error of upload date in remove old wheels CI workflow can remove packages #73

Closed matthewfeickert closed 8 months ago

matthewfeickert commented 8 months ago

c.f. https://github.com/numpy/numpy/issues/25907#issuecomment-1973370318

matthewfeickert commented 8 months ago

So I'm not sure what happened here given to reach the

jq: parse error: Invalid numeric literal at line 1, column 6

in

# package: numpy
jq: parse error: Invalid numeric literal at line 1, column 6
# scientific-python-nightly-wheels/numpy/2.0.0.dev0 last uploaded on 
# Removing scientific-python-nightly-wheels/numpy/2.0.0.dev0
Using Anaconda API: https://api.anaconda.org/

during the nightly removal workflow

https://github.com/scientific-python/upload-nightly-action/blob/50053b39cfd4eda8a4046cab060998ea1f8b839e/.github/workflows/remove-wheels.yml#L79-L83

As things like

$ curl --silent https://api.anaconda.org/release/scientific-python-nightly-wheels/scipy/1.13.0.dev0 | jq -r '.distributions[].upload_time' | sort | tail --lines 1 | awk '{print $1}'
2024-03-01

pass as expected, I don't understand what went wrong unless there was an failure in the API call to api.anaconda.org.

If we go with that until we get more information then we should guard

https://github.com/scientific-python/upload-nightly-action/blob/50053b39cfd4eda8a4046cab060998ea1f8b839e/.github/workflows/remove-wheels.yml#L85

to only pass if upload_date is actually a well formed date.