woocommerce / grow

7 stars 7 forks source link

Get Plugin Releases - Prevent un-stable version to be fetched. #101

Closed puntope closed 4 months ago

puntope commented 5 months ago

Describe the bug:

Seems like some tests in our repos are failing. In particular. They are failing because the fetching for WC 8.8.0 is failing when calling. git clone --quiet --depth=1 --branch=8.8.0 https://github.com/woocommerce/woocommerce.git /tmp/woocommerce-8.8.0

The odd thing is that in the releases. 8.8.0 is still a draft. But the JSON API is getting it as valid tag.

The cause is that 8.8 release was delayed, so I assume the tag was created in GitHub but that version is not available in WP.org yet and so the fetch fails.

It seems to be common practice that they'll revert the stable tag if something goes wrong with the release, so I'm sure it's going to happen more often in the future.

Expected behavior:

Only fetch stable versions

The first part of the JSON API shows the lates stable tag:

So we can compare that in the script and prevent versions bigger than that stable version to be fetched.

Screenshot 2024-04-11 at 10 10 14

Actual behavior:

Even when reverted, a version can be fetched

Additional details: