Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Inherited/Overridden variables via REST in running build #4286

uartie ·

When accessing a build via REST API (e.g. <QB URL>/rest/builds/<buildid>), if the build is RUNNING then any inherited or overridden variables do not show up in the "secretAwareVariableValues" (even after the variable has been referenced in a running/completed step). These variables only show up via REST after the build has finished.

Is there a way to get the inherited/overridden variables via REST while the build is running?

  • replies 3
  • views 85
  • stars 0
uartie ·

Interestingly, if I add groovy: build.getVarValue("overridden_var"); to the "Pre-Build Script" in advanced settings, then it shows up in the REST result while build is running.

uartie ·

I think this might actually be an issue with any type of variable (e.g. local, inherited or overridden) that is not used in pre-build settings. That is, if a variable is referenced in a Repository, General/Advanced Settings, etc. before the build runs, then it will be available via REST result while the build is running. If a variable is only referenced from Steps, then it will not show up in REST result until the build finishes.

robinshen ADMIN ·

This is by design, variables are only flushed twice during a build for performance reason, once before build and once after build.