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

Unable to skip Declarative: Checkout SCM when restart from stage

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • Declarative backlog

      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

          [JENKINS-52388] Unable to skip Declarative: Checkout SCM when restart from stage

          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.

          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.

          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

          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

          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.

          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.

            Unassigned Unassigned
            presslej James Pressley
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: