I'm not sure where the timeout step is defined, but it would be nice if it had some more intuitive parameters.

      Currrently, it offers time and units.

      options {
          timeout time: 5, units: 'MINUTES'
      }
      

      Since Groovy and Jenkins both provide for optional parameters we should provide parameters to make this simpler to write:

      options {
          timeout minutes: 5
      }
      

      This could also allow for combining of parameters:

      options {
          timeout hours: 2, minutes: 15
      }
      

          [JENKINS-41393] Add time interval parameters to timeout step

          Jesse Glick added a comment -

          The step is defined in workflow-basic-steps, and no change along these lines is likely implementable for technical reasons, but the options block option is specific to Declarative and implemented in pipeline-model-definition.

          Jesse Glick added a comment - The step is defined in workflow-basic-steps , and no change along these lines is likely implementable for technical reasons, but the options block option is specific to Declarative and implemented in pipeline-model-definition .

          Liam Newman added a comment - - edited

          jglick
          Looking at the code, I can see why it would be tricky but not impossible.

          The steps in workflow-basic-steps aren't available outside of pipeline, right? We don't have to maintain UI-level backward compatibillty, do we?

          If not, then it seems like it would still be possible to add the new parameters while still accepting the existing ones, maybe with a check to make using the new and the old exclusive of each other.

          abayer
          Jesse changed the plugin field to suggest the change apply only to declarative options timeout. Did you change it back because you disagree or for some other reason?

          Liam Newman added a comment - - edited jglick Looking at the code, I can see why it would be tricky but not impossible. The steps in workflow-basic-steps aren't available outside of pipeline, right? We don't have to maintain UI-level backward compatibillty, do we? If not, then it seems like it would still be possible to add the new parameters while still accepting the existing ones, maybe with a check to make using the new and the old exclusive of each other. abayer Jesse changed the plugin field to suggest the change apply only to declarative options timeout. Did you change it back because you disagree or for some other reason?

          Andrew Bayer added a comment -

          Yup, I did, sorry. As a general rule, we don't do Declarative-specific behavior for existing steps, so...yeah.

          Andrew Bayer added a comment - Yup, I did, sorry. As a general rule, we don't do Declarative-specific behavior for existing steps, so...yeah.

          Jesse Glick added a comment -

          This may involve serious structs hackery. Since there is already a visual configuration option for scripted Pipelines, and I guess one coming for Declarative too, it seems like a poor use of time.

          Jesse Glick added a comment - This may involve serious structs hackery. Since there is already a visual configuration option for scripted Pipelines, and I guess one coming for Declarative too, it seems like a poor use of time.

            Unassigned Unassigned
            bitwiseman Liam Newman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: