Newly defined parameters aren't available in Declarative agent configuration on first build

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Declarative backlog

      This is similar to both JENKINS-40574 and JENKINS-43911 (well, how JENKINS-43911 would behave from 1.2 onward - previously it was just that environment was evaluated after agent during execution) - parameters is evaluated at the beginning of the Declarative runtime, but agent is populated before that, at the very start of execution. So if params.FOO already exists when the build starts, then agent { label params.FOO }}} will work fine, but if it's a new parameter (like, say, on first build of a branch), {{params.FOO's value there will end up as null.

      A workaround for now is to do label "${params.FOO ?: 'whatever-the-default-value-should-be'}", but I'll work on a better solution.

            Assignee:
            Unassigned
            Reporter:
            Andrew Bayer
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: