Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
47 changes: 46 additions & 1 deletion .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ jobs:
java-version: '25'
distribution: 'temurin'
cache: maven
# La clave incluye este workflow: si cambia lo que descarga warm-cache,
# hace falta una cache nueva, porque setup-java no sobrescribe una existente.
cache-dependency-path: |
**/pom.xml
.github/workflows/maven-build.yml

- name: Resolve the dependencies of every project
env:
Expand All @@ -99,6 +104,41 @@ jobs:
# veredicto lo da la matriz. Un fallo aqui no corta el flujo.
echo "Proyectos sin resolver: $fallos" >> "$GITHUB_STEP_SUMMARY"

# go-offline no descarga lo que surefire resuelve al lanzar los tests: su
# provider (surefire-junit-platform) y junit-platform-launcher. Sin esto,
# los 86 jobs de build lo piden a Maven Central a la vez y alguno recibe
# HTTP 429. Las versiones salen de un proyecto por cada version de Spring
# Boot que haya en el repositorio, para no tener que actualizarlas a mano.
- name: Resolve the surefire test provider
env:
PROJECTS: ${{ needs.discover.outputs.projects }}
run: |
set -uo pipefail
declare -A visto

evaluar() {
mvn -B -ntp -q -f "$1/pom.xml" help:evaluate -Dexpression="$2" -DforceStdout 2>/dev/null
}

while read -r p; do
boot=$(sed -n '/<artifactId>spring-boot-starter-parent<\/artifactId>/{n;s/.*<version>\(.*\)<\/version>.*/\1/p;q}' "$p/pom.xml")
[ -z "$boot" ] && continue
[ -n "${visto[$boot]:-}" ] && continue
visto[$boot]=1

surefire=$(evaluar "$p" maven-surefire-plugin.version)
junit=$(evaluar "$p" junit-jupiter.version)
echo "Spring Boot $boot ($p): surefire $surefire, JUnit $junit"

# Con JUnit 6 el launcher lleva la misma version que Jupiter.
for a in "org.apache.maven.surefire:surefire-junit-platform:$surefire" \
"org.junit.platform:junit-platform-launcher:$junit"; do
mvn -B -ntp -Dmaven.wagon.http.retryHandler.count=5 \
dependency:get -Dartifact="$a" \
|| echo "::warning title=Cache warming::No se pudo resolver $a"
done
done < <(printf '%s' "$PROJECTS" | jq -r '.[]')

build:
name: Build - ${{ matrix.project }}
needs: [discover, warm-cache]
Expand All @@ -114,7 +154,7 @@ jobs:
uses: actions/checkout@v7

# Restaura la cache que dejo warm-cache: la clave que usa setup-java
# sale del hash de los ficheros de build (pom.xml y .mvn/extensions.xml),
# sale del hash de los pom.xml y de este workflow,
# identico en los 86 jobs de la misma ejecucion, asi que aciertan y no
# vuelven a guardarla.
- name: Set up JDK 25
Expand All @@ -123,6 +163,11 @@ jobs:
java-version: '25'
distribution: 'temurin'
cache: maven
# La clave incluye este workflow: si cambia lo que descarga warm-cache,
# hace falta una cache nueva, porque setup-java no sobrescribe una existente.
cache-dependency-path: |
**/pom.xml
.github/workflows/maven-build.yml

- name: Build with Maven
run: mvn -B -ntp -Dmaven.wagon.http.retryHandler.count=3 clean verify
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@ parte_5/ejem4-haproxy/mydomain.key
.gitignore
parte_5/ejem4-haproxy/mydomain.crt
parte_5/ejem4-haproxy/mydomain.csr

# Quarto: transparencias generadas
**/slides/*.html
**/slides/*_files/
**/.quarto/

/.quarto/
**/*.quarto_ipynb
1,364 changes: 1,363 additions & 1 deletion README.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions _extensions/gortazar/title-slides/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: Title Slides
author: Patxi Gortázar
version: 0.2.0
quarto-required: ">=1.4.0"
contributes:
filters:
- title-slides.lua
81 changes: 81 additions & 0 deletions _extensions/gortazar/title-slides/setext.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
-- Finding the trap: `blabla` followed immediately by `---`.
--
-- Markdown reads that as a *setext heading* titled "blabla", not as a paragraph and a
-- horizontal rule. The rule the filter would key on never exists, so the slide comes out
-- titled "blabla" and the author is left wondering why the extension did nothing. It
-- cannot be spotted in the AST — by then it is an ordinary `Header` — so it has to be
-- found in the source text.

local M = {}

local function is_blank(line)
return line:match("^%s*$") ~= nil
end

-- A setext underline is a run of dashes on its own line, indented no more than three
-- spaces. Two dashes are enough: only *thematic breaks* need three.
local function is_dash_underline(line)
return line:match("^ ? ? ?%-+%s*$") ~= nil
end

-- Lines that start a block of their own, so a following run of dashes is not underlining
-- a paragraph: headings, block quotes, list items, tables.
local function starts_other_block(line)
return line:match("^ ? ? ?#")
or line:match("^ ? ? ?>")
or line:match("^ ? ? ?[%-%*%+]%s")
or line:match("^ ? ? ?%d+[%.%)]%s")
or line:match("^ ? ? ?|")
end

local function fence_of(line)
return line:match("^ ? ? ?(```+)") or line:match("^ ? ? ?(~~~+)")
end

--- Every setext heading in `text` that was probably meant as a slide break.
-- Returns a list of `{ line = <1-based line number>, title = <the heading text> }`.
function M.find(text)
local lines = {}
for line in (text .. "\n"):gmatch("([^\n]*)\n") do
lines[#lines + 1] = line
end

local found = {}
local fence = nil
local in_frontmatter = #lines > 0 and lines[1]:match("^%-%-%-%s*$") ~= nil

for i, line in ipairs(lines) do
if in_frontmatter then
-- The closing delimiter is itself a run of dashes, so skip the whole block.
if i > 1 and (line:match("^%-%-%-%s*$") or line:match("^%.%.%.%s*$")) then
in_frontmatter = false
end
elseif fence then
if line:match("^ ? ? ?" .. fence) then fence = nil end
else
local opening = fence_of(line)
if opening then
fence = opening
elseif is_dash_underline(line) and i > 1 then
local previous = lines[i - 1]
if not is_blank(previous) and not starts_other_block(previous)
and not is_dash_underline(previous) then
found[#found + 1] = { line = i, title = previous:match("^%s*(.-)%s*$") }
end
end
end
end

return found
end

--- The warning shown for one such heading.
function M.message(where, finding)
return string.format(
"%s:%d: \"%s\" followed immediately by a line of dashes is a setext heading, "
.. "not a slide break — this slide will be titled \"%s\". "
.. "Leave a blank line before the dashes to start an untitled slide.",
where, finding.line, finding.title, finding.title)
end

return M
Loading