Skip to content

feat: added dynamic last changelog component#161

Merged
fuzilogik2019 merged 4 commits intodevelopfrom
feat/SLEAK-5399_dynamicLastChangelogs
Mar 20, 2026
Merged

feat: added dynamic last changelog component#161
fuzilogik2019 merged 4 commits intodevelopfrom
feat/SLEAK-5399_dynamicLastChangelogs

Conversation

@fuzilogik2019
Copy link
Copy Markdown
Contributor

@fuzilogik2019 fuzilogik2019 commented Mar 20, 2026

Summary by CodeRabbit

  • New Features

    • Inicio muestra changelogs recientes cargados dinámicamente con fechas localizadas, secciones “Features”/“Bug Fixes” y enlaces “Leer más”.
  • Documentation

    • Ampliadas FAQ y guías de Variable Groups (ENV vs FILE) y descripción de “Replicate To”; mejoras de redacción en las guías CLI en español.
  • Chores

    • Limpieza y normalización de metadatos de documentación; reorganización/posicionamiento de páginas en la barra lateral y reducción de entradas por página en el changelog.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 20, 2026

Walkthrough

Se añade el plugin Docusaurus changelog-recent para exponer los changelogs más recientes; se limpian y reorganizan frontmatter en múltiples MDX/MD, se amplía la doc de Variable Groups, se actualiza docusaurus.config.js, se añade gray-matter y el componente RecentChangelog pasa a consumir los datos del plugin con ajustes de estilos.

Changes

Cohort / File(s) Summary
Frontmatter — limpieza y posiciones
content/changelog/es/2026-02-23-version-2.6.0.md, content/docs/en/cluster/index.mdx, content/docs/en/project/workload/job.mdx, content/docs/es/cluster/index.mdx, content/docs/es/project/dependency/faqs.mdx, content/docs/es/project/workload/job.mdx, content/docs/en/*.mdx, content/docs/es/*.mdx, docs/*.mdx, i18n/es/docusaurus-plugin-content-docs/current/*
Eliminación de campos vacíos y ajuste/añadido de sidebar_position en numerosas páginas MD/MDX (reordenado de la barra lateral).
Variable Groups (doc) — ampliación
docs/project/vargroup/index.mdx, i18n/es/docusaurus-plugin-content-docs/current/project/vargroup/index.mdx
Corrección del título y ampliación de la sección: diferencias ENV vs FILE, descripción de “Replicate To/Replicar en”, ejemplos y nuevas imágenes.
Plugin changelog-recent
plugins/changelog-recent.js
Nuevo plugin que escanea .md/.mdx, usa gray-matter para extraer frontmatter, parsea secciones y publica las N entradas más recientes en datos globales (recentChangelogs).
Docusaurus config
docusaurus.config.js, sidebars.js
Ajustes en el blog de changelog (postsPerPage: 5, onUntruncatedBlogPosts: "ignore"), registro del plugin changelog-recent con { count: 3 } y conversión del sidebar a una definición explícita y categorizada.
Componente RecentChangelog + estilos
src/components/Homepage/RecentChangelog.jsx, src/components/Homepage/RecentChangelog.module.css
El componente pasa a consumir usePluginData("changelog-recent"), refactoriza renderizado por secciones (features/bug fixes), cambia clases CSS y elimina datos hardcodeados; ajustes visuales y de estructura.
Dependencias
package.json
Se añade la dependencia gray-matter (^4.0.3).

Sequence Diagram

sequenceDiagram
    participant FS as Sistema de Archivos
    participant Plugin as Plugin: changelog-recent
    participant Docusaurus as Datos Globales Docusaurus
    participant Component as Componente: RecentChangelog
    participant Browser as Navegador

    FS->>Plugin: Lee archivos `.md`/`.mdx`
    Plugin->>Plugin: Extrae frontmatter con `gray-matter` y parsea secciones
    Plugin->>Plugin: Calcula fecha y slug, ordena por fecha y selecciona N
    Plugin->>Docusaurus: Publica `recentChangelogs[]`
    Component->>Docusaurus: `usePluginData("changelog-recent")`
    Docusaurus->>Component: Retorna `recentChangelogs[]`
    Component->>Component: Renderiza secciones, badges y enlaces
    Component->>Browser: Devuelve HTML para la homepage
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • lucaiz
  • mjroson
  • gastonzarate

Poem

en sleakops arreglamos los conflictos a las piñas 🥊
el changelog brilla y encuentra su rincón,
frontmatter al día y FAQs con explicación,
plugins que cuentan lo último sin batallón,
¡homepage lista, celebremos con canción! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed El título describe de manera general el cambio principal (componente dinámico de changelog), pero es vago respecto a la amplitud real de las modificaciones (reordenamiento de sidebar, cambios de frontmatter, nuevo plugin, estilos CSS).

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/SLEAK-5399_dynamicLastChangelogs

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/project/vargroup/index.mdx`:
- Around line 150-168: La sección "3. Select a Type and configure your
variables" deja el botón/acción de "Submit" antes de un campo obligatorio
("Mount Path" cuando se elige FILE); mueve el control de envío ("Submit...")
para que aparezca después de la configuración del Type y después de que el
usuario pueda rellenar el Mount Path (es decir, reubica el flujo para que FILE
-> Mount Path -> Submit), y aplica la misma reordenación en la versión en
español del documento (la copia i18n/es correspondiente) para mantener ambos
documentos sincronizados.
- Around line 158-185: Add the missing image files referenced by the Zoom
components: create and commit img/vargroup/vargroup-env.png and
img/vargroup/vargroup-file.png (matching the exact filenames and case) so the
references in docs/project/vargroup/index.mdx and its Spanish translation in
i18n/es/docusaurus-plugin-content-docs/current/project/vargroup/index.mdx
resolve; if you cannot supply final artwork, add appropriately-sized placeholder
PNGs and ensure the Zoom src attributes still point to these filenames and that
both docs build without broken links.

In `@i18n/es/docusaurus-plugin-content-docs/current/cli.mdx`:
- Around line 201-203: The current help text shows a literal placeholder
"sleakops sub-command --help" which appears copy-pastable; update the text to
either use a clear placeholder or concrete examples by replacing "sleakops
sub-command --help" with "sleakops <sub-command> --help" or with real commands
like "sleakops build --help" and "sleakops deploy --help", and ensure
consistency with how the environment flag (-e / --environment and the term
"environment") is documented elsewhere on the page; locate and edit the string
"sleakops sub-command --help" in the CLI docs block to implement this change.

In `@src/components/Homepage/RecentChangelog.jsx`:
- Around line 7-16: The formatDate function currently hardcodes English month
names and the "MMM D, YYYY" layout; replace that with Intl.DateTimeFormat using
the active Docusaurus locale (useDocusaurusContext().locale in the component) so
dates respect localization. Update formatDate to accept a locale (or call
Intl.DateTimeFormat from the component) and format with options { month:
"short", day: "numeric", year: "numeric" } instead of the months array and
manual string assembly; remove the months constant and any fixed "T00:00:00"
hack and let Date/Intl handle formatting.
- Around line 19-31: Las etiquetas hardcodeadas en badgeConfig
(added/fixed/improved) y el texto "+N more" deben internacionalizarse; en
TypeBadge usa las cadenas traducidas en lugar de labels estáticos (por ejemplo
obteniendo la traducción vía el componente/función Translate o
usePlural/translate) y reemplaza el render que genera "+N more" por una llamada
a Translate que acepte el número dinámico (p. ej. una clave like
"changelog.more" con parámetro count) para que tanto badgeConfig (referenciado
por badgeConfig y TypeBadge) como la sección que construye "+N more" usen las
traducciones apropiadas en lugar de texto en inglés.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7d4e7370-755d-4e49-9616-a81ab1b521b4

📥 Commits

Reviewing files that changed from the base of the PR and between 335106a and 9877f5d.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (14)
  • content/changelog/es/2026-02-23-version-2.6.0.md
  • content/docs/en/cluster/index.mdx
  • content/docs/en/project/workload/job.mdx
  • content/docs/es/cluster/index.mdx
  • content/docs/es/project/dependency/faqs.mdx
  • content/docs/es/project/workload/job.mdx
  • docs/project/vargroup/index.mdx
  • docusaurus.config.js
  • i18n/es/docusaurus-plugin-content-docs/current/cli.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/project/vargroup/index.mdx
  • package.json
  • plugins/changelog-recent.js
  • src/components/Homepage/RecentChangelog.jsx
  • src/components/Homepage/RecentChangelog.module.css
💤 Files with no reviewable changes (6)
  • content/docs/es/project/dependency/faqs.mdx
  • content/docs/en/cluster/index.mdx
  • content/changelog/es/2026-02-23-version-2.6.0.md
  • content/docs/es/cluster/index.mdx
  • content/docs/en/project/workload/job.mdx
  • content/docs/es/project/workload/job.mdx

Comment thread docs/project/vargroup/index.mdx
Comment thread docs/project/vargroup/index.mdx
Comment thread i18n/es/docusaurus-plugin-content-docs/current/cli.mdx
Comment thread src/components/Homepage/RecentChangelog.jsx Outdated
Comment thread src/components/Homepage/RecentChangelog.jsx Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/Homepage/RecentChangelog.jsx (1)

28-30: Consideración menor sobre el manejo del título.

La regex replace(/^Version\s*/i, "") asume que el título comienza con "Version". Si en el futuro algún changelog tiene un título diferente (o en español como "Versión"), el v en la línea 40 podría quedar raro (ej: vMi Título).

No es bloqueante, pero podríais considerar manejar ambos idiomas en el regex o validar el formato esperado.

♻️ Sugerencia opcional para soportar títulos en español
function ChangelogEntry({ entry, idx, locale }) {
-  const version = entry.title.replace(/^Version\s*/i, "");
+  const version = entry.title.replace(/^Versi[oó]n\s*/i, "");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Homepage/RecentChangelog.jsx` around lines 28 - 30, The code
in ChangelogEntry currently strips only English "Version" via version =
entry.title.replace(/^Version\s*/i, which can produce odd results for titles
like "Versión" or non-prefixed titles; update the logic in function
ChangelogEntry to robustly extract a version token by matching both English and
Spanish prefixes (e.g., /^Versi(ón|on)\b[:\s-]*/i) or by validating a semantic
version/number pattern and otherwise falling back to using the original
entry.title unchanged, ensuring any later code that prefixes with "v" (the usage
of variable version) gets a sensible value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/Homepage/RecentChangelog.jsx`:
- Around line 28-30: The code in ChangelogEntry currently strips only English
"Version" via version = entry.title.replace(/^Version\s*/i, which can produce
odd results for titles like "Versión" or non-prefixed titles; update the logic
in function ChangelogEntry to robustly extract a version token by matching both
English and Spanish prefixes (e.g., /^Versi(ón|on)\b[:\s-]*/i) or by validating
a semantic version/number pattern and otherwise falling back to using the
original entry.title unchanged, ensuring any later code that prefixes with "v"
(the usage of variable version) gets a sensible value.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 47d4e3d4-7443-40de-b8a5-777a635b194e

📥 Commits

Reviewing files that changed from the base of the PR and between 9877f5d and fe32c01.

📒 Files selected for processing (1)
  • src/components/Homepage/RecentChangelog.jsx

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (4)
plugins/changelog-recent.js (3)

22-28: Uso de operaciones síncronas de FS dentro de función async.

readdirSync y readFileSync son síncronos y bloquean el event loop. Para un plugin de build no es crítico, pero si el directorio de changelogs crece o hay muchos archivos, podría ralentizar el build. No hace falta arreglarlo a las piñas ahora, pero considerar fs.promises en el futuro.

♻️ Refactor opcional con fs.promises
-const fs = require("fs");
+const fs = require("fs").promises;
+const fsSync = require("fs");
 const path = require("path");
 const matter = require("gray-matter");

 // ...

 async loadContent() {
   const changelogDir = path.join(context.siteDir, "changelog");

-  if (!fs.existsSync(changelogDir)) {
+  try {
+    await fs.access(changelogDir);
+  } catch {
     return [];
   }

-  const files = fs
-    .readdirSync(changelogDir)
-    .filter((f) => f.endsWith(".md") || f.endsWith(".mdx"));
+  const allFiles = await fs.readdir(changelogDir);
+  const files = allFiles.filter((f) => f.endsWith(".md") || f.endsWith(".mdx"));

-  const entries = files.map((file) => {
-    const raw = fs.readFileSync(path.join(changelogDir, file), "utf-8");
+  const entries = await Promise.all(files.map(async (file) => {
+    const raw = await fs.readFile(path.join(changelogDir, file), "utf-8");
     // ...
-  });
+  }));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/changelog-recent.js` around lines 22 - 28, Replace blocking
fs.readdirSync and fs.readFileSync with the async fs.promises API: use await
fs.promises.readdir(changelogDir) instead of readdirSync and await
fs.promises.readFile(path.join(changelogDir, file), "utf-8") instead of
readFileSync; update the surrounding async function so the files mapping that
builds entries uses Promise.all to await parsing each file (where you call
matter(raw)) and preserve the same frontmatter/content extraction, referencing
the existing variables files, changelogDir, entries, and the matter(...) call.

108-116: Regex de heading puede fallar con headings más complejos.

El regex ^#{2,3}\s+\**(.+?)\**[:]*\s*$ captura headings con asteriscos opcionales, pero si alguien escribe ## **New Features** - v1.0 o similar, el match va a incluir - v1.0 en el heading. No es grave, pero el *? (non-greedy) podría causar comportamientos inesperados.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/changelog-recent.js` around lines 108 - 116, The heading regex can
capture trailing text like " - v1.0" causing unexpected headings; update the
match logic used where headingMatch is created so the captured group (used by
cleanHeading and categorizeSection) stops before common separators/version
suffixes (e.g., "-", "—", ":" or "vX.Y") — either by narrowing the capture to
exclude those chars (use a character class like [^:\-—]+) or by post-processing
the raw capture to strip trailing separators/version tokens before passing to
cleanHeading and categorizeSection; keep references to headingMatch,
cleanHeading, and categorizeSection when applying the change.

163-174: El umbral de 60 caracteres para detectar títulos con ":" es arbitrario.

colonIdx < 60 funciona, pero si alguien escribe un título largo (que pase de 60 chars antes del :) se va a tratar todo como título sin descripción. Podría ser confuso en casos edge.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/changelog-recent.js` around lines 163 - 174, The 60-character cap on
colon detection is arbitrary and can misclassify long titles; update the logic
around plainItemMatch/colonIdx so it doesn't rely on colonIdx < 60: either
remove the length check and treat any colon (colonIdx > 0) as title/description,
or replace the magic number with a named constant (e.g., MAX_TITLE_LEN) and
document/centralize it so it's configurable; ensure you still use
plainItemMatch[1].trim(), currentSection.items.push with title =
text.substring(0, colonIdx).trim() and description = text.substring(colonIdx +
1).trim() when a colon is present, otherwise push title = text and description =
"".
src/components/Homepage/RecentChangelog.jsx (1)

13-14: Todos los títulos de changelog tienen el prefijo "Version" — la assumption es segura.

Se verificó que los 10 changelogs existentes (2025-12-01-V2.3.1, 2025-10-15-V2.0.1, etc.) siguen consistentemente el patrón "Version X.X.X". El replace en línea 13-14 funciona correctamente con el formato actual.

Si en el futuro llegan títulos sin "Version", la salida sería vMi Título Custom en línea 33. Considerar agregar validación si se espera que otros formatos de titulo lleguen al componente, aunque actualmente no es necesario.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Homepage/RecentChangelog.jsx` around lines 13 - 14, La función
ChangelogEntry asume que entry.title siempre empieza con el prefijo "Version" al
calcular la variable version; agrega una validación para solo quitar el prefijo
cuando exista (por ejemplo usando un test regex o startsWith con toLowerCase) y
en caso contrario dejar entry.title tal cual; actualiza la asignación de version
(la variable usada más abajo) para usar ese valor seguro y evita producir
salidas con un prefijo inesperado si llegan títulos en otros formatos.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/changelog-recent.js`:
- Around line 35-42: El bloque que convierte frontmatter.date a ISO puede lanzar
si el valor es inválido; en la rama donde usas frontmatter.date crea un Date
object (e.g., const parsed = new Date(frontmatter.date)), verifica su validez
con isNaN(parsed.getTime()) (o Date.parse) antes de llamar a
parsed.toISOString(), y si es inválido o lanza, cae al fallback existente que
usa file.match(/^(\d{4}-\d{2}-\d{2})/) o deja date undefined; envuelve la
conversión en un try/catch para evitar excepciones y actualiza la asignación de
date solo cuando la fecha es válida (referencias: frontmatter.date, new
Date(...).toISOString(), parsed.getTime(), file.match).

In `@src/components/Homepage/RecentChangelog.jsx`:
- Around line 86-92: RecentChangelog currently destructures directly from
usePluginData("changelog-recent") (and from useDocusaurusContext().i18n) which
will throw if those return undefined; fix by first assigning pluginData =
usePluginData("changelog-recent") || {} and context = useDocusaurusContext() ||
{} then safely extract recentChangelogs and i18n.currentLocale (e.g., const {
recentChangelogs } = pluginData; const { i18n = {} } = context; const {
currentLocale } = i18n) so the component returns null safely when data is
missing without runtime errors.

---

Nitpick comments:
In `@plugins/changelog-recent.js`:
- Around line 22-28: Replace blocking fs.readdirSync and fs.readFileSync with
the async fs.promises API: use await fs.promises.readdir(changelogDir) instead
of readdirSync and await fs.promises.readFile(path.join(changelogDir, file),
"utf-8") instead of readFileSync; update the surrounding async function so the
files mapping that builds entries uses Promise.all to await parsing each file
(where you call matter(raw)) and preserve the same frontmatter/content
extraction, referencing the existing variables files, changelogDir, entries, and
the matter(...) call.
- Around line 108-116: The heading regex can capture trailing text like " -
v1.0" causing unexpected headings; update the match logic used where
headingMatch is created so the captured group (used by cleanHeading and
categorizeSection) stops before common separators/version suffixes (e.g., "-",
"—", ":" or "vX.Y") — either by narrowing the capture to exclude those chars
(use a character class like [^:\-—]+) or by post-processing the raw capture to
strip trailing separators/version tokens before passing to cleanHeading and
categorizeSection; keep references to headingMatch, cleanHeading, and
categorizeSection when applying the change.
- Around line 163-174: The 60-character cap on colon detection is arbitrary and
can misclassify long titles; update the logic around plainItemMatch/colonIdx so
it doesn't rely on colonIdx < 60: either remove the length check and treat any
colon (colonIdx > 0) as title/description, or replace the magic number with a
named constant (e.g., MAX_TITLE_LEN) and document/centralize it so it's
configurable; ensure you still use plainItemMatch[1].trim(),
currentSection.items.push with title = text.substring(0, colonIdx).trim() and
description = text.substring(colonIdx + 1).trim() when a colon is present,
otherwise push title = text and description = "".

In `@src/components/Homepage/RecentChangelog.jsx`:
- Around line 13-14: La función ChangelogEntry asume que entry.title siempre
empieza con el prefijo "Version" al calcular la variable version; agrega una
validación para solo quitar el prefijo cuando exista (por ejemplo usando un test
regex o startsWith con toLowerCase) y en caso contrario dejar entry.title tal
cual; actualiza la asignación de version (la variable usada más abajo) para usar
ese valor seguro y evita producir salidas con un prefijo inesperado si llegan
títulos en otros formatos.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8cf12cd6-66ca-43b8-a087-1568ede1ab35

📥 Commits

Reviewing files that changed from the base of the PR and between fe32c01 and a07e6e3.

📒 Files selected for processing (3)
  • plugins/changelog-recent.js
  • src/components/Homepage/RecentChangelog.jsx
  • src/components/Homepage/RecentChangelog.module.css
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/Homepage/RecentChangelog.module.css

Comment on lines +35 to +42
if (frontmatter.date) {
date = new Date(frontmatter.date).toISOString().split("T")[0];
} else {
const dateMatch = file.match(/^(\d{4}-\d{2}-\d{2})/);
if (dateMatch) {
date = dateMatch[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.

⚠️ Potential issue | 🟡 Minor

El parseo de fecha puede lanzar una excepción si frontmatter.date es inválido.

Si frontmatter.date contiene un valor que new Date() no puede parsear correctamente (por ejemplo, un string corrupto o formato inesperado), toISOString() va a explotar como una piña contra la pared. Mejor blindar esto:

🛡️ Propuesta para manejar fechas inválidas
       let date = "";
       if (frontmatter.date) {
-        date = new Date(frontmatter.date).toISOString().split("T")[0];
+        const parsed = new Date(frontmatter.date);
+        if (!isNaN(parsed.getTime())) {
+          date = parsed.toISOString().split("T")[0];
+        }
+      }
+      // Fallback to filename if frontmatter date is missing or invalid
+      if (!date) {
         const dateMatch = file.match(/^(\d{4}-\d{2}-\d{2})/);
         if (dateMatch) {
           date = dateMatch[1];
         }
       }
-      } else {
-        const dateMatch = file.match(/^(\d{4}-\d{2}-\d{2})/);
-        if (dateMatch) {
-          date = dateMatch[1];
-        }
-      }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (frontmatter.date) {
date = new Date(frontmatter.date).toISOString().split("T")[0];
} else {
const dateMatch = file.match(/^(\d{4}-\d{2}-\d{2})/);
if (dateMatch) {
date = dateMatch[1];
}
}
if (frontmatter.date) {
const parsed = new Date(frontmatter.date);
if (!isNaN(parsed.getTime())) {
date = parsed.toISOString().split("T")[0];
}
}
// Fallback to filename if frontmatter date is missing or invalid
if (!date) {
const dateMatch = file.match(/^(\d{4}-\d{2}-\d{2})/);
if (dateMatch) {
date = dateMatch[1];
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/changelog-recent.js` around lines 35 - 42, El bloque que convierte
frontmatter.date a ISO puede lanzar si el valor es inválido; en la rama donde
usas frontmatter.date crea un Date object (e.g., const parsed = new
Date(frontmatter.date)), verifica su validez con isNaN(parsed.getTime()) (o
Date.parse) antes de llamar a parsed.toISOString(), y si es inválido o lanza,
cae al fallback existente que usa file.match(/^(\d{4}-\d{2}-\d{2})/) o deja date
undefined; envuelve la conversión en un try/catch para evitar excepciones y
actualiza la asignación de date solo cuando la fecha es válida (referencias:
frontmatter.date, new Date(...).toISOString(), parsed.getTime(), file.match).

Comment on lines 86 to +92
export default function RecentChangelog() {
const { recentChangelogs } = usePluginData("changelog-recent");
const { i18n: { currentLocale } } = useDocusaurusContext();

if (!recentChangelogs || recentChangelogs.length === 0) {
return null;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Potencial error de destructuring si el plugin no devuelve datos.

Si usePluginData("changelog-recent") devuelve undefined (por ejemplo, si el plugin falla o no está registrado), la destructuración const { recentChangelogs } = ... va a explotar. Mejor darle una piña defensiva:

🛡️ Propuesta de manejo defensivo
 export default function RecentChangelog() {
-  const { recentChangelogs } = usePluginData("changelog-recent");
+  const pluginData = usePluginData("changelog-recent") || {};
+  const { recentChangelogs } = pluginData;
   const { i18n: { currentLocale } } = useDocusaurusContext();

   if (!recentChangelogs || recentChangelogs.length === 0) {
     return null;
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export default function RecentChangelog() {
const { recentChangelogs } = usePluginData("changelog-recent");
const { i18n: { currentLocale } } = useDocusaurusContext();
if (!recentChangelogs || recentChangelogs.length === 0) {
return null;
}
export default function RecentChangelog() {
const pluginData = usePluginData("changelog-recent") || {};
const { recentChangelogs } = pluginData;
const { i18n: { currentLocale } } = useDocusaurusContext();
if (!recentChangelogs || recentChangelogs.length === 0) {
return null;
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Homepage/RecentChangelog.jsx` around lines 86 - 92,
RecentChangelog currently destructures directly from
usePluginData("changelog-recent") (and from useDocusaurusContext().i18n) which
will throw if those return undefined; fix by first assigning pluginData =
usePluginData("changelog-recent") || {} and context = useDocusaurusContext() ||
{} then safely extract recentChangelogs and i18n.currentLocale (e.g., const {
recentChangelogs } = pluginData; const { i18n = {} } = context; const {
currentLocale } = i18n) so the component returns null safely when data is
missing without runtime errors.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
i18n/es/docusaurus-plugin-content-docs/current/cli.mdx (1)

201-203: ⚠️ Potential issue | 🟡 Minor

Corrige el placeholder del comando para evitar copia/pega erróneo.

En Line 201, sleakops sub-command --help parece un comando real y puede confundir. Mejor dejar un placeholder explícito (<sub-command>) o comandos concretos.

💥 Cambio propuesto
-Este mensaje aparece cuando tenés varios proyectos con el mismo nombre en distintos entornos. Para resolverlo, especificá el entorno usando el parámetro `-e` o `--environment` en tus comandos de build o deploy. Si necesitás más información sobre las opciones de este comando, ejecutá `sleakops sub-command --help`.
+Este mensaje aparece cuando tenés varios proyectos con el mismo nombre en distintos entornos. Para resolverlo, especificá el entorno usando el parámetro `-e` o `--environment` en tus comandos de build o deploy. Si necesitás más información sobre las opciones de este comando, ejecutá `sleakops <sub-command> --help`.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@i18n/es/docusaurus-plugin-content-docs/current/cli.mdx` around lines 201 -
203, Replace the ambiguous literal "sleakops sub-command --help" with an
explicit placeholder or concrete examples to avoid copy/paste mistakes; update
the text in the CLI docs (the paragraph referencing the help command) to use
either "sleakops <sub-command> --help" or show real commands like "sleakops
build --help" and "sleakops deploy --help" so readers clearly know how to obtain
help for specific subcommands.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@i18n/es/docusaurus-plugin-content-docs/current/cli.mdx`:
- Around line 201-203: Replace the ambiguous literal "sleakops sub-command
--help" with an explicit placeholder or concrete examples to avoid copy/paste
mistakes; update the text in the CLI docs (the paragraph referencing the help
command) to use either "sleakops <sub-command> --help" or show real commands
like "sleakops build --help" and "sleakops deploy --help" so readers clearly
know how to obtain help for specific subcommands.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2355e9e7-d48c-4119-8320-9b5eea8843ab

📥 Commits

Reviewing files that changed from the base of the PR and between a07e6e3 and 41f8797.

📒 Files selected for processing (43)
  • content/docs/en/changelog.mdx
  • content/docs/en/cli.mdx
  • content/docs/en/cluster/index.mdx
  • content/docs/en/connect_to_git.mdx
  • content/docs/en/domain/index.mdx
  • content/docs/en/environment/index.mdx
  • content/docs/en/network/index.mdx
  • content/docs/en/project/index.mdx
  • content/docs/en/provider/index.mdx
  • content/docs/en/responsability-model.mdx
  • content/docs/en/user/index.mdx
  • content/docs/es/changelog.mdx
  • content/docs/es/cli.mdx
  • content/docs/es/cluster/index.mdx
  • content/docs/es/connect_to_git.mdx
  • content/docs/es/domain/index.mdx
  • content/docs/es/environment/index.mdx
  • content/docs/es/network/index.mdx
  • content/docs/es/project/index.mdx
  • content/docs/es/provider/index.mdx
  • content/docs/es/responsability-model.mdx
  • content/docs/es/user/index.mdx
  • docs/cluster/index.mdx
  • docs/connect_to_git.mdx
  • docs/domain/index.mdx
  • docs/environment/index.mdx
  • docs/network/index.mdx
  • docs/project/index.mdx
  • docs/provider/index.mdx
  • docs/responsability-model.mdx
  • docs/user/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/changelog.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/cli.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/cluster/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/connect_to_git.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/domain/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/environment/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/network/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/project/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/provider/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/responsability-model.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/user/index.mdx
  • sidebars.js
✅ Files skipped from review due to trivial changes (40)
  • content/docs/es/cli.mdx
  • content/docs/es/environment/index.mdx
  • content/docs/es/user/index.mdx
  • content/docs/en/provider/index.mdx
  • content/docs/en/project/index.mdx
  • content/docs/en/environment/index.mdx
  • content/docs/en/cluster/index.mdx
  • content/docs/en/network/index.mdx
  • content/docs/en/changelog.mdx
  • content/docs/en/domain/index.mdx
  • content/docs/es/project/index.mdx
  • content/docs/en/responsability-model.mdx
  • content/docs/en/user/index.mdx
  • content/docs/es/changelog.mdx
  • docs/provider/index.mdx
  • docs/domain/index.mdx
  • content/docs/es/responsability-model.mdx
  • docs/responsability-model.mdx
  • docs/user/index.mdx
  • content/docs/en/cli.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/environment/index.mdx
  • docs/connect_to_git.mdx
  • content/docs/es/provider/index.mdx
  • docs/environment/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/connect_to_git.mdx
  • content/docs/es/connect_to_git.mdx
  • docs/network/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/cluster/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/domain/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/changelog.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/project/index.mdx
  • content/docs/en/connect_to_git.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/responsability-model.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/network/index.mdx
  • docs/cluster/index.mdx
  • docs/project/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/provider/index.mdx
  • content/docs/es/network/index.mdx
  • content/docs/es/domain/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/current/user/index.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • content/docs/es/cluster/index.mdx

@fuzilogik2019 fuzilogik2019 merged commit 941ba3c into develop Mar 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant