Skip to content

Stop R CMD CHECK from rebuilding markdown vignettes#16

Merged
Rvirgenslane merged 2 commits into
mainfrom
copilot/remove-vignettebuilder-knitr
Jun 3, 2026
Merged

Stop R CMD CHECK from rebuilding markdown vignettes#16
Rvirgenslane merged 2 commits into
mainfrom
copilot/remove-vignettebuilder-knitr

Conversation

Copilot AI commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

R CMD CHECK was failing because vignette installation tried to re-render .Rmd files and expected HTML/PDF outputs, while this repo tracks pre-rendered markdown vignettes (github_document). This change switches package metadata to treat vignette markdown as precompiled docs instead of knitr build targets.

  • Problem alignment

    • Remove knitr vignette build declaration so check/install no longer attempts .Rmd rebuild for vignettes that intentionally output .md.
  • Changes

    • DESCRIPTION
      • Removed VignetteBuilder: knitr.
    • Workflow state
      • Kept R-CMD-check workflow without a --no-build-vignettes args override (reverted/original behavior).
  • Resulting behavior

    • vignettes/*.md are treated as checked-in documentation artifacts, avoiding install-time vignette recompilation expectations for HTML/PDF.
# DESCRIPTION
-VignetteBuilder: knitr
Original prompt

Use pre-compiled markdown vignettes without knitr rebuilding.

Problem

The R-CMD-check workflow fails because R CMD CHECK attempts to re-compile .Rmd vignettes during package installation. The vignettes use output: github_document format which generates .md files, but R CMD CHECK expects .html or .pdf output. The --no-build-vignettes flag doesn't work because the vignette compilation happens during package installation, not during the check phase.

Solution

Remove the VignetteBuilder: knitr entry from DESCRIPTION file. This tells R that:

  1. There are no vignettes that need to be built by knitr
  2. The .md files in vignettes/ are pre-compiled documentation, not build artifacts
  3. R CMD CHECK won't attempt to re-compile them

This approach:

  • ✅ Preserves the github_document output format (git-friendly diffs)
  • ✅ Keeps pre-compiled .md files in version control
  • ✅ Allows CI to pass without vignette compilation issues
  • ✅ Maintains documentation in the repo

Files to Change

  1. DESCRIPTION: Remove line 80 VignetteBuilder: knitr
  2. .github/workflows/R-CMD-check.yml: Remove the args parameter with --no-build-vignettes (revert to original)

Why This Works

Without VignetteBuilder specified, R treats the vignettes/ directory as regular documentation, not as build artifacts that need compilation. R CMD CHECK skips the vignette building step entirely.

The following is the prior conversation context from the user's chat exploration (may be truncated):

Assistant: Entiendo. Ese job que me diste es del run anterior (el que falló). Necesitas que se ejecute un nuevo run con tu cambio actualizado.

Opción rápida: Fuerza un re-run desde GitHub

  1. Ve a: https://github.com/pfizer-opensource/Open-Hotgenes/actions/runs/26854962034
  2. Click en "Re-run all jobs" o "Re-run failed jobs"

O si prefieres hacerlo por CLI:

gh run rerun 26854962034

Eso ejecutará el workflow de nuevo con tu cambio del _R_CHECK_VIGNETTES_SKIP_RUN_: true incluido en el archivo.

¿Ya lo hiciste o quieres que te ayude con otra cosa?

User: (r-reticulate) K29054NKJK:Open-Hotgenes virger$ gh run rerun 26854962034
bash: gh: command not found

Assistant: Necesitas instalar gh (GitHub CLI). Pero hay una forma más fácil:

Simplemente haz un commit vacío y push a tu rama del PR:

git commit --allow-empty -m "Trigger workflow re-run"
git push

Eso triggeará automáticamente el workflow con tu cambio del _R_CHECK_VIGNETTES_SKIP_RUN_: true.

O si prefieres la UI: Ve a https://github.com/pfizer-opensource/Open-Hotgenes/actions/runs/26854962034 y busca el botón "Re-run failed jobs" en la parte superior derecha.

¿Cuál prefieres?

User: que tal con los workflows?

Assistant: Excelente! ✅ Tu cambio funciona:

Run ID Nombre Status Hace
26859113069 R-CMD-check in_progress 29 min
26854962034 R-CMD-check in_progress 18 min

El run 26859113069 es el nuevo que triggeaste con tu commit "Update R-CMD-check.yml":

  • Tiene tu cambio _R_CHECK_VIGNETTES_SKIP_RUN_: true
  • Está in_progress (ejecutándose ahora)
  • Debería pasar ✅ esta vez

Espera a que termine (unos 10-15 minutos). Cuando complete, debería mostrar success en todos los jobs en lugar de failure.

¿Quieres que revise el resultado cuando termine o prefieres que le des un vistazo tú directamente?

User: https://github.com/pfizer-opensource/Open-Hotgenes/actions/runs/26859113069/job/79208573704?pr=14

Assistant: ❌ El cambio NO funcionó como esperado. El problema es que:

La variable de entorno _R_CHECK_VIGNETTES_SKIP_RUN_ no se está aplicando correctamente porque la acción r-lib/actions/check-r-package sigue intentando compilar las viñetas.

El error ahora es diferente (vemos más detalles):

  1. Primeros 2 Rmd: Mismo error de output format (no genera .html ni .pdf)
  2. 03 y 05: Network error (Could not resolve hostname zenodo.org) - intentan descargar datos
  3. Todos fallan porque la variable no se está respetando

✅ Solución Correcta - Opción 2 (Deshabilitar viñetas)

Necesitamos usar la opción args en lugar de una variable de entorno:

- uses: r-lib/actions/check-r-package@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590
  with:
    upload-snapshots: true
    error-on: '"error"'
    args: c("--no-manual", "--as-cran", "--no-build-vignettes")

Agregar "--no-build-vignettes" al args. ¿Quieres que haga ese cambio?

User: si

Assistant: Necesito tu confirmación para hacer el cambio. Te voy a mostrar exactamente qué se va a cambiar:

Cambio en .github/workflows/R-CMD-check.yml (línea 52-56):

# Antes:
      - uses: r-lib/actions/check-r-package@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4
        with:
          upload-snapshots: true
          error-on: '"error"'

# Después:
      - uses: r-lib/actions/check-r-package@6f...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

Copilot AI changed the title [WIP] Remove VignetteBuilder entry to prevent re-compilation of vignettes Stop R CMD CHECK from rebuilding markdown vignettes Jun 3, 2026
Copilot AI requested a review from Rvirgenslane June 3, 2026 03:12
@Rvirgenslane Rvirgenslane marked this pull request as ready for review June 3, 2026 22:30
@Rvirgenslane Rvirgenslane merged commit 52ddd80 into main Jun 3, 2026
4 checks passed
@Rvirgenslane Rvirgenslane deleted the copilot/remove-vignettebuilder-knitr branch June 3, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants