Commit Graph
17 Commits
Author SHA1 Message Date
Zakk dcb73966ce scripts/autobump-sweep.py: say why an opened PR is a draft
autobump-rb now prints the reason after opening a draft PR, such as
"only amd64 was built". Copy it into the issue's status comment, so
whoever reads the issue sees why the PR waits for review.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-10-21 08:48:14 +11:00
Zakk 0ebff6fd8e .github, scripts: drop dead code and stale comments
AUTOBUMP_JUDGE is set nowhere, so every escalation already goes to a
human; remove autobump-judge.sh and the judge path in
autobump-sweep.py, whose only other entry, the --accept-surface retry,
ran on a judge verdict alone. Behaviour with the variable unset is
unchanged.

Also drop debug output (echo pkgs, targets, cat make.conf), the 130
exit branch that only renamed the generic one, the unused
AUTOBUMP_STATUS_BACKOFF override, and comments that described the
shell autobump-sweep.py replaced or named the wrong caller.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-10-11 04:26:16 +11:00
Zakk fac5b38dec scripts: keep autobump from skipping issues and refusals silently
- select_issues: fetch up to 1000 open issues. The 200 limit now counts every
  open issue before the [nvchecker] title filter, so more open issues would
  push nvchecker issues out of the window.
- run_worker: annotate an item that raised, such as a missing bundle snapshot,
  with ::error so the skipped bump shows on a green run.
- find_status_comment_id: match only bot comments, and take the first id
  because --jq prints one per page with a match.
- autobump-trial.sh: skip a target whose overlay.toml entry autobump-args.py
  refuses instead of building it with default flags.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-10-09 11:10:14 +11:00
Zakk afb88a7577 .github/workflows: start autobump without the one-minute wait
The wait job slept 60 seconds because the issue search index lags issue
creation. The sweep now lists open issues without --search and keeps the
[nvchecker] titles with jq, so a new issue is listed at once and plan
carries the nvchecker gate itself.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-10-09 10:15:25 +11:00
Zakk 23dabd3139 scripts/autobump-sweep.py: report missing per-version bundles
The bundle controller now also sees opted-in packages without a bundle key, and a transient 404 on a per-version deps artifact is listed under waits in the shard delta, so autobump-wait can wait for that artifact instead of the next scheduled run.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-10-09 10:15:25 +11:00
Zakk bb2d857264 autobump.yml: give each package a fresh worker
Shared checkouts left later packages waiting on tracked modifications. Give each
attempt its own job while retaining eight concurrent workers. Cap planned attempts at
the matrix limit, including explicit issue lists.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-10-07 01:54:03 +11:00
Zakk 4ac63a2a18 scripts/autobump-sweep.py: assign the issue while a bump runs
The sweep adds AUTOBUMP_ASSIGNEE (gentoo-zh-bot by default) to the issue
before it runs the engine, so the issue list shows which versions autobump
is already working on. The assignment stays when a PR is opened and is
removed after an escalation, a deferral or a crash.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-10-04 16:18:03 +11:00
Zakk 0b26e19d66 .github/workflows/autobump.yml: prepare vendor bundles before bumping
nvchecker dispatched gentoo-deps bundles as soon as it saw a new version, but
autobump could reach the bump before the bundle was released; the 404 then ended as
an escalation or used up the transient retries.

The plan job now runs the bundle controller, autobump-rb's bin/bundles.py, for every
open issue whose package has `deps` or `bundle` in overlay.toml, opted in or not. It
dispatches a missing bundle at most three times per bundle and version, holds the
package back until the bundle is ready, and escalates after four observations. The
engine reads the snapshot through --bundle-status to tell a pending bundle from a
wrong file name.

`deps` names the gentoo-deps generator language, from which the controller derives
the repository, workflow, release tag and inputs; a producer with its own workflow,
as in gentoo-zh-drafts, takes the full `bundle` form. bundles.yml runs the same
controller to check or prepare a package's bundles by hand.

The nvchecker dispatch job and gentoo-deps-dispatcher.toml are removed, so only one
path dispatches bundles.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-10-01 01:16:59 +10:00
Zakk 7919e603eb scripts/autobump-sweep.py: count the attempts of a rerun
A rerun keeps GITHUB_RUN_ID and changes only GITHUB_RUN_ATTEMPT, so its
attempt lines matched the first run's, collect dropped them as
duplicates and the transient cap did not advance. A rerun's attempt now
carries its attempt number; a first attempt writes the same token as
before.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-10-01 00:58:52 +10:00
Zakk c856da9f2d scripts/autobump-sweep.py: keep the full escalation reason
The reason pattern stopped at the first ")", so a reason carrying its
own parentheses reached the issue cut short, e.g. "(404/403". The
engine closes the reason with "); evidence: <dir>", so match up to
that instead.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-10-01 00:58:52 +10:00
Zakk 297d476743 autobump: retry issues the ledger already recorded
An escalation records the bump as done, and DONE is keyed by version, so a fix in
the engine only reaches the package on its next release. --retry runs the named
issues again; it needs their numbers, so a re-run cannot sweep the whole queue by
accident.
2026-09-05 17:07:49 +10:00
Zakk 4398e97724 scripts/autobump-sweep: name kept evidence so it can be uploaded
Portage names an elog "<cat>:<pn>-<ver>:<timestamp>.log". GitHub refuses a colon in
an artifact path, so the upload step failed and took a finished bump's job red with
it - the bump itself had already succeeded. The copy replaces the characters an
artifact cannot carry, and the upload no longer fails the job: evidence is for
reading afterwards.
2026-09-04 23:44:00 +10:00
Zakk 5ed0c6eefa scripts/autobump-sweep: fix what the audits found in the driver
An attempt line now carries the run it came from, so two sweeps on one day both count
while the same delta delivered twice does not: collect de-duplicated them and the retry
cap never advanced, so a package that fails every run was retried forever instead of
reaching a maintainer.

The engine's verdict is read off its own "!!" abort line. Portage writes
"!!! Couldn't download" into the same stream, and a build log line saying "destination
path ... already exists" was recorded as "the overlay is already at this version" - a
permanent result for a transient failure.

Also: a child's output may hold bytes that are not UTF-8 and a finished bump was thrown
away decoding them; gh's exit status is honoured, so an auth or rate-limit failure is
not reported as an unparseable issue title; one package is planned once per run,
whatever version each issue names, instead of two engines racing in one package
directory; issue numbers given by hand are all attempted, as the single-job path
already did; a defer that gave up keeps its evidence; and an engine that died before
printing an evidence path no longer archives the whole checkout.
2026-09-03 22:05:29 +10:00
Zakk e1f4ec76f9 autobump: run the whole queue instead of the first 30 issues
The per-run cap dated from one job working through the queue in sequence. With
the queue sharded across workers a day's issues finish in one run, so default to
no cap and keep the input for capping a run by hand.
2026-09-03 01:13:05 +10:00
Zakk fc7ef73e1e autobump: report the whole record behind an escalation
A deferred bump said one line and dropped the rest: the engine's output was cut
to its last four lines and the issue comment carried 25 lines of escalations.txt,
so build.log and the tree/surface diffs never reached anyone. Print the engine
output whole, put every evidence file in the comment (cut, never summarised) and
upload the evidence directory as a run artifact.
2026-09-03 00:48:09 +10:00
Zakk ed18d1d710 autobump: bump several packages at once instead of one after another
因为一次运行是单个 job 顺着队列跑,所以一个慢包会把后面的都压住——单包上限两小时,队列
一长就跑不完。

改成分区而不是加锁:规划任务读一次缓存状态,把队列解析成 (包, 版本) 并切成互不重叠的
shard;bump worker 按 matrix 并行,各自只做自己那份、各开各的分支;collect 合并各 worker 的
ledger 增量并输出一份 summary。执行期没有共享状态,所以不存在认领竞争——两个 worker 用
`grep` 读同一个账本再各自 append,本来就会重复 bump 同一个包。

默认四个 shard、最多三个并行;再多主要是重复每个 worker 的 webrsync 与工具安装。

`--plan`、`--worker`、`--collect` 三个模式加进现有脚本,不带这些参数时行为不变。
`test/test_autobump_sweep.py` 增至 16 项,钉住分片互斥且覆盖全部候选、跳过措辞不变、
worker 不碰共享账本、增量合并去重、以及 limit 跨 shard 仍是整轮上限。

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-09-03 00:48:09 +10:00
Zakk f8e47cdb1e scripts/autobump-sweep: port the driver to Python
因为这是 autobump 里唯一没有测试的部分,而并行执行要动的正是它的账本与认领逻辑,所以先原样
移植再谈改造。

行为逐条保留:CLI 与环境变量契约、`DONE`/`ATTEMPTS` 的路径与行格式、引擎 0/2/3 的分派与
judge 判定后的重跑、状态留言的隐藏标记 upsert 与重试次数、`==== sweep summary ====` 的措辞。
两处既有怪癖也保留:悬空的 `--limit` 沿用旧值;某次留言失败的标记不会被后续成功清除。

`test/test_autobump_sweep.py` 用桩 `gh`、桩引擎与临时状态目录钉住九项:未开启、已完成、
单轮上限、exit 0、exit 3 取证据理由、exit 2 重试、超过上限转终止、留言失败标记、以及
`autobump-args.py` 的参数原样送达引擎。

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-09-02 17:21:58 +10:00