Preempt future Woodpecker schema hard-fail: move plugin secrets to settings.*.from_secret #24
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Not blocking. Forward-looking cleanup surfaced during the oleks/ci-scripts#19 flake-hub canary (oleks/cluster#224 capacity incident, unrelated).
Context: every thin pipeline step (both the fleet family in
render_thin_fleet.pyand the quartet single/split additions inrender_thin_quartet.py) declaresenvironment:for token secrets (REGISTRY_TOKEN,ATTIC_TOKEN,GITEA_CLONE_TOKEN) alongsidesettings:(run,flow,cache, etc.) on the same step. Woodpecker's linter flags this:"Should not configure both 'environment' and 'settings'"plus a schema warning"Additional property settings is not allowed".Verified NOT currently broken (source-read against woodpecker-ci/woodpecker@main, matching our 3.15 server):
pipeline/frontend/yaml/compiler/convert.go'screateProcess()callssettings.ParamsToEnv(container.Settings, ..., "PLUGIN_", ...)andsettings.ParamsToEnv(container.Environment, ..., "", ...)unconditionally — noIsPlugin()gate on either. Both secrets andPLUGIN_*settings reliably reach the container today.pipeline/frontend/yaml/linter/linter.go'slintSettings():commands+settingsandentrypoint+settingsare hard errors;environment+settingsis explicitlynewLinterError(..., true)—is_warning: trueby design, a deliberate soft advisory.environment:is present) is inert:server/store/datastore/migration/004_remove_secrets_plugin_only_col.godropped that DB column entirely years ago.Why this is still worth doing eventually: the schema-validation warning comes from
lintSchema(), and the source has this exact comment at the call site:// TODO: let pipelines fail if the schema is invalid. A future Woodpecker upgrade could turn today's soft warning into a hard pipeline failure with no notice beyond a changelog entry.Proposed migration (not urgent, do in one pass across BOTH families):
settings:, e.g.settings: { attic_token: { from_secret: attic_token } }→ arrives in the container asPLUGIN_ATTIC_TOKEN.entrypoint.shto readPLUGIN_ATTIC_TOKEN/PLUGIN_REGISTRY_TOKEN/PLUGIN_GITEA_CLONE_TOKENfirst, falling back to the bareATTIC_TOKEN/REGISTRY_TOKEN/GITEA_CLONE_TOKENnames for compatibility during rollover.render_thin_fleet.pyandrender_thin_quartet.pyto emit the newsettings:-only shape, droppingenvironment:entirely from thin steps.tag_strip_v/image_name— no need for a separate republish).Acceptance:
entrypoint.shreadsPLUGIN_*-prefixed secret names with bare-name fallback.settings:-only steps (noenvironment:for secrets).Not a prerequisite for any in-flight canary — the current design is confirmed safe on 3.15.