simonw / museums

A website recommending niche museums to visit
https://www.niche-museums.com/
46 stars 11 forks source link

Bug: everything says updated 17th April 2020 today #22

Closed simonw closed 4 years ago

simonw commented 4 years ago

https://twitter.com/kevinmarks/status/1251260017241731074 9B65C085-FEC5-429B-A92A-170A27B4CD8D

simonw commented 4 years ago

https://www.niche-museums.com/browse?sql=select%0D%0A++id%2C%0D%0A++name%2C%0D%0A++created%2C%0D%0A++updated%0D%0Afrom%0D%0A++museums%0D%0Aorder+by%0D%0A++id%0D%0Alimit%0D%0A++101 right now shows:

browse__select_id__name__created__updated_from_museums_order_by_id_limit_101

simonw commented 4 years ago

Ditto for the debug output I just added running in the Action: https://github.com/simonw/museums/runs/596727459

Created:
{
    "1": "2020-04-17T14:50:40-07:00",
    "2": "2020-04-17T14:50:40-07:00",
    "3": "2020-04-17T14:50:40-07:00",
    "4": "2020-04-17T14:50:40-07:00",
    "5": "2020-04-17T14:50:40-07:00",
simonw commented 4 years ago

Theory: could GitHub Actions be defaulting to a shallow checkout which means my annotate_timestamps.py script can't see the full commit history?

simonw commented 4 years ago

Yes that's what's happening! https://github.com/actions/checkout says:

Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. Set fetch-depth to fetch more history.

Looks like I need fetch-depth: 0.

simonw commented 4 years ago

That fixed it: https://github.com/simonw/museums/runs/596738949

Created:
{
    "1": "2019-10-23T21:32:12-07:00",
    "2": "2019-10-23T21:32:12-07:00",
    "3": "2019-10-23T21:32:12-07:00",
    "4": "2019-10-23T21:32:12-07:00",
    "5": "2019-10-23T21:32:12-07:00",
    "6": "2019-10-23T21:32:12-07:00",
    "7": "2019-10-23T21:32:12-07:00",
    "8": "2019-10-23T21:32:12-07:00",
    "9": "2019-10-23T21:32:12-07:00",

https://www.niche-museums.com/ now shows the correct dates again.

browse__select_id__name__created__updated_from_museums_order_by_id_desc_limit_101