Open howardbaik opened 5 months ago
It's unclear from the documentation but it's supposed to be able to be used either way. It shouldn't matter whether a local index file or an index file from online is provided. But if both methods aren't working then we should try to fix that.
I tried to avoid using a local index file by using the online index file. The reason is the GHA seems to specify the working directory as /__w/bench_to_bytes/bench_to_bytes
, and I wasn't sure what to make of this path.
Did some pair programming with Howard.
I am pretty sure this has to do with whether or not the pages were published yet (or if credentials are up to date) Essentially if this part in make_screenshots.R doesn't retireve a pages url then it will make it look like ottrpal::get_chapters() failed because an NA will be passed to it:
if (is.null(opt$base_url)) {
base_url <- cow::get_pages_url(repo_name = opt$repo, git_pat = opt$git_pat)
base_url <- gsub("/$", "", base_url)
}
chapt_df <- ottrpal::get_chapters(base_url = file.path(base_url, "no_toc/"))
Howard thinks this may not be the cause of the error and is going to look into it.
I don't think pages was set up when I first merged the PR, but I set it up before I reran the jobs.
I have created a dummy repo here and have been experimenting with the problematic GHAs.
First, I got the usual git error from the Render bookdown
job:
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.
After I managed to solve all these issues, I ran into a different type of error from Run the screenshot creation
:
Error in webshot::webshot(url, file_name) :
webshot.js returned failure value: 1
It seemed like we need to set force = TRUE
inside webshot::install_phantomjs()
, but that still doesn't fix this error message.
I wonder if we need to setup the pages first before running webshot::webshot()
?
I am helping @kweav with this GHA error. I've identified the source of the error to be running these lines of GHA code, which leads us to this line from the make_screenshots.R script (from ottr-reports), which runs
ottrpal::get_chapters()
.This line throws the error that we see in the GHA: https://github.com/jhudsl/ottrpal/blob/5d44949ef35f9dc258a3c27ff8775d41bc966deb/R/bookdown_to_leanpub.R#L437
Instead of supplying
docs/index.html
, I think we should just provide it the url to the index.html, which in our case ishttps://hutchdatascience.org/bench_to_bytes/index.html
.What do you think @cansavvy ?