tests/e2e: the report publishes checked recordings and never cuts them
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 8/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, shell
Direzione di ricerca
Start with build-report.sh (FILE_RE, is_file, JQ_NORM, add_result) and report.js (FILE_RE, normScen, logLink), then scripts/e2e-pages.sh fetch_results. Run bash tests/e2e-report.sh to see the current want-tree and file-state checks. This depends on #169 and #172 for the recording shape and cast writing, so most of it cannot be finished from this issue alone. Done means the listed fixtures and checks pass and the cast states match the acceptance criteria.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Epic #164 · Milestone Phase 1: Community & CI · Priority high · Size M · Depends on #169
Why
build-report.sh publishes only names that pass FILE_RE, and it copies a log over 5 MiB as its last 5 MiB. A .cast cut that way loses its header line and no longer plays.
Casts come from VMs that ran pull request code. pages.yml runs scripts/e2e-pages.sh from main. That script builds the reports of main and of open pull requests from this repository or a trusted author, and hosts their files on the project site.
So jq checks and rewrites each cast before it is published: a clean header, then "o" events only. A cast is published whole or not at all.
What to do
The recording field
- Use the
recordingshape #169 sets. In a scenario ofresults.json, it is"recording": {"cast": "<id>.cast", "mp4": "<id>.mp4"}, and both keys are optional. #172 writescastand #175 writesmp4. Any other shape is ignored. -
scenario()inJQ_NORMoutputsrecording: "<id>.cast"only when.recording.castis exactly that name for the scenario's own valid id, never for thescenario-<n>fallback. Otherwise it outputs"". It never reads.recording.mp4. -
JQ_NORMlists the accepted cast names in a newcastsarray, capped at$max_names. Todaynamesis cut to$max_namesafter the logs and files, so a cast added at the end could be cut, get noattachmentsentry and never reach the copy loop. Sonamesbecomescastsfirst, then the logs and files cut to$max_namesas today, thenuniq_by_key(.). A long list of logs can no longer push a recording out. A recording past the cast cap shows as "not published".castsis deleted along withnames.
The file rule
- Add
casttoFILE_REandis_file(inJQ_DEFS) inbuild-report.sh, and toFILE_REinreport.js.mp4and every other binary type stay out. - A
.castis accepted only as a scenario'srecording. A.castname inlogsorfilesthat is not incastsstill reaches the copy loop, which marks itrefusedand never copies it as a log.
The copy loop and the cast check
- In
add_result, the loop runsrm -f -- "$OUT/$os/$name"for every.castname before the symlink and missing checks, accepted or refused. Todayrm -f -- "$dst"runs only in the regular-file branch, andbuild_reportnever clears<os>/. So without this, a symlinked, missing or refused cast keeps a file left by an earlier build into the same--out. - Then a name in
castsgoes through the cast check below instead ofcatortail -c. Logs keep their rule: a log over 5 MiB keeps its last 5 MiB. - The cast check is one jq program (
JQ_CAST). It reads the file line by line withjq -Randfromjson?:- Line 1 must be an object with
version2 and numericwidthandheight. If not, the cast isrefused. The header is rebuilt from these keys only:widthclamped to 1 to 500,heightto 1 to 200,idle_time_limitto 0.1 to 5 s (2 when absent).env,titleand every other key are dropped. - Each event that is
[time, "o", text], with a numbertimeof 0 or more and a stringtext, is kept. A time that goes down is raised to the previous one."i","r","m"and every other line shape are dropped. - Reading stops at the first line that is not JSON, which happens to a cast cut when its run was killed. The cast is then
partial, and it keeps the events before that line. - A source over
MAX_FILE(5 MiB), more than 100000 events or an output over 5 MiB makes the casttoo-big. Nothing is published. It is never cut. - A symlink is
refusedand an absent file ismissing, as for logs.
- Line 1 must be an object with
- The check keeps escape sequences in the text as they are (colours, OSC 8, OSC 52): it checks the JSON shape. What the page draws is up to #174.
- The checked output is written with
jq -c(one JSON value per line, still asciicast v2) to a temporary file, then moved to<os>/<id>.castonly when the cast isokorpartial. Any other state leaves no file, thanks to therm -fabove. Instates.tsv, the size is the published file's size, or the source size fortoo-big. - Add a budget,
MAX_CASTS= 40 MiB, for all the casts published in one report, counted in the order the results are read. A cast that does not fit isover-budget. Without the budget, recordings alone could push a report pastMAX_REPORT(100 MiB) inscripts/e2e-pages.sh, which then skips the whole report. - If #169 picks jq-built data files over
connect-src 'self', also write each published cast as a data file in<os>/, in the format the ADR sets. It needs its own writer, which builds the whole line in jq:jq -a,</turned into<\/, and a key built from the checked OS and scenario ids.write_jscannot do it: it writes one plainwindow.NAME = ...;throughsed, so it cannot set one key of a shared object.FILE_REnever allows.js, so no result file can take that name. The data files count towardMAX_CASTS, and the samerm -frule removes a stale one.
The page (report.js)
-
normScenkeepsrecordingwhen it passesFILE_REand is<id>.cast. The scenario card draws its Logs block when the scenario has logs or a recording, and lists the recording withlogLink(o, name, "Terminal recording"). Until #174 lands, that link is all the page shows, and the page never reads the cast. -
logLink:- also links
partial, with an "ends early" tag; - gets a
too-bigbranch, "not published: too big", whose title says that a recording over 5 MiB or 100000 events is dropped whole, never cut; - gets an
over-budgetbranch, "not published: report full"; - adds
.castto the list of types in therefusedtitle.
- also links
Pages (scripts/e2e-pages.sh)
-
fetch_resultsunpacks only the names that pass the report's file rule (results.jsonpasses it). An.mp4or another binary in an artifact can then no longer use upMAX_OS_BYTESorMAX_FILESbefore the logs. This adds a copy ofFILE_REto the script. -
fetch_resultsnever cuts a.cast. A cast bigger than what is left of the budget, or thanMAX_FILE(32 MiB), is not kept, and a warning says why. A 6 MiB cast still arrives whole, and the report marks ittoo-big. Fix theMAX_FILEcomment ("the report keeps its last 5 MiB"): it now applies to logs only.
Drift test, fixtures and tests
- A test in
tests/e2e-report.shfails when the type lists differ between the copies of the rule:FILE_REandis_fileinbuild-report.sh,FILE_REand therefusedtitle inreport.js, and the new copy inscripts/e2e-pages.sh. -
tests/e2e/fixtures/failed/(ubuntu-24.04): add a short validprep-rerun.castwith SGR colours, a\rprogress line and a pause longer than itsidle_time_limit, and list it as"recording": {"cast": "prep-rerun.cast"}inresults.json. Update the two checks intests/e2e-report.shthat list this fixture's files:want-treegets./ubuntu-24.04/prep-rerun.cast;- the "file states"
expect_jqgets"prep-rerun.cast"=okfirst among theubuntu-24.04entries, since casts now come first innames.
-
tests/e2e/fixtures/hostile/: add new scenarios, each with its own cast. Update the existing checks for them.- a cast with no header line;
"i"and"r"events among"o"events, plus a time that goes down;- a cast cut in the middle of its last line;
- text holding
</script>, U+2028 and<img src=x onerror=alert(1)>; - an OSC 8 link and an OSC 52 clipboard write;
- a header with
width99999,height0,idle_time_limit3600,envandtitle; recording.castvalues of../x.cast, of another scenario's cast and ofx.mp4, arecordingthat is a string, and a.castlisted inlogs.
- ESC is written
\u001bin the fixture casts, so the files stay ASCII. These are the fixtures #174 runs its parser and page checks on. - Made in
tests/e2e-report.sh, like the 6 MiB log:- a symlinked cast, a 6 MiB cast and a cast with 100001 events;
- an
.mp4listed asrecording.mp4and inlogs; - a results folder with nine scenarios whose casts are just under 5 MiB each, to test the budget;
- a results folder whose logs and files list more than 100 names, plus one valid cast;
- a second build into the same
--outafter a valid cast has become a symlink, has been removed, or has moved fromrecordingtologs.
-
tests/e2e-pages.shneeds three new artifacts: one with 61 small.mp4entries whose names sort before the logs, one with a 6 MiB.cast, and one whose.castsorts after entries that use up most ofMAX_OS_BYTES. -
docs/e2e-tests.md, "Where to see the results": which recordings the report publishes, what the check removes, the states and the size rules. - No
CHANGELOG.mdline: nothing writes a.castbefore #172, which adds the line.
Acceptance criteria
-
One
expect_jqcheck lists the state of every cast:ok: the valid one, the"i"one, the</script>one, the OSC one and the out-of-range header;partial: the cut one;refused: no header, the symlink, and the.castinlogs;too-big: 6 MiB, and 100001 events.
The
../x.cast, other-scenario,x.mp4and stringrecordingscenarios have no recording. -
The existing "file states" check passes with
"prep-rerun.cast"=okfirst forubuntu-24.04, andwant-treeholds./ubuntu-24.04/prep-rerun.cast. -
Every published
.castis asciicast v2. Its header has onlyversion,width,heightandidle_time_limit(the out-of-range one comes out as 500, 1 and 5). Then come[time, "o", text]lines whose times never go down. No"i"or"r"event is left. -
The cut cast keeps the events before its broken line. The OSC cast's text is published byte for byte.
-
In the folder with more than 100 log and file names, the cast is
okand published. -
After the second build into the same
--out, the symlinked, removed and moved casts leave no file in<os>/. -
No
.mp4is copied, whether listed inlogsor asrecording.mp4, andfetch_resultsunpacks none. With 61.mp4entries ahead of them, every log of the artifact is still published. -
A 6 MiB cast fetched by
scripts/e2e-pages.shreaches the report whole and istoo-big. A cast that does not fit whole in the rest of the budget is not kept, and the log says why. A 6 MiB log is still cut to its last 5 MiB. -
In the nine-cast build, the casts past 40 MiB are
over-budgetand leave no file. -
If data files are written, each one runs alone under node with
{window: w}and sets only its own key. None holds</, a raw U+2028 or U+2029, an"i"event, or a key outside the checked ids. -
The
want-treecheck lists every new file, and nothing else is copied. "The same input gives the same data.js" also compares the published casts. -
Changing one copy of the file rule makes the drift test fail.
-
tests/e2e/preview.sh tests/e2e/fixtures/passed tests/e2e/fixtures/failedbuilds, and theprep-reruncard shows "Terminal recording" under Logs. -
bash tests/e2e-report.sh,bash tests/e2e-pages.shand ShellCheck pass.
Not in this issue
- The choice between data files and
connect-src 'self': #169. The player and the CSP: #174. - Writing the casts and
recording.cast: #172. This issue works on fixtures and can merge before it. - Making the MP4 and writing
recording.mp4, and making no MP4 in CI: #175.
- Lingua principale
- Shell
- Stelle
- 2
- Fork
- 3
- Merge medio
- 2g 14m
- PR unite (30g)
- 47
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di exceev-consulting/server-prep
-
area: docs bug claude documentation good first issue priority: low size: S triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
exceev-consulting/server-prep#225 ·
I maintainer di solito rispondono entro 2 giorni
-
area: preconfig bug claude priority: medium size: S triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
exceev-consulting/server-prep#224 ·
I maintainer di solito rispondono entro 2 giorni
-
claude enhancement priority: low size: S
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
exceev-consulting/server-prep#222 ·
I maintainer di solito rispondono entro 2 giorni
-
e2e flake: boot fails on debian-13 when its genericcloud image is missing from SHA512SUMSForse già presa @exceev-claude l’ha presa 1 giorno fa. Apertaarea: ci bug claude priority: high size: S
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
exceev-consulting/server-prep#212 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
server-audit.sh: flag world-writable directories in /etc such as /etc/dokploy (GHSA-qxjv-6cvh-32c6)Apertaarea: audit claude enhancement panel: dokploy priority: high security size: S triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
exceev-consulting/server-prep#211 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di exceev-consulting/server-prep
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
huggingface/kernels#1006 ·
I maintainer di solito rispondono entro 1 giorno
-
severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
luainkernel/lunatik#2594 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
cardano-community/guild-operators#1930 ·
I maintainer di solito rispondono entro 1 giorno
-
out-of-date
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CachyOS/CachyOS-PKGBUILDS#2136 ·
I maintainer di solito rispondono entro 1 giorno