From 3c53dd9e01716162c549dd82d56fbd5fce1692c3 Mon Sep 17 00:00:00 2001 From: metaphorics <152830360+metaphorics@users.noreply.github.com> Date: Fri, 12 Jun 2026 02:10:32 +0900 Subject: [PATCH] test(pi-shell): add glab fixtures, tighten release view filter Port rtk glab fixtures (ci-trace, release-list, release-view) to the minimizer fixture harness with savings gate. Tighten release-view filter: also strip ASSETS section (no-assets noise), View-on-GitLab footer link. Update test assertions. Op: extend --- crates/pi-shell/src/minimizer/filters/glab.rs | 27 ++++++++-- .../fixtures/minimizer/glab/ci-trace.cmd | 1 + .../fixtures/minimizer/glab/ci-trace.raw | 54 +++++++++++++++++++ .../fixtures/minimizer/glab/release-list.cmd | 1 + .../fixtures/minimizer/glab/release-list.min | 11 ++++ .../fixtures/minimizer/glab/release-list.raw | 13 +++++ .../fixtures/minimizer/glab/release-view.cmd | 1 + .../fixtures/minimizer/glab/release-view.raw | 30 +++++++++++ 8 files changed, 135 insertions(+), 3 deletions(-) create mode 100644 crates/pi-shell/tests/fixtures/minimizer/glab/ci-trace.cmd create mode 100644 crates/pi-shell/tests/fixtures/minimizer/glab/ci-trace.raw create mode 100644 crates/pi-shell/tests/fixtures/minimizer/glab/release-list.cmd create mode 100644 crates/pi-shell/tests/fixtures/minimizer/glab/release-list.min create mode 100644 crates/pi-shell/tests/fixtures/minimizer/glab/release-list.raw create mode 100644 crates/pi-shell/tests/fixtures/minimizer/glab/release-view.cmd create mode 100644 crates/pi-shell/tests/fixtures/minimizer/glab/release-view.raw diff --git a/crates/pi-shell/src/minimizer/filters/glab.rs b/crates/pi-shell/src/minimizer/filters/glab.rs index 641694cf5..4b6b05015 100644 --- a/crates/pi-shell/src/minimizer/filters/glab.rs +++ b/crates/pi-shell/src/minimizer/filters/glab.rs @@ -231,7 +231,18 @@ fn filter_release_view(input: &str) -> String { for line in input.lines() { let trimmed = line.trim(); - // Skip SOURCES section (archive download URLs) + // Strip trailing "View this release on GitLab" link + if trimmed.starts_with("View this release on GitLab") { + continue; + } + + // Strip "ASSETS" / "There are no assets..." section + if trimmed == "ASSETS" { + in_sources = true; // reuse state machine; next non-empty line is "There are no assets..." + continue; + } + + // Strip SOURCES section (archive download URLs) if trimmed == "SOURCES" { in_sources = true; continue; @@ -478,6 +489,12 @@ section_end:1711234600:build_script[0K assert!(!out.text.contains("Image:")); // HTML comments stripped assert!(!out.text.contains(" + + +ASSETS +There are no assets for this release +SOURCES +https://gitlab.example.com/acme/toolkit/-/archive/v2.0.0/toolkit-v2.0.0.zip +https://gitlab.example.com/acme/toolkit/-/archive/v2.0.0/toolkit-v2.0.0.tar.gz +https://gitlab.example.com/acme/toolkit/-/archive/v2.0.0/toolkit-v2.0.0.tar.bz2 +https://gitlab.example.com/acme/toolkit/-/archive/v2.0.0/toolkit-v2.0.0.tar + + +View this release on GitLab at https://gitlab.example.com/acme/toolkit/-/releases/v2.0.0