Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52388

Unable to skip Declarative: Checkout SCM when restart from stage

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Environment:
    • Sprint:
      Declarative backlog
    • Similar Issues:

      Description

      If I try to restart from stage the Declarative: Checkout SCM stage runs regardless. In the previous run I may have changed items that have been checked out and these changes get undone by this stage. It would be good if there was an option to skipDefaultCheckout when you choose which stage to start from

        Attachments

          Activity

          Hide
          abayer Andrew Bayer added a comment -

          Hmm, interesting. In general, we work with the assumption that any changes to the workspace would need be to be stashed (and then unstashed in the restarted stage) to be preserved, so I'm not sure whether this fits...lemme think on it.

          Show
          abayer Andrew Bayer added a comment - Hmm, interesting. In general, we work with the assumption that any changes to the workspace would need be to be stashed (and then unstashed in the restarted stage) to be preserved, so I'm not sure whether this fits...lemme think on it.
          Hide
          presslej James Pressley added a comment -

          So for example if I build an artefact but then my deployment to for example a nexus repository fails due to a network issue. If I just want to retry deployment to nexus I should have stashed the artifact and unstash it at deployment? I still don't see the point of checking out again? I just want to keep the workspace as is and deploy now network issue has been resolved

          Show
          presslej James Pressley added a comment - So for example if I build an artefact but then my deployment to for example a nexus repository fails due to a network issue. If I just want to retry deployment to nexus I should have stashed the artifact and unstash it at deployment? I still don't see the point of checking out again? I just want to keep the workspace as is and deploy now network issue has been resolved
          Hide
          abayer Andrew Bayer added a comment -

          We can't guarantee that you'll get the same workspace in a restarted run - the original agent could be gone, another build could have reused the workspace since then, etc. Workspaces are only guaranteed to be consistent for a single node block in Pipeline (which, in Declarative, would mean within a single agent definition). In your case, you'd probably want to restart from the stage that actually builds the artifact you want to deploy, not just at a stage that deploys after an earlier stage has built it.

          Show
          abayer Andrew Bayer added a comment - We can't guarantee that you'll get the same workspace in a restarted run - the original agent could be gone, another build could have reused the workspace since then, etc. Workspaces are only guaranteed to be consistent for a single node block in Pipeline (which, in Declarative, would mean within a single agent definition). In your case, you'd probably want to restart from the stage that actually builds the artifact you want to deploy, not just at a stage that deploys after an earlier stage has built it.

            People

            • Assignee:
              abayer Andrew Bayer
              Reporter:
              presslej James Pressley
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: