Open steveej opened 1 month ago
Can this not be provided by the writer of postBuildSteps as needed? Maybe documenting known portable ones would be a nice addition to documentation.
The variable that you posted, can you explain how this is going to be used in the actual post hook?
in this case i experimented with exposing these values as environment variables
postBuildSteps = [
{
name = "post-build-step-test";
environment =
let
props = lib.attrsets.genAttrs [
"attr"
"basename"
# ...
] (name: self.inputs.buildbot-nix.lib.interpolate "%(prop:${name})s");
props' = lib.attrsets.mapAttrs' (name: value: lib.nameValuePair "PROP_${name}" value) props;
in
props';
however, a preferred alternative that could be to write a single structured file (e.g. json or toml) that's discoverable via a single environment variable. this file could also include other namespaced information such as %(secret:..)s
, %(kw:...)s
, etc..
This is more to be done from the python side. As in we can by default expose all properties as environment variables or make it togglable per PBS (postbuildstep)
currently i have the following hardcoded
this list is just copied and pasted from the properties i saw on the web UI, and surely diverges for other forges and maybe even other projects on github. having a machine-readable way at runtime with all available properties would be nice.