As I understand it right now, if I specify an agent, it creates a node, runs checkout scm, and uses the same node/workspace for all of the stages? And if I specify agent: none, I have to create my own node in each stage, and re-run checkout scm for each stage?

      What I want to do is specify "Additional Behaviors" on the checkout step (currently using the workaround described here), but achieve the benefits of running it once on the top-level agent and re-using across all stages.

      Is there any way to achieve this? Either by specifying Additional Behaviors on the top-level pipeline, or allowing a user to override the implicit checkout scm that happens when agent is set?

      Thanks!

          [JENKINS-40337] Support custom checkout scm behaviors

          Logan Glickfield created issue -
          Andrew Bayer made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          Andrew Bayer added a comment -

          Good question - thinking about that now.

          Andrew Bayer added a comment - Good question - thinking about that now.

          Andrew Bayer added a comment -

          How would you feel about a top-level "skipCheckout" (or something like that) option? Then you could do a customized checkout yourself at the beginning of your first stage. I'm as of yet unable to come up with a smooth way to allow specifying the various custom SCM options with validation at the top-level, so I think for now, I'd definitely lean towards a skip option, since that's simpler and I think can be useful in some other ways.

          Andrew Bayer added a comment - How would you feel about a top-level "skipCheckout" (or something like that) option? Then you could do a customized checkout yourself at the beginning of your first stage. I'm as of yet unable to come up with a smooth way to allow specifying the various custom SCM options with validation at the top-level, so I think for now, I'd definitely lean towards a skip option, since that's simpler and I think can be useful in some other ways.

          That sounds like a reasonable solution to me!

          Logan Glickfield added a comment - That sounds like a reasonable solution to me!

          Andrew Bayer added a comment -

          Great! I'm going to add a top-level options section and a skipCheckout flag inside that section, so that we don't end up with tons of future flags. =)

          Andrew Bayer added a comment - Great! I'm going to add a top-level options section and a skipCheckout flag inside that section, so that we don't end up with tons of future flags. =)

          Michael Neale added a comment -

          SGTM

          Michael Neale added a comment - SGTM
          Andrew Bayer made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]

          Andrew Bayer added a comment -

          Andrew Bayer added a comment - Initial PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/67
          Andrew Bayer made changes -
          Remote Link New: This issue links to "PR #67 (Web Link)" [ 15122 ]

            abayer Andrew Bayer
            lsglick Logan Glickfield
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: