keep old nightly builds around
Closed this issue · 8 comments
It seems that the old nightly builds are not being kept around long enough. They need to be kept around for at least a day, I think, since the redirects are only updated daily. Was this a change due to the recent fix to make the nightly builds work again?
I can't really test it locally, of course, but I propose to try the referenced pull request #987.
Here is what I believe: The current CI script removes old builds if and only if they are older than precisely one day. I don't know anything about the code which updates the links on the webpage, but to me it's conceivable that unfortunate timing might be involved:
- At time X, a new nightly is build. The website is not yet updated.
- At time X + a couple hours, the website updating code looks for the newest nightly and sets the redirects.
- At time X + slightly more than one day, a new nightly is build. In the process, the old nightly is removed. The link on the webpage turns into an 404.
- At time X + a couple hours + one day, the website updating code runs agains and sets the new redirects.
The pull request changes the retention period from one day to three days. That way we should be independent from when the website updating code runs. (In principle, two days should suffice if the website updating code runs every day, but why don't play it safe.)
I don't think that the recent fix made any difference to the current problem, but I much of my reasoning is based on educated guesses, so I can't really say for sure. :-)
Sure, let's try it.
This has not been fixed yet. Right now, the redirect links from saunders are still pointing to https://hott.github.io/book/nightly/hott-online-1194-g81c15ec.pdf, which apparently doesn't exist any more.
Looking at the code, I guess probably the problem is that we are deleting files based on how long ago they were created, whereas what we actually need to do is delete them based on how long ago a newer file was created. We need to keep the old builds around for at least a day after the next build is made, to give the redirects time to update; but it looks like right now the old builds will be deleted as soon as the next build is made as long as more than 3 days passed between the two builds.
Here's a silly idea: what if we download the book page on the CI and delete files if they are not the current ones and also don't appear on the book page?
That might work. Feel free to try it!
Alternatively, why aren't we just giving an encrypted key to Travis and letting it login to the machine and run the update script every time a book update is pushed?
I'm not sure; maybe we didn't trust it? Or maybe that would have been more work? Let's see if #1050 solves the problem.