Skip to content

Commit 443f15b

Browse files
author
Andy C
committed
[regtest/aports] Update causes to link to bugs
- add automation for causes in aports-html.sh, and document it
1 parent cd647d3 commit 443f15b

File tree

3 files changed

+88
-12
lines changed

3 files changed

+88
-12
lines changed

regtest/aports-html.sh

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ published-html() {
191191
- [2025-08-07-fix](2025-08-07-fix.wwz/_tmp/aports-report/2025-08-07-fix/diff_merged.html)
192192
- [2025-08-14-fix](2025-08-14-fix.wwz/_tmp/aports-report/2025-08-14-fix/diff_merged.html)
193193
- [2025-08-26-ifs](2025-08-26-ifs.wwz/_tmp/aports-report/2025-08-26-ifs/diff_merged.html)
194+
- new causes: [2025-09-06-edit](2025-09-06-edit.wwz/_tmp/aports-report/2025-09-06-edit/diff_merged.html)
194195
195196
EOF
196197

@@ -260,7 +261,7 @@ make-package-table() {
260261

261262
sqlite3 -cmd '.mode columns' $db < regtest/aports/tasks.sql
262263

263-
pushd $base_dir/$config
264+
pushd $base_dir/$config > /dev/null
264265

265266
db-to-tsv $db packages
266267

@@ -278,7 +279,8 @@ make-package-table() {
278279
.mode column
279280
select * from metrics;
280281
EOF
281-
popd
282+
283+
popd > /dev/null
282284

283285
#cat $base_dir/$config/packages.schema.tsv
284286
}
@@ -331,7 +333,8 @@ make-diff-db() {
331333
local cause_awk=$PWD/regtest/aports/cause.awk
332334
local cause_sql=$PWD/regtest/aports/cause.sql
333335

334-
pushd $base_dir
336+
pushd $base_dir > /dev/null
337+
335338
rm -f $db
336339
sqlite3 $db < $diff_sql
337340

@@ -374,7 +377,7 @@ EOF
374377
# The DB is diff_baseline.db, with table diff_baseline
375378
db-to-tsv $db diff_baseline
376379

377-
popd
380+
popd > /dev/null
378381
}
379382

380383
db-to-tsv() {
@@ -491,12 +494,12 @@ merge-diffs() {
491494
local name2=metrics
492495

493496
# copied from above
494-
pushd $epoch_dir
497+
pushd $epoch_dir > /dev/null
495498

496499
db-to-tsv $db diff_merged 'order by pkg'
497500
db-to-tsv $db metrics
498501

499-
popd
502+
popd > /dev/null
500503

501504
make-apk-merged $epoch_dir $db
502505

@@ -607,6 +610,52 @@ deploy-published() {
607610
echo "Visit https://$dest_dir/published.html"
608611
}
609612

613+
#
614+
# For editing
615+
#
616+
617+
readonly EDIT_DIR=_tmp/aports-edit
618+
619+
sync-wwz() {
620+
local wwz=${1:-2025-08-26-ifs.wwz}
621+
622+
mkdir -p $EDIT_DIR
623+
624+
rsync --archive --verbose \
625+
$WEB_HOST:$WEB_HOST/aports-build/$wwz \
626+
$EDIT_DIR/$wwz
627+
628+
ls -l $EDIT_DIR
629+
#echo "Wrote $wwz"
630+
}
631+
632+
extract() {
633+
local wwz=${1:-2025-08-26-ifs.wwz}
634+
local new_epoch=${2:-2025-09-06-edit}
635+
636+
# Extract the whole thing into a temp dir
637+
local tmp_dir=$EDIT_DIR/$new_epoch
638+
rm -r -f $tmp_dir
639+
mkdir -p $tmp_dir
640+
641+
pushd $tmp_dir
642+
unzip ../$wwz
643+
popd
644+
645+
# Now re-create the old structure under _tmp/aports-report/2025-09-06-edit
646+
647+
local dest_dir=$REPORT_DIR/$new_epoch
648+
mkdir -p $dest_dir
649+
650+
local old_epoch
651+
old_epoch=$(basename $wwz .wwz)
652+
mv -v --no-target-directory $tmp_dir/_tmp/aports-report/$old_epoch $dest_dir
653+
}
654+
655+
#
656+
# Dev tools
657+
#
658+
610659
out-of-vm() {
611660
local dest=~/vm-shared/$EPOCH
612661
mkdir -p $dest

regtest/aports.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,32 @@ Then look at the logs in
209209

210210
$ regtest/aports-run.sh enter-rootfs # as root user
211211

212+
### Update `cause.awk`, re-generate HTML, and re-deploy
213+
214+
Suppose you want to edit `regtest/aports/cause.awk` to add new causes. For
215+
example, you can link to bug `#2339` with a line like:
216+
217+
patterns["#2339"] = "requires a signal or hook name"
218+
219+
First sync the latest report from the `op.oils.pub` web server:
220+
221+
regtest/aports-html sync-wwz 2025-08-26-ifs.wwz
222+
223+
Then extract it to a new "epoch":
224+
225+
regtest/aports-html extract 2025-08-26-ifs.wwz 2025-09-06-edit
226+
227+
Then re-generate HTML:
228+
229+
$ regtest/aports-html.sh write-all-reports _tmp/aports-report/2025-09-06-edit
230+
231+
You can iterate on `cause.awk`, generating new HTML.
232+
233+
And then upload a new report as before. You can similarly edit the function
234+
`regtest/aports-html.sh published-html` to include a link.
235+
236+
- <https://op.oils.pub/aports-build/published.html>
237+
212238
## TODO
213239

214240
- Running under podman could be more reliable

regtest/aports/cause.awk

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ BEGIN {
3535
# esh package: OSH string
3636
patterns[9] = "fatal: Undefined variable"
3737

38-
# mawk: trap 0
39-
patterns[10] = "requires a signal or hook name"
38+
# mawk, openvpn: trap 0
39+
patterns["#2339"] = "requires a signal or hook name"
4040

4141
# pkgconf
4242
patterns[11] = " with multiple files"
@@ -52,11 +52,12 @@ BEGIN {
5252
patterns[14] = "terminate called after throwing an instance of"
5353

5454
# screen
55-
patterns[65] = "mkdir: invalid option --"
56-
patterns[15] = "mkdir: unrecognized option: /" # changed 2025-08-04-rootbld
55+
patterns["#2364"] = "mkdir: unrecognized option: /" # changed 2025-08-04-rootbld
56+
patterns["##2364"] = "mkdir: invalid option --"
5757

5858
# postfix
59-
patterns[16] = "Unexpected token after arithmetic expression"
59+
# gzip
60+
patterns["#2337"] = "Unexpected token after arithmetic expression"
6061

6162
# make
6263
patterns[17] = "oils I/O error"
@@ -65,7 +66,7 @@ BEGIN {
6566
patterns[18] = "[ backticks in [ -c flag ] ]"
6667

6768
# sqsh
68-
patterns[19] = "(test) Unexpected trailing word"
69+
patterns["#2409"] = "(test) Unexpected trailing word"
6970

7071
found = 0
7172
}

0 commit comments

Comments
 (0)