carpentries / actions

GitHub Actions for use in Carpentries-style lessons
1 stars 8 forks source link

[update-lockfile] packages fail to hydrate, causing failure #88

Closed zkamvar closed 10 months ago

zkamvar commented 11 months ago

There is a situation where lesson containing packages that do not exist in the {sandpaper} suite fail to update due to a snapshot validation failure as shown in r-novice-gapminder, https://github.com/swcarpentry/r-novice-gapminder/actions/runs/6386889815/job/17334353257

 The following packages are used in this project, but not available locally:
  - DiagrammeR
  - dplyr
  - ggplot2
  - plyr
  - rmarkdown
  - tidyr
  renv will attempt to download and install these packages.

  - Hydrated 0 packages in 0.0052 milliseconds.
  Error in renv_snapshot_validate_report(valid, prompt, force) : 
    aborting snapshot due to pre-flight validation failure
  Calls: <Anonymous> ... withVisible -> <Anonymous> -> renv_snapshot_validate_report
  Execution halted

This was not a problem for r-novice-inflammation, which does not use much more than knitr: https://github.com/swcarpentry/r-novice-inflammation/pull/595

I will test further and update here when I am able.

zkamvar commented 11 months ago

Currently testing in https://github.com/zkamvar/carpentries-actions-88

so far, I am unable to reproduce the behaviour. I used the following steps:

  1. create a repo
  2. add a new package (cowsay)
  3. request an update to the packages

Unfortunately for my purposes, the workflow ran perfectly. I downgraded the cowsay package in the PR and am attempting it again now.

zkamvar commented 11 months ago

I have also forked R novice gapminder (https://github.com/zkamvar/r-novice-gapminder/) and am checking if it is a cache issue

zkamvar commented 11 months ago

Update: the second try with the MWE did not fail: https://github.com/zkamvar/carpentries-actions-88/actions/runs/6459830829/job/17536371072

But, the fork did fail: https://github.com/zkamvar/r-novice-gapminder/actions/runs/6459912227/job/17536613719

and this leaves me with 🤷🏼

zkamvar commented 10 months ago

The way to fix this was to use renv::snapshot(force = TRUE) (in https://github.com/carpentries/vise/pull/7). I am still not sure why the preflight validation failed. It would say that packages that were available were not available and it was hella confusing.

In any case this should now work properly and if the pull request action fails, #89 will produce an artifact from this workflow that can replace the {renv} folder.