## Problem A manual `crow pipeline create` instantiates **every** pipeline in `.crow/`, and each one decides for itself whether to run. Three had nothing to decide with — their only manual condition was a bare `event: manual`: - `auto-apply-patches` — pushes to `auto/registry-patch-proposals` and opens/updates a PR - `weekly-patch-proposals` — posts and edits two Forgejo issues - `trial-build-registry` — starts a build per matrix row, on both arches So they fired on *any* manual trigger in this repo, whatever it was for. That is how they came to run alongside a manual `process-updates` run for `alpine-324-arm64` (#10723), which is also why that pipeline is marked failure. `repair-built-stamp.yaml` already documents the rule this breaks: > The gate variable is `repair_built_stamp`, not `target_arch` … Every pipeline here gates on a variable named after itself for exactly that reason. ## What this changes Each of the three gets a gate variable named after the pipeline, `evaluate`d on the manual event, defaulting to off: ```yaml variables: auto_apply_patches: description: 'Run the auto-patch proposer. Also gates this pipeline.' options: ['true', 'false'] default: 'false' when: - event: manual evaluate: 'auto_apply_patches == "true"' - event: cron cron: auto-apply-patches ``` Cron triggers are untouched, so the scheduled runs behave exactly as before. The run-manually comments in all three headers were also stale: they documented `--var task=<name>` with `woodpecker-cli`, and no pipeline evaluates a `task` variable. They now show the real invocation. ## Note on the sibling pipelines The already-gated pipelines use `default: all` (e.g. `weekly_rebuild_missing`). If Crow applies a declared default to a variable that an API-created pipeline never passed, those would match on an unrelated manual run too — `weekly-rebuild-missing` would be an expensive way to find out. I could not settle that from #10723 because its step logs have since expired, so I left them alone rather than guess. The three fixed here default to `'false'`, which is safe under either semantics. ## Verification `crow lint .crow/` passes. Auditing every pipeline that accepts a manual event now reports a gate on all ten: ``` build-all-versions-install-deps.yaml: gated auto-apply-patches.yaml: gated weekly-patch-proposals.yaml: gated weekly-audit-missing.yaml: gated repair-built-stamp.yaml: gated archive-missed-packages.yaml: gated weekly-rebuild-missing.yaml: gated trial-build-registry.yaml: gated build-all-versions.yaml: gated process-updates.yaml: gated ``` Reviewed-on: #155
76 lines
2.6 KiB
YAML
76 lines
2.6 KiB
YAML
# Auto-apply registry patches (issue #115, step 3 automation).
|
|
# Classifies `single_builds` failures and, for the top-N auto-proposable
|
|
# candidates by failure volume, writes the registry entries onto the reused
|
|
# `auto/registry-patch-proposals` branch and opens/updates a single PR.
|
|
# Nothing merges: the `trial-build-registry` pipeline is the merge gate, and a
|
|
# human reviews the PR. Novel source diffs / unknown signatures are never
|
|
# proposed. Global across platforms, so a single job -- no matrix.
|
|
#
|
|
# FORGEJO_TOKEN is used for both the branch push and opening the PR (no separate
|
|
# write-scoped secret needed). Register the `auto-apply-patches` cron in the crow
|
|
# UI, or run manually:
|
|
# crow pipeline create --branch main \
|
|
# --var auto_apply_patches=true devxy/build-cran-binaries
|
|
#
|
|
# The gate variable is `auto_apply_patches`, named after the pipeline: a manual
|
|
# run instantiates every pipeline in `.crow/`, so one without its own gate runs
|
|
# on *any* manual trigger in this repo. This one pushes a branch and opens a PR,
|
|
# so it must stay off unless it is what was asked for.
|
|
variables:
|
|
auto_apply_patches:
|
|
description: 'Run the auto-patch proposer. Also gates this pipeline.'
|
|
options:
|
|
- 'true'
|
|
- 'false'
|
|
default: 'false'
|
|
patch_limit:
|
|
description: 'Max candidates to propose per run (top by failure volume).'
|
|
default: '10'
|
|
|
|
when:
|
|
- event: manual
|
|
evaluate: 'auto_apply_patches == "true"'
|
|
- event: cron
|
|
cron: auto-apply-patches
|
|
|
|
skip_clone: true
|
|
|
|
labels:
|
|
group: rpkgs-amd64
|
|
|
|
steps:
|
|
- name: 'Auto-apply registry patches'
|
|
image: reg.devxy.io/rpkgs/build-env-alpine:3.24
|
|
pull: true
|
|
environment:
|
|
PGPASS:
|
|
from_secret: PGPASS
|
|
REPO_RO_TOKEN:
|
|
from_secret: REPO_RO_TOKEN
|
|
FORGEJO_TOKEN:
|
|
from_secret: FORGEJO_TOKEN
|
|
GIT_USER: devxy-bot
|
|
GIT_EMAIL: bot@devxy.io
|
|
PATCH_LIMIT: ${patch_limit}
|
|
R_VERSION: 4.5.3
|
|
R_LIBS_USER: /mnt/cache/R-pkgs
|
|
commands:
|
|
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
|
|
- mkdir -p /mnt/cache/R-pkgs
|
|
- rm -rf /mnt/cache/R-pkgs/00LOCK-*
|
|
- UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh httr2 jsonlite
|
|
- /opt/R/$R_VERSION/bin/Rscript local/propose-patches.R --open-pr --limit $PATCH_LIMIT
|
|
backend_options:
|
|
kubernetes:
|
|
resources:
|
|
requests:
|
|
memory: 1Gi
|
|
cpu: 2000m
|
|
limits:
|
|
memory: 2Gi
|
|
cpu: 2000m
|
|
tolerations:
|
|
- key: 'CI'
|
|
operator: 'Equal'
|
|
value: 'true'
|
|
effect: 'NoSchedule'
|