Bind the pgpass credential where there is a workspace to write it to - #299
Merged
Conversation
Every build of the library testing has failed since #296 with org.jenkinsci.plugins.workflow.steps.MissingContextVariableException: Required context class hudson.FilePath is missing before a single stage ran. The password of the results database is a secret file, and Jenkins writes such a file into the workspace of a node; #296 bound it in the environment of the pipeline, which has agent none and therefore no workspace at all. It is now bound where a node exists: in the environment of the two report stages, beside the IDA_EMAIL credential they already bind that way, and around the test run and the cleanup in runRegressiontest, the way withSccache already binds its key. LIBTEST_DB stays in the environment of the pipeline; it is a string and needs nothing. Nothing about how the scripts read the password changes: libpq still finds it through PGPASSFILE. --- Generated by Claude Code.
adrpo
enabled auto-merge (squash)
August 11, 2026 17:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every build of the library testing has failed since #296 was merged, before a single stage ran:
What was wrong
The password of the results database is a secret file, and Jenkins materialises such a credential by writing it into the workspace of a node. #296 bound it in the environment of the pipeline:
pipeline { agent none environment { PGPASSFILE = credentials('omdb-pgpass') // no node here, no workspace }The pipeline runs with
agent noneand gives every stage its own agent, so at the level where the binding was written there is nohudson.FilePathto write the file to, and the build dies before it starts. A secret text credential would have survived this; a file cannot.The fix
The credential is bound where a node exists, in the two places that read the database:
environmentof the two report stages, beside theIDA_EMAILcredential they already bind that way, andrunRegressiontest, the waywithSccachealready binds its key.LIBTEST_DBstays in the environment of the pipeline: it is a string and needs no workspace.Nothing changes about how the scripts get the password — libpq still reads it through
PGPASSFILE, and it still never reaches a command line or the build log.Note
This is a hole in what I could check before merging #296: the selection logic and every script were exercised locally, but a credential binding only fails on a real Jenkins, and I have none. The right check for this change is a build.
Generated by Claude Code.