r-lib / actions

GitHub Actions for the R community
Creative Commons Zero v1.0 Universal
968 stars 216 forks source link

Update default pandoc #469

Open hadley opened 2 years ago

hadley commented 2 years ago

2.7.3 is getting quite old; would be good to update to what dev RStudio uses, i.e. 2.16.1

gaborcsardi commented 2 years ago

The default is 2.14.2: https://github.com/r-lib/actions/blob/20307d099c364c4a5107b681d37e49e62c790fb8/setup-pandoc/action.yml#L7

hadley commented 2 years ago

Hmmm, then why I am seeing 2.7.3 here: https://pkgdown.r-lib.org/pkgdown.yml?

Given https://github.com/r-lib/pkgdown/runs/4560801265?check_suite_focus=true, maybe I just need to update to v2?

(Still might be worth bumping to 2.16.1 anyway; I have a vague recollection that there's something useful there. But @cderv would be the best person to recommend the default version)

cderv commented 2 years ago

2.14.2 has been put the default in https://github.com/r-lib/actions/issues/336 and it has been done for v2 only so you need r-lib/actions/setup-pandoc@v2 I believe

Last IDE release ships 2.14.0.3 and not yet 2.16.2 which is current last released Pandoc version. 2.16 brings some changes in Lua and revert back the YAML parser but nothing that useful for R user. 2.15 had a fix useful for self-contained document.

Anway, it is hard to choose a good default version. Should actions follow the version shipped with RStudio IDE release ? Seems like a good default.

We could also argue that the action is mainly design for installing Pandoc to test code in CI and that default to last available Pandoc version released is interesting to detect a breakage. One could pin a specific version in workflow when desired. This would require to update the default frequently, or better install the last available release by default. Would that be bad ?

hadley commented 2 years ago

Ok, sounds like the current version is correct, and I just need to switch to v2.

More generally, it seems like the two most important versions are the version used by released RStudio (to check what a user is most likely to see) and the oldest version used on a CRAN machine (to avoid R CMD check issues) . Maybe we could add a couple of aliases so you could do version: CRAN or version: RStudio?

And then maybe version: release would make sense if you always wanted to use the latest pandoc release?

cderv commented 2 years ago

I think the alias would be great. I would also see a version: devel or version: nightly related to https://github.com/r-lib/actions/issues/187. This is useful to test against future version of Pandoc.

Regarding pandoc ships with RStudio, just a note that future IDE release will use the Pandoc version shipped with Quarto and RStudio IDE will pin a Quarto version probably, which pin a Pandoc version. It does not change much but it could mean that Pandoc version in the IDE could increase quicker than it was in the past.

Do we have a service yet (like an API or maybe just a file somewhere) so that we can know which tools use what across RStudio ? It could simplify the maintenance for an action using such aliases.

gaborcsardi commented 2 years ago

We could add version aliases, with the price that they'll make the action less robust. E.g. for RStudio we would need to query the pandoc version in RStudio somewhere. So I think we should still keep the default a well defined reasonably recent version that we occasionally update.

The RStudio devel version is maybe here (in the master branch): https://github.com/rstudio/rstudio/blob/ed4b652356424770419680d85f742b2a88bf87d2/dependencies/common/install-pandoc#L24

The released version might be in the latest tag, but I am not sure: https://github.com/rstudio/rstudio/blob/v2021.09.1+372/dependencies/common/install-pandoc#L24

CRAN uses different versions on different machines, so that is not very well defined.

cderv commented 2 years ago

For RStudio IDE, I don't know how those file you found will still be correct as I understand that Pandoc version from Quarto will be used now (https://github.com/rstudio/rstudio/commit/12fcc2f4796f7edb5c645f5f9d9e79d42f716ffd)

Quarto version is indicated in a similar file: https://github.com/rstudio/rstudio/blob/b2694ae09e6c6f5560482084b655197bc3871123/dependencies/common/install-quarto#L29 but then Pandoc version would be in the file from the versioned tag then https://github.com/quarto-dev/quarto-cli/blob/bdfb7c3c0101bcd2575af067dbed1b8c3aaef729/configuration#L13

gaborcsardi commented 2 years ago

Seems like quarto now uses 2.19.2: https://github.com/quarto-dev/quarto-cli/blob/38b7b765c5594fa19a73f854eefe2c98fdb3cdc8/configuration#L13

So FWIW I am going to update the hardcoded default now in the setup-pandoc action.

gaborcsardi commented 2 years ago

This is blocked by some service that we can rely on for the various pandoc versions.

cderv commented 2 years ago

Can you be more precise on what you mean by some service ? What is blocking to update default pandoc version to latest version 2.19.2 ? You mean knowing which version we should update to and when ? We could probably provide such info within Quarto website if we want to rely on Quarto bundled version

gaborcsardi commented 2 years ago

What is blocking to update default pandoc version to latest version 2.19.2 ?

Nothing, I already did that.

The version: CRAN etc. part is blocked. We need to be able to look up this info somewhere, in a robust way.

We could probably provide such info within Quarto website if we want to rely on Quarto bundled version

Yeah, that's a good step.

gaborcsardi commented 1 year ago

To determine the latest pandoc release, we could use the https://github.com/jgm/pandoc/releases/latest link, this is redirected to the latest tag. Hopefully this has the binaries at the time it is created.

OTOH determining the versions in RStudio release and nightly needs a different logic, and is probably more fragile. So it would be still best to add these versions to https://api.r-hub.io/rversions/

cderv commented 1 year ago

To determine the latest pandoc release, we could use the https://github.com/jgm/pandoc/releases/latest link, this is redirected to the latest tag. Hopefully this has the binaries at the time it is created.

That is what I am using also in pandoc::pandoc_install()

@tarleb do you know when Github Pandoc releases are done if the binaries are already downloaded before making the release endpoint public ?

OTOH determining the versions in RStudio release and nightly needs a different logic, and is probably more fragile. So it would be still best to add these versions to api.r-hub.io/rversions

It could be probably easier for RStudio IDE team to maintain this information and each release and daily version. They have JSON endpoint for products where this may be interesting to add : https://dailies.rstudio.com/json-api/

OTOH Pandoc comes with Quarto now in the product, so maybe worth adding the information in Quarto own JSON ? We could easily add it.

Just ideas. api.r-hub.io/rversions could also be a good place for that probably.

tarleb commented 1 year ago

@tarleb do you know when Github Pandoc releases are done if the binaries are already downloaded before making the release endpoint public ?

Don't know for sure, but I believe that they are.

tarleb commented 1 year ago

FWIW, there's also pandoc/actions/setup.

hadley commented 1 year ago

@cderv would you mind working with the IDE/quarto teams to figure where's the best place to expose this info?

cderv commented 1 year ago

Sure - I'll work with them.

gaborcsardi commented 8 months ago

Some changes.

(These changes are coming in the next r-lib/actions release.)