Skip to content

ci: mejoras en workflows de build y release - #14

Merged
jmrplens merged 26 commits into
mainfrom
improve-ci-workflows
Feb 8, 2026
Merged

ci: mejoras en workflows de build y release#14
jmrplens merged 26 commits into
mainfrom
improve-ci-workflows

Conversation

@jmrplens

@jmrplens jmrplens commented Feb 8, 2026

Copy link
Copy Markdown
Owner

User description

Descripción

Este PR mejora significativamente los workflows de GitHub Actions para compilación y releases.

Cambios realizados

🔧 Build workflow (build.yml)

  • Comentario al inicio del PR: El comentario de CI ahora aparece inmediatamente al abrir el PR (estado "en progreso") y se actualiza con el resultado final
  • Imagen Docker estable: Usa xu-cheng/latex-action@v4 con TeX Live 2025
  • Compatibilidad mejorada: Deshabilita DocumentMetadata en CI para evitar conflictos con el paquete experimental block
  • Mensajes informativos: Comentarios diferenciados para compilación exitosa o fallida

📦 Release workflow (release.yml)

  • Mismas mejoras de compilación que el build workflow

🐛 Fixes en la plantilla

  • hyperxmp: Añadido al eps-tfg.cls para metadatos XMP sin DocumentMetadata
  • luacode renombrado: El entorno luacode renombrado a lualangcode para evitar conflicto con el paquete LaTeX luacode

Notas técnicas

El CI compila sin DocumentMetadata (accesibilidad PDF/UA-2) porque:

  1. El paquete block de TeX Live 2025 bleeding edge es incompatible con las opciones de enumitem
  2. Los usuarios locales con TeX Live 2025 estable no tienen este problema
  3. El objetivo del CI es validar que el documento compila, no generar el PDF final accesible

Esperando 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 luacode to lualangcode to avoid package conflicts

  • Added hyperxmp package for XMP metadata support without DocumentMetadata


Diagram Walkthrough

flowchart LR
  A["GitHub Actions<br/>Workflows"] -->|"Dynamic run-name<br/>Concurrency control"| B["Enhanced build.yml"]
  A -->|"Path filters<br/>Timeout settings"| B
  B -->|"Disable DocumentMetadata<br/>in CI"| C["TeX Live 2025<br/>Compatibility"]
  D["LaTeX Template<br/>Updates"] -->|"Rename luacode<br/>to lualangcode"| E["Fix Package<br/>Conflicts"]
  D -->|"Remove noitemsep<br/>Add hyperxmp"| E
  B -->|"PR comments with<br/>progress tracking"| F["Improved User<br/>Feedback"]
Loading

File Walkthrough

Relevant files
Enhancement
3 files
build.yml
Enhanced build workflow with improved CI/CD features         
+166/-26
release.yml
Updated release workflow with dynamic versioning                 
+20/-10 
eps-tfg.cls
Added hyperxmp package for XMP metadata support                   
+1/-0     
Bug fix
4 files
eps-codigo.sty
Renamed Lua code environment to avoid conflicts                   
+3/-3     
acronimos.tex
Added sort key for glossary entry compatibility                   
+1/-0     
anexo-tecnicas-avanzadas.tex
Removed noitemsep option for PDF/UA-2 compatibility           
+5/-5     
introduccion.tex
Removed noitemsep option for accessibility compliance       
+1/-1     
Documentation
2 files
desarrollo.tex
Updated Lua environment name in documentation                       
+1/-1     
TEXTO_LISTAS.md
Added warning about enumitem and PDF/UA-2 incompatibility
+2/-0     

Summary by CodeRabbit

  • New Features

    • Dynamic PR comments showing workflow results and status links.
    • Markdown link validation in CI.
    • Extended PDF XMP metadata support.
  • Bug Fixes

    • Renamed Lua code environment identifiers to avoid conflicts.
    • Fixed glossary entry sorting.
    • Restored list spacing by removing incompatible list options.
  • Documentation

    • Added compatibility warning for PDF accessibility options.
  • Chores

    • Upgraded TeX Live to 2025; improved CI error logging and artifact uploads.

- 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
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
@sourcery-ai

sourcery-ai Bot commented Feb 8, 2026

Copy link
Copy Markdown

Reviewer's Guide

Actualiza 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 lifecycle

sequenceDiagram
  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
Loading

File-Level Changes

Change Details Files
Mejora del workflow de build para PR y pushes, con comentarios automáticos en PR, control de concurrencia y ajustes de compilación en TeX Live 2025.
  • Añade run-name dinámico para mostrar en la UI el número y título del PR o el mensaje de commit en builds manuales/push.
  • Restringe la ejecución del workflow a cambios en archivos LaTeX, bibliografía, recursos, contenido, configuración de latexmk y el propio workflow, tanto en push como en pull_request.
  • Configura concurrency para cancelar ejecuciones anteriores del mismo PR/branch.
  • Introduce job init-comment que crea o actualiza un comentario inicial en el PR con estado "en progreso" y enlace al run actual.
  • Actualiza el job build para depender de init-comment pero permitir ejecución en pushes y dispatch usando if: always() && !cancelled().
  • Migra la acción de compilación a xu-cheng/latex-action@v4 usando imagen Debian, TeX Live 2025, python3-pip y pip con --break-system-packages, eliminando la caché de TeX Live.
  • En pre_compile comenta \input{eps-metadata} en main.tex para desactivar DocumentMetadata en CI y añade un grep de verificación.
  • Añade subida de logs como artefacto adicional en caso de fallo de compilación.
  • Refactoriza comment-pr para usar el resultado de build, actualizar el comentario inicial con mensajes diferenciados de éxito/fracaso, incluir tabla de detalles y enlazar a artefactos o logs, manteniendo compatibilidad con PRs previos del bot.
  • Restringe check-links para ejecutarse sólo en workflow_dispatch o cuando haya cambios en .md en el commit o en PR.
.github/workflows/build.yml
Alineación del workflow de release con el nuevo entorno de compilación y mejora de la experiencia de release (nombres, tiempo máximo, notas).
  • Añade run-name descriptivo para releases incluyendo la versión o ref_name.
  • Actualiza TEXLIVE_VERSION a 2025 y configura el job release con nombre y timeout-minutes.
  • Ajusta latex-action a imagen Debian con python3-pip, uso de latexminted vía pip y desactivación de DocumentMetadata comentando eps-metadata en main.tex.
  • En la generación de release_notes.md incluye la versión actual en el texto, usa TEXLIVE_VERSION en requisitos, escapa correctamente shell-escape, comandos y paths en markdown, y añade una nota final de compilación automática con GitHub Actions.
.github/workflows/release.yml
Adaptaciones de la plantilla LaTeX para compatibilidad con accesibilidad PDF/UA-2 y paquetes conflictivos (enumitem, luacode) y pequeñas mejoras de documentación.
  • Elimina la opción noitemsep en varios entornos itemize de anexos y capítulos para evitar conflictos con el paquete experimental block cuando se use DocumentMetadata.
  • Renombra los entornos de listados de código Lua de luacode/luacodeNN a lualangcode/lualangcodeNN para evitar choque con el paquete luacode y actualiza la tabla de resumen de entornos en desarrollo.tex.
  • Añade hyperxmp en eps-tfg.cls para proporcionar metadatos XMP extendidos que no dependan de DocumentMetadata.
  • Documenta en TEXTO_LISTAS.md que las opciones enumitem como noitemsep y nosep no son compatibles con block bajo DocumentMetadata, recomendando listas sin opciones para PDFs accesibles.
  • Corrige la ordenación de la entrada de glosario "índice" añadiendo la clave sort={indice}.
contenido/anexos/anexo-tecnicas-avanzadas.tex
sty/eps-codigo.sty
contenido/capitulos/desarrollo.tex
contenido/capitulos/introduccion.tex
docs/TEXTO_LISTAS.md
cls/eps-tfg.cls
contenido/anexos/acronimos.tex

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Feb 8, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Updates 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

Cohort / File(s) Summary
GitHub Actions — build & release
.github/workflows/build.yml, .github/workflows/release.yml
Added dynamic run-name, path-based triggers, concurrency; bumped TEXLIVE_VERSION to 2025; removed TeX Live cache; added jobs init-comment, build, comment-pr, check-links; upload failure logs artifact; release workflow gains workflow_dispatch input, version resolution, and updated release notes.
LaTeX class
cls/eps-tfg.cls
Added hyperxmp package to enable extended XMP PDF metadata.
LaTeX style / listings
sty/eps-codigo.sty
Renamed Lua listing environments from luacode/luacodeNN to lualangcode/lualangcodeNN and added ...Dark variants to avoid conflict with luacode package.
Content changes
contenido/anexos/acronimos.tex, contenido/anexos/anexo-tecnicas-avanzadas.tex, contenido/capitulos/desarrollo.tex
Added sort={indice} to glossary entry; removed [noitemsep] options from multiple itemize environments; changed Lua environment identifier in documentation/table from luacode to lualangcode.
Documentation
docs/TEXTO_LISTAS.md
Added warning that enumitem spacing options (e.g., noitemsep) are incompatible with the experimental block package used for PDF/UA-2 accessibility; recommends plain lists for accessible PDFs.

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)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰
I hopped through workflows, tidy and spry,
bumped TeX Live to twenty-twenty-five,
renamed the Lua so no names collide,
glossaries sorted, lists now glide —
logs and comments bloom beside the PR sky.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: mejoras en workflows de build y release' directly describes the main changes—improvements to the CI/CD workflows (build.yml and release.yml).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch improve-ci-workflows

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @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

  • Mejoras en Workflows de CI/CD: Se han optimizado los workflows de GitHub Actions para compilación (build.yml) y releases (release.yml), incluyendo comentarios de CI instantáneos y actualizables, y el uso de una imagen Docker estable (xu-cheng/latex-action@v4 con TeX Live 2025).
  • Compatibilidad y Estabilidad de Compilación: Se deshabilita DocumentMetadata en CI para evitar conflictos con el paquete experimental block de TeX Live 2025, asegurando que la compilación de CI se centre en la validación del documento.
  • Correcciones en la Plantilla LaTeX: Se añade el paquete hyperxmp a eps-tfg.cls para metadatos XMP extendidos y se renombra el entorno luacode a lualangcode en sty/eps-codigo.sty y contenido/capitulos/desarrollo.tex para evitar conflictos con el paquete LaTeX luacode.
  • Ajustes en Listas y Glosario: Se elimina la opción noitemsep de varios entornos itemize en los archivos contenido/anexos/anexo-tecnicas-avanzadas.tex y contenido/capitulos/introduccion.tex, y se añade una clave sort a la entrada indice en contenido/anexos/acronimos.tex para mejorar la ordenación del glosario.
  • Documentación de Incompatibilidad: Se añade una nota en docs/TEXTO_LISTAS.md advirtiendo sobre la incompatibilidad de las opciones de enumitem (como noitemsep) con el paquete block al usar \DocumentMetadata{} para accesibilidad PDF/UA-2.
Changelog
  • cls/eps-tfg.cls
    • Se añadió \RequirePackage{hyperxmp} para metadatos XMP extendidos en PDF.
  • contenido/anexos/acronimos.tex
    • Se añadió sort={indice} a la entrada \newglossaryentry{indice} para una correcta ordenación.
  • contenido/anexos/anexo-tecnicas-avanzadas.tex
    • Se eliminó la opción [noitemsep] de cinco entornos \begin{itemize}.
  • contenido/capitulos/desarrollo.tex
    • Se actualizó la referencia del entorno \texttt{luacode} a \texttt{lualangcode} en la tabla de resumen de entornos.
  • contenido/capitulos/introduccion.tex
    • Se eliminó la opción [noitemsep] del entorno \begin{itemize} dentro de un tipbox.
  • docs/TEXTO_LISTAS.md
    • Se añadió una nota de advertencia sobre la incompatibilidad de las opciones de enumitem (noitemsep, nosep, etc.) con el paquete experimental block al usar \DocumentMetadata{} para accesibilidad PDF/UA-2.
  • sty/eps-codigo.sty
    • Se renombraron los entornos luacode y luacodeNN a lualangcode y lualangcodeNN respectivamente, para evitar conflictos con el paquete LaTeX luacode.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/build.yml
    • .github/workflows/release.yml
Activity
  • El autor ha abierto este PR y está esperando feedback de los bots de IA.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions

github-actions Bot commented Feb 8, 2026

Copy link
Copy Markdown

📄 Compilación del documento

Compilado correctamente

Detalle Valor
Commit d07b894
PR #14
TeX Live 2025

📥 Descargar PDF

👉 Ver workflow y descargar artefactos

En la sección "Artifacts" encontrarás el archivo TFG-TFM_EPS_UA con el PDF compilado.

Nota: Los artefactos estarán disponibles durante 90 días.


Generado automáticamente por GitHub Actions 🤖

@qodo-code-review

qodo-code-review Bot commented Feb 8, 2026

Copy link
Copy Markdown

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
Supply chain integrity

Description: Potential supply-chain risk: the workflow executes third-party GitHub Actions by mutable
tags (e.g., actions/github-script@v8, actions/checkout@v6, xu-cheng/latex-action@v4,
actions/upload-artifact@v6) and installs a Python package at runtime via pip install
--break-system-packages latexminted without version pinning or hash verification
(similarly in .github/workflows/release.yml), which could allow compromised upstream
releases/dependencies to execute arbitrary code in CI with GITHUB_TOKEN access.
build.yml [57-141]

Referred Code
- name: Create or update initial comment
  id: create-comment
  uses: actions/github-script@v8
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    script: |
      const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
      const sha = context.payload.pull_request.head.sha.substring(0, 7);

      const body = `## 📄 Compilación del documento

      ⏳ **Compilando...** El documento se está procesando.

      | Detalle | Valor |
      |---------|-------|
      | **Commit** | \`${sha}\` |
      | **Estado** | 🔄 En progreso |

      👉 **[Ver progreso del workflow](${runUrl})**

      ---


 ... (clipped 64 lines)
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/release.yml
@qodo-code-review

qodo-code-review Bot commented Feb 8, 2026

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix comment_id output

Fix the init-comment job by replacing the invalid core.setOutput('comment_id',
commentId) call with return commentId, and update the job's output to use
steps.create-comment.outputs.result.

.github/workflows/build.yml [52-112]

 init-comment:
   outputs:
-    comment_id: ${{ steps.create-comment.outputs.comment_id }}
+    comment_id: ${{ steps.create-comment.outputs.result }}
 ...
-core.setOutput('comment_id', commentId);
+// set up the bot comment
+// ...
+return commentId;

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies that core.setOutput is used improperly and will fail, breaking the workflow's ability to pass the comment_id to subsequent jobs. The proposed fix using a return statement is the correct way to handle outputs in actions/github-script.

High
Improve sed command for robustness

Improve the sed command in the build job's pre_compile step to be more robust by
using a regular expression that tolerates optional leading whitespace.

.github/workflows/build.yml [135-141]

 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.
-  sed -i 's/\\input{eps-metadata}/%\\input{eps-metadata}/' main.tex
+  sed -i -E 's/^[[:space:]]*\\input\{eps-metadata\}/%\\input\{eps-metadata\}/' main.tex
   echo "Verificando que eps-metadata está comentado:"
   grep -n "eps-metadata" main.tex
  • Apply / Chat
Suggestion importance[1-10]: 4

__

Why: The suggestion correctly identifies a potential point of failure and proposes a more robust sed command, which is a good practice for maintainability, although it fixes a potential issue rather than a current bug.

Low
General
Specify TeX Live version

Explicitly pass the texlive_version input to the latex-action in the build job
to ensure the correct TeX Live version is used, preventing potential build
inconsistencies.

.github/workflows/build.yml [127-136]

 - name: Compile LaTeX document
   uses: xu-cheng/latex-action@v4
   with:
+    texlive_version: ${{ env.TEXLIVE_VERSION }}
     root_file: main.tex
     latexmk_use_lualatex: true
     latexmk_shell_escape: true
     os: debian
     extra_system_packages: python3-pip
     pre_compile: |
       pip install --break-system-packages latexminted
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: This suggestion correctly identifies a critical omission where the texlive_version was removed, which could lead to using an incorrect default version and cause build failures. Explicitly setting it ensures the build environment is consistent and correct.

Medium
Enforce TeX Live in release

Explicitly pass the texlive_version input to the latex-action in the release
workflow to ensure the correct TeX Live version is used, preventing potential
build inconsistencies.

.github/workflows/release.yml [34-45]

 - name: Compile LaTeX document
   uses: xu-cheng/latex-action@v4
   with:
+    texlive_version: ${{ env.TEXLIVE_VERSION }}
     root_file: main.tex
     latexmk_use_lualatex: true
     latexmk_shell_escape: true
     os: debian
     extra_system_packages: python3-pip
     pre_compile: |
       pip install --break-system-packages latexminted
       # Deshabilitar DocumentMetadata en CI (el paquete block es experimental)
       sed -i 's/\\input{eps-metadata}/%\\input{eps-metadata}/' main.tex

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 8

__

Why: This suggestion correctly identifies a critical omission where the texlive_version was removed, which could lead to using an incorrect default version and cause release build failures. Explicitly setting it ensures consistency with the main build workflow.

Medium
Use job output for efficiency

Refactor the comment-pr job to use the comment_id output from the init-comment
job, which avoids a redundant and potentially brittle search for the comment.

.github/workflows/build.yml [168-244]

 - name: Update PR comment with result
   uses: actions/github-script@v8
   with:
     github-token: ${{ secrets.GITHUB_TOKEN }}
     script: |
       ...
-      // Buscar y actualizar el comentario del bot
-      const { data: comments } = await github.rest.issues.listComments({
-        owner: context.repo.owner,
-        repo: context.repo.repo,
-        issue_number: context.issue.number,
-      });
-      
-      const botComment = comments.find(comment => 
-        comment.user.type === 'Bot' && 
-        comment.body.includes('📄 Compilación del documento')
-      );
-      
-      if (botComment) {
+      // Actualizar el comentario del bot usando el ID del job 'init-comment'
+      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: botComment.id,
+          comment_id: commentId,
           body: body,
         });
       } else {
+        // Fallback por si el ID no estuviera disponible, aunque no debería ocurrir en un PR.
         await github.rest.issues.createComment({
           owner: context.repo.owner,
           repo: context.repo.repo,
           issue_number: context.issue.number,
           body: body,
         });
       }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 7

__

Why: This is a valid and valuable suggestion that improves the workflow's efficiency and robustness by removing a redundant API call and search logic, instead passing state between jobs as intended.

Medium
  • Update

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread sty/eps-codigo.sty
Comment on lines +300 to +301
\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}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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} \\

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Se ha actualizado la referencia en la tabla a lualangcodeDark, pero este entorno no existe actualmente en sty/eps-codigo.sty. Es necesario definirlo en el archivo de estilos para que la documentación sea coherente y el entorno sea utilizable por los alumnos.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟠 Major

The referenced config file .github/mlc_config.json is missing from the repository.

The workflow references config-file: '.github/mlc_config.json' at line 263, but this file does not exist. Even with continue-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_dispatch triggers. Minor note: for workflow_dispatch, consider validating that the input matches the expected v* format to prevent malformed release tags.

.github/workflows/build.yml (1)

48-54: Unused job output comment_id.

init-comment declares comment_id as an output (Line 54), and it's set at Line 112, but no downstream job references needs.init-comment.outputs.comment_id. The comment-pr job re-searches for the bot comment instead. Consider removing the unused output to reduce noise, or refactoring comment-pr to use it directly and skip the redundant comment search.

Comment thread .github/workflows/build.yml
Comment thread sty/eps-codigo.sty
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)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟠 Major

Script 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 the echo and execute arbitrary commands. Although only collaborators with write access can trigger workflow_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 | 🟠 Major

Replace the deprecated gaurav-nelson action with the maintained fork.

The original action gaurav-nelson/github-action-markdown-link-check was deprecated in April 2025 and is no longer actively maintained. Use the maintained fork instead:

uses: tcort/github-action-markdown-link-check@v1

The fork's latest version is v1.1.2 and is actively maintained.

🧹 Nitpick comments (4)
.github/workflows/build.yml (4)

3-7: head_commit.message may contain newlines, truncating the run name.

github.event.head_commit.message includes the full commit message (subject + body). If multi-line, the run-name will 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 **.tex work but are non-standard.

GitHub Actions path filters support ** to match across directories, so **.tex matches foo.tex and a/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.paths block.


47-112: Init-comment job is well-structured; however, the comment_id output is never consumed.

The job declares comment_id as an output (line 54), but comment-pr (the only consumer of needs: [init-comment]) re-searches for the bot comment via listComments instead of using needs.init-comment.outputs.comment_id. The output is dead code.

You could either remove the output declaration, or use it in comment-pr to 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-pr script, use needs.init-comment.outputs.comment_id directly:

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 no needs dependencies.

Since build has no needs:, the default implicit condition (success()) always evaluates to true — 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant