ci: mejoras en workflows de build y release - #14
Conversation
- build.yml: - run-name dinámico para mejor visibilidad en UI - concurrency con cancel-in-progress para cancelar builds obsoletos - filtros paths para solo compilar con cambios relevantes - timeout-minutes: 30 para evitar builds colgados - upload de logs en caso de fallo - comentario de PR mejorado con tabla informativa - release.yml: - run-name dinámico mostrando versión - timeout-minutes: 30 - nombre descriptivo al job - release notes mejoradas con versión dinámica - Actualización de TEXLIVE_VERSION a 2025
…idad con block package
TeX Live 2025 activa automáticamente testphase cuando se usa pdfstandard=ua-2. Se deshabilitan ambos para evitar conflictos con enumitem.
El paquete latex-lab-testphase-latest se carga automáticamente con
\DocumentMetadata{} incluso sin testphase explícito. Comentamos todo
el bloque para evitar el conflicto con enumitem.
Prueba: eliminar la línea \input{eps-metadata} de main.tex en CI
para verificar que el problema es DocumentMetadata.
Prueba para verificar que DocumentMetadata causa el conflicto con block/enumitem en TeX Live 2025.
Sin DocumentMetadata, las claves pdfcopyright, pdfcontactemail, etc. de hyperxmp no están disponibles. Las eliminamos del hypersetup.
La imagen Docker de xu-cheng tiene TeX Live 2025 bleeding edge con el paquete 'block' experimental que rompe enumitem. Ubuntu 24.04 tiene una versión más estable que coincide con lo que los usuarios tendrán.
- Añade hyperxmp a eps-tfg.cls para metadatos XMP sin DocumentMetadata
- CI comenta \input{eps-metadata} para evitar paquete block experimental
- Vuelve a xu-cheng/latex-action con TeX Live 2025
- Mantiene compatibilidad: local usa DocumentMetadata, CI usa hyperxmp
El paquete 'luacode' de LaTeX define \luacode, que entra en conflicto con el entorno luacode de eps-codigo.sty. Renombrado a lualangcode.
- Nuevo job init-comment que crea el comentario inmediatamente al abrir el PR - El comentario muestra estado 'en progreso' mientras compila - Se actualiza con resultado final (éxito o error) al terminar - Comentario con información de error si falla la compilación
Reviewer's GuideActualiza los workflows de build y release a TeX Live 2025, añade comentarios de CI más ricos y tempranos en los PR, optimiza cuándo se ejecuta la CI, deshabilita DocumentMetadata sólo en CI por incompatibilidades con enumitem/block, mejora los artefactos y notas de release, y ajusta la plantilla LaTeX para compatibilidad (hyperxmp, renombrado de entornos Lua, y pequeñas correcciones en listas y glosario). Sequence diagram for the new PR CI comment lifecyclesequenceDiagram
actor Developer
participant GitHub
participant BuildWorkflow
participant init_comment_job as init_comment
participant build_job as build
participant comment_pr_job as comment_pr
participant Artifacts
Developer->>GitHub: Open pull_request
GitHub-->>BuildWorkflow: Trigger build.yml (pull_request)
BuildWorkflow->>init_comment_job: Start job (if pull_request)
init_comment_job->>GitHub: List PR comments
init_comment_job->>GitHub: Create or update CI status comment (En progreso)
init_comment_job-->>BuildWorkflow: Output comment_id
BuildWorkflow->>build_job: Start job (needs init_comment, if not cancelled)
build_job->>GitHub: Checkout repository
build_job->>build_job: Run latex-action with TeX Live 2025
build_job->>build_job: pre_compile disables DocumentMetadata in main.tex
alt Build success
build_job->>Artifacts: Upload main.pdf
else Build failure
build_job->>Artifacts: Upload log files
end
build_job-->>BuildWorkflow: Result success or failure
BuildWorkflow->>comment_pr_job: Start job (needs init_comment and build)
comment_pr_job->>GitHub: List PR comments
alt Build success
comment_pr_job->>GitHub: Update CI comment with success message and artifact link
else Build failure
comment_pr_job->>GitHub: Update CI comment with failure message and log link
end
GitHub-->>Developer: Updated PR comment with final CI status
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
📝 WalkthroughWalkthroughUpdates CI workflows (build & release) with dynamic run naming, path filters, concurrency, TeX Live bumped to 2025, new jobs for PR comments and link checks, improved pre-compile steps and failure artifacts; LaTeX package/API changes (hyperxmp added; Lua listing names renamed), glossary sort added, list spacing removed, and docs updated about enumitem compatibility. Changes
Sequence Diagram(s)sequenceDiagram
participant PR as "Pull Request (Author)"
participant GH as "GitHub Actions"
participant Runner as "Runner (build job)"
participant Artifact as "Artifacts Store"
participant Comment as "Comment Job"
PR->>GH: Push / open PR (paths trigger)
GH->>Runner: start build job (pre_compile + compile)
Runner-->>Artifact: upload build-logs on failure
Runner-->>GH: set job outcome (success/failure)
GH->>Comment: run init-comment -> update PR
Comment->>PR: post final result + links (run, artifacts, TeXLive)
GH->>GH: optional check-links job (on trigger)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @jmrplens, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! Este pull request se centra en mejorar la robustez y la claridad de los procesos de integración continua y despliegue para los documentos LaTeX, al mismo tiempo que resuelve problemas de compatibilidad y nomenclatura dentro de la plantilla. Los cambios aseguran que los builds de CI sean más estables y proporcionen feedback más útil, mientras que las correcciones en la plantilla mejoran la gestión de metadatos y evitan conflictos de paquetes, contribuyendo a una experiencia de desarrollo más fluida y a una mejor calidad del documento final. Highlights
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
📄 Compilación del documento✅ Compilado correctamente
📥 Descargar PDF👉 Ver workflow y descargar artefactos En la sección "Artifacts" encontrarás el archivo TFG-TFM_EPS_UA con el PDF compilado.
Generado automáticamente por GitHub Actions 🤖 |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
There was a problem hiding this comment.
Hey - I've found 4 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `.github/workflows/build.yml:115-121` </location>
<code_context>
+ core.setOutput('comment_id', commentId);
+
+ # 2. Compilar documento
build:
+ name: Compilar documento LaTeX
runs-on: ubuntu-latest
+ timeout-minutes: 30
+ needs: [init-comment]
+ # Ejecutar aunque init-comment se salte (push a main, workflow_dispatch)
+ if: always() && !cancelled()
steps:
</code_context>
<issue_to_address>
**issue (bug_risk):** El `needs: [init-comment]` puede impedir que `build` se ejecute en `push`/`workflow_dispatch` aunque el `if` sea `always()`.
En GitHub Actions, si un job en `needs` queda como `skipped`, todos los dependientes también se marcan como `skipped`, incluso con `if: always()`. Como `init-comment` solo se ejecuta en `pull_request`, en `push`/`workflow_dispatch` se saltará y `build` no llegará a correr.
Para que `build` se ejecute siempre en `push`/`workflow_dispatch`, puedes separar en dos jobs (`build-pr` con `needs: init-comment` y otro `build` sin `needs` para el resto de eventos) o mover la lógica de comentario a un job exclusivo de PRs y dejar `build` sin dependencias.
</issue_to_address>
### Comment 2
<location> `.github/workflows/build.yml:247-253` </location>
<code_context>
}
+ # 4. Verificar enlaces
check-links:
+ name: Verificar enlaces
runs-on: ubuntu-latest
+ # Solo ejecutar si hay cambios en archivos markdown
+ if: >-
+ github.event_name == 'workflow_dispatch' ||
+ contains(github.event.head_commit.modified, '.md') ||
+ github.event_name == 'pull_request'
</code_context>
<issue_to_address>
**issue (bug_risk):** La condición `contains(github.event.head_commit.modified, '.md')` no filtra correctamente cambios en archivos Markdown.
En `push`, `github.event.head_commit.modified` es una lista de rutas completas (p.ej. `['docs/TEXTO_LISTAS.md']`) y `contains` compara elementos completos, no substrings, así que esa condición siempre será `false` para `.md`.
Para filtrar por extensión, podrías, por ejemplo:
```yaml
if: >-
github.event_name == 'workflow_dispatch' ||
contains(join(github.event.head_commit.modified, ' '), '.md') ||
github.event_name == 'pull_request'
```
o plantearte mover este filtrado a `paths:` en el workflow/job, según el comportamiento que quieras.
</issue_to_address>
### Comment 3
<location> `.github/workflows/build.yml:134-136` </location>
<code_context>
- extra_system_packages: py3-pip perl
- pre_compile: pip install latexminted
+ os: debian
+ extra_system_packages: python3-pip
+ pre_compile: |
+ pip install --break-system-packages latexminted
+ # Deshabilitar DocumentMetadata en CI (el paquete block de TeX Live 2025 es experimental
+ # y rompe enumitem). Con hyperxmp cargado en eps-tfg.cls, los metadatos funcionan sin él.
</code_context>
<issue_to_address>
**suggestion:** El uso de `pip` puede no ser robusto tras instalar solo `python3-pip`; sería más seguro usar `pip3` explícitamente.
En estas imágenes de Ubuntu/Debian no se garantiza el alias `pip`, mientras que al instalar `python3-pip` sí sabemos que existirá `pip3`. Para evitar fallos esporádicos de `command not found`, cambia aquí (y en el workflow de release) a `pip3 install --break-system-packages latexminted`.
Suggested implementation:
```
pre_compile: |
pip3 install --break-system-packages latexminted
# Deshabilitar DocumentMetadata en CI (el paquete block de TeX Live 2025 es experimental
# y rompe enumitem). Con hyperxmp cargado en eps-tfg.cls, los metadatos funcionan sin él.
```
Haz el mismo cambio (`pip` → `pip3`) en el bloque equivalente del workflow de release (por ejemplo en `.github/workflows/release.yml` o el archivo que uséis para releases) donde se instale `latexminted` con `python3-pip` como dependencia de sistema.
</issue_to_address>
### Comment 4
<location> `.github/workflows/release.yml:41-42` </location>
<code_context>
- extra_system_packages: py3-pip perl
- pre_compile: pip install latexminted
+ os: debian
+ extra_system_packages: python3-pip
+ pre_compile: |
+ pip install --break-system-packages latexminted
+ # Deshabilitar DocumentMetadata en CI (el paquete block de TeX Live 2025 es experimental
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Mismo comentario sobre `pip` vs `pip3` en el workflow de release.
Aquí también se instala `python3-pip` pero se llama a `pip`. Para mantener consistencia y evitar fallos en runners donde `pip` no exista, mejor usar `pip3 install --break-system-packages latexminted` en este workflow.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||||
There was a problem hiding this comment.
Code Review
Este pull request mejora significativamente la robustez de los flujos de trabajo de CI/CD y la compatibilidad de la plantilla con TeX Live 2025. La inclusión de hyperxmp para la gestión de metadatos y el renombrado de los entornos de Lua para evitar conflictos con paquetes externos son cambios muy acertados. Se ha detectado una pequeña inconsistencia: se hace referencia a entornos 'Dark' para Lua en la documentación que no han sido definidos en el archivo de estilos, lo cual debería corregirse para mantener la integridad de la plantilla.
| \newtcblisting[use counter=listing, list inside=lol, list type=listing]{lualangcode}[1][]{vscode-light-linenos,minted language=lua,title={\faIcon{moon}~~Lua},list entry={\protect\numberline{\thelisting}Lua},#1} | ||
| \newtcblisting[use counter=listing, list inside=lol, list type=listing]{lualangcodeNN}[1][]{vscode-light-nolinenos,minted language=lua,title={\faIcon{moon}~~Lua},list entry={\protect\numberline{\thelisting}Lua},#1} |
There was a problem hiding this comment.
Se ha renombrado el entorno para evitar conflictos con el paquete luacode, lo cual es correcto. Sin embargo, para mantener la consistencia con el resto de lenguajes soportados en la plantilla (y tal como se referencia en la tabla de documentación en desarrollo.tex), se deberían definir también las variantes 'Dark' para Lua. Actualmente, si un usuario intenta usar lualangcodeDark, obtendrá un error de entorno no definido.
\newtcblisting[use counter=listing, list inside=lol, list type=listing]{lualangcode}[1][]{vscode-light-linenos,minted language=lua,title={\faIcon{moon}~~Lua},list entry={\protect\numberline{\thelisting}Lua},#1}
\newtcblisting[use counter=listing, list inside=lol, list type=listing]{lualangcodeNN}[1][]{vscode-light-nolinenos,minted language=lua,title={\faIcon{moon}~~Lua},list entry={\protect\numberline{\thelisting}Lua},#1}
% Lua Dark
\newtcblisting[use counter=listing, list inside=lol, list type=listing]{lualangcodeDark}[1][]{vscode-dark-linenos,minted language=lua,title={\faIcon{moon}~~Lua},list entry={\protect\numberline{\thelisting}Lua},#1}
\newtcblisting[use counter=listing, list inside=lol, list type=listing]{lualangcodeDarkNN}[1][]{vscode-dark-nolinenos,minted language=lua,title={\faIcon{moon}~~Lua},list entry={\protect\numberline{\thelisting}Lua},#1}
| \texttt{rcode} & R & \faIcon{r-project} & \texttt{rcodeDark} \\ | ||
| \texttt{scalacode} & Scala & \faIcon{fire} & \texttt{scalacodeDark} \\ | ||
| \texttt{luacode} & Lua & \faIcon{moon} & \texttt{luacodeDark} \\ | ||
| \texttt{lualangcode} & Lua & \faIcon{moon} & \texttt{lualangcodeDark} \\ |
El problema solo ocurría con 'noitemsep' en el paquete block experimental. Las opciones itemsep=0pt y parsep=0pt funcionan correctamente.
- Mantiene DocumentMetadata activo con pdfstandard=ua-2 y pdfversion=2.0 - Solo deshabilita testphase (el paquete block experimental) - Restaura noitemsep en itemize (funciona sin testphase) - En local: PDF taggeado con accesibilidad completa - En CI: PDF sin tagging pero con metadatos correctos
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/build.yml (1)
258-266:⚠️ Potential issue | 🟠 MajorThe referenced config file
.github/mlc_config.jsonis missing from the repository.The workflow references
config-file: '.github/mlc_config.json'at line 263, but this file does not exist. Even withcontinue-on-error: true, the markdown link checker action will fail to load the configuration. Either create the missing config file or remove the config-file parameter if not needed.
🤖 Fix all issues with AI agents
In @.github/workflows/build.yml:
- Around line 247-256: The job's if condition uses
contains(github.event.head_commit.modified, '.md') which only matches an array
element equal to '.md' and thus never detects filenames like README.md; update
the check-links job (name: Verificar enlaces / job id: check-links) to either
(a) move path filtering to the workflow trigger by adding an on.push.paths
filter for '**/*.md' so the job only runs on markdown changes, or (b) change the
expression to detect substrings by joining the array first — e.g. replace
contains(github.event.head_commit.modified, '.md') with
contains(join(github.event.head_commit.modified, ' '), '.md') — so push events
that modify any .md file will correctly trigger the job.
In `@sty/eps-codigo.sty`:
- Around line 299-301: The file defines lualangcode and lualangcodeNN but misses
their dark variants referenced in the docs; add two new environments named
lualangcodeDark and lualangcodeDarkNN following the same pattern used for other
languages' Dark variants (use the vscode-dark-linenos/vscode-dark-nolinenos
style, minted language=lua, title with the moon icon, list entry Lua, and the
same counter/list options) so that lualangcode, lualangcodeNN, lualangcodeDark,
and lualangcodeDarkNN are all available.
🧹 Nitpick comments (2)
.github/workflows/release.yml (1)
51-58: Version extraction logic is sound.Correctly handles both tag-push and
workflow_dispatchtriggers. Minor note: forworkflow_dispatch, consider validating that the input matches the expectedv*format to prevent malformed release tags..github/workflows/build.yml (1)
48-54: Unused job outputcomment_id.
init-commentdeclarescomment_idas an output (Line 54), and it's set at Line 112, but no downstream job referencesneeds.init-comment.outputs.comment_id. Thecomment-prjob re-searches for the bot comment instead. Consider removing the unused output to reduce noise, or refactoringcomment-prto use it directly and skip the redundant comment search.
El pdfstandard=ua-2 también carga el paquete block experimental, no solo testphase. Por tanto hay que deshabilitar todo DocumentMetadata en CI para evitar conflictos con enumitem.
- Añadir variantes Dark para Lua (lualangcodeDark, lualangcodeDarkNN) - Cambiar pip a pip3 en workflows para mayor robustez - Quitar dependencia needs de build para que funcione en push/dispatch - Simplificar condición de check-links (el workflow ya tiene path filters)
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.github/workflows/release.yml (1)
51-58:⚠️ Potential issue | 🟠 MajorScript injection risk: unsanitized
${{ github.event.inputs.version }}in shell context.
${{ github.event.inputs.version }}is interpolated directly into the shell script by GitHub Actions before the shell executes. A malicious version string (e.g., containing",$(), or backticks) can escape theechoand execute arbitrary commands. Although only collaborators with write access can triggerworkflow_dispatch, the GitHub security hardening guide recommends using an intermediate environment variable.🔒 Proposed fix: use an environment variable to avoid injection
- name: Get version id: version + env: + INPUT_VERSION: ${{ github.event.inputs.version }} run: | if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT + echo "VERSION=$INPUT_VERSION" >> $GITHUB_OUTPUT else echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT fi.github/workflows/build.yml (1)
260-265:⚠️ Potential issue | 🟠 MajorReplace the deprecated
gaurav-nelsonaction with the maintained fork.The original action
gaurav-nelson/github-action-markdown-link-checkwas deprecated in April 2025 and is no longer actively maintained. Use the maintained fork instead:uses: tcort/github-action-markdown-link-check@v1The fork's latest version is v1.1.2 and is actively maintained.
🧹 Nitpick comments (4)
.github/workflows/build.yml (4)
3-7:head_commit.messagemay contain newlines, truncating the run name.
github.event.head_commit.messageincludes the full commit message (subject + body). If multi-line, therun-namewill display only up to the first newline in most GitHub UI contexts. Consider using a truncated or first-line-only approach if a cleaner display is desired — though this is cosmetic only.🔧 Optional: extract first line only
GitHub Actions expressions don't support substring-by-delimiter natively, so a pragmatic alternative is to accept the truncation (GitHub UI handles it) or document that the run name may be long.
12-32: Path filter globs**.texwork but are non-standard.GitHub Actions path filters support
**to match across directories, so**.texmatchesfoo.texanda/b/c.tex. However, the conventional glob pattern is**/*.tex. Both work in GitHub Actions, but the standard form is more recognizable to contributors.🔧 Optional: use conventional glob form
paths: - - '**.tex' - - '**.sty' - - '**.cls' - - '**.bib' + - '**/*.tex' + - '**/*.sty' + - '**/*.cls' + - '**/*.bib' - 'recursos/**' - 'contenido/**' - '.latexmkrc' - '.github/workflows/build.yml'Apply the same change to the
pull_request.pathsblock.
47-112: Init-comment job is well-structured; however, thecomment_idoutput is never consumed.The job declares
comment_idas an output (line 54), butcomment-pr(the only consumer ofneeds: [init-comment]) re-searches for the bot comment vialistCommentsinstead of usingneeds.init-comment.outputs.comment_id. The output is dead code.You could either remove the output declaration, or use it in
comment-prto update the comment directly (avoiding the search and potential race with other bots).♻️ Option A: remove unused output
init-comment: name: Iniciar comentario en PR runs-on: ubuntu-latest if: github.event_name == 'pull_request' - outputs: - comment_id: ${{ steps.create-comment.outputs.comment_id }}♻️ Option B: use the output in comment-pr to skip the search
In the
comment-prscript, useneeds.init-comment.outputs.comment_iddirectly:const commentId = '${{ needs.init-comment.outputs.comment_id }}'; if (commentId) { await github.rest.issues.updateComment({ owner: context.repo.owner, repo: context.repo.repo, comment_id: parseInt(commentId), body: body, }); } else { // fallback: create new comment await github.rest.issues.createComment({ ... }); }
114-121:if: "!cancelled()"is redundant for a job with noneedsdependencies.Since
buildhas noneeds:, the default implicit condition (success()) always evaluates totrue— identical to!cancelled()in this context. The condition adds no behavioral value but doesn't cause harm either. Removing it would reduce a potential source of confusion for future maintainers.
User description
Descripción
Este PR mejora significativamente los workflows de GitHub Actions para compilación y releases.
Cambios realizados
🔧 Build workflow (
build.yml)xu-cheng/latex-action@v4con TeX Live 2025DocumentMetadataen CI para evitar conflictos con el paquete experimentalblock📦 Release workflow (
release.yml)🐛 Fixes en la plantilla
eps-tfg.clspara metadatos XMP sin DocumentMetadataluacoderenombrado alualangcodepara evitar conflicto con el paquete LaTeXluacodeNotas técnicas
El CI compila sin
DocumentMetadata(accesibilidad PDF/UA-2) porque:blockde TeX Live 2025 bleeding edge es incompatible con las opciones deenumitemEsperando feedback de bots de IA 🤖
PR Type
Enhancement, Bug fix
Description
Improved CI/CD workflows with dynamic run names, concurrency control, and path filters
Enhanced PR comments with initial progress indicator and detailed result summary
Updated TeX Live to 2025 and fixed enumitem compatibility with experimental block package
Renamed Lua code environment from
luacodetolualangcodeto avoid package conflictsAdded hyperxmp package for XMP metadata support without DocumentMetadata
Diagram Walkthrough
File Walkthrough
3 files
Enhanced build workflow with improved CI/CD featuresUpdated release workflow with dynamic versioningAdded hyperxmp package for XMP metadata support4 files
Renamed Lua code environment to avoid conflictsAdded sort key for glossary entry compatibilityRemoved noitemsep option for PDF/UA-2 compatibilityRemoved noitemsep option for accessibility compliance2 files
Updated Lua environment name in documentationAdded warning about enumitem and PDF/UA-2 incompatibilitySummary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores