sounisi5011/metalsmith-netlify-published-date

The order of fetching previews should be in Git log order

Closed this issue · 2 comments

Manually retrying a failed deploy may cause the old commit to appear at the top of the API list.
But this is not correct.
The order to get the preview should be the order of Git's logs.

Manually retrying a failed deploy may cause the old commit to appear at the top of the API list.
But this is not correct.
The order to get the preview should be the order of Git's logs.

Is it right?

The purpose of this plugin is to get the date published on Netlify's server.
If the result of building a past commit is the latest preview, that preview is the latest on Netlify's server.

Given these points, I think that we should not get the logs according to Git's commit order.
We should follow the deployment order returned by the Netlify API.

I thought for a long time. But this idea did not change: the order deployed in Netlify must take precedence over the order committed in Git.

  • Netlify's API is probably returned in order from the latest deploy data. In PR #48, API requests have been changed to be the minimum necessary. If we give priority to Git commit order, this plugin have to get all the deploy datas, which takes time.
  • Deploy on Netlify is not just initiated by a Git commit. We can also upload a zip file or rebuild a specific commit.

From the above points, I close this PR.