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

Corruption of workspace due to incomplete parameters substitution (no validation)

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hello,

      We have experienced several issues with substitution of parameters during execution of operation.

      For example, ${EXECUTOR_NUMBER} works well for checkout(), but this parameter is not accessible during execution processWorkspaceBeforeDeletion(). It causes corruption of job, which requires manual fix at server’s side. Reproduction steps:
      • We start job, and checkout() successfully creates workspace.
      • Cleanup workspace…
      • getWorkspace() in processWorkspaceBeforeDeletion() creates new workspace at Perforce server (name contains unsubstituted EXECUTOR_NUMBER parameter) and then deletes it. BTW, it deletes local folders as well.
      • Run job again…
      • Checkout() completes successfully, because P4 server thinks that workspace is up to date
      • Job fails, because there’s no data in job’s workspace after p4 checkout

      Best regards,
      Oleg Nenashev

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Pull request, which partially resolves issue:
          https://github.com/jenkinsci/perforce-plugin/pull/29

          Show
          oleg_nenashev Oleg Nenashev added a comment - Pull request, which partially resolves issue: https://github.com/jenkinsci/perforce-plugin/pull/29
          Hide
          rpetti Rob Petti added a comment -

          Pull request has been merged. I'm not sure what else there is to do here?

          Show
          rpetti Rob Petti added a comment - Pull request has been merged. I'm not sure what else there is to do here?
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          I've tested plugin at my servers, and there weren't any additional issues with workspaces. I suppose that patch has successfully passed tests at your test stand as well. Therefore, issue seems to be resolved.

          Regarding this issue, I'm going to add validation of unsupported variables during configuration of p4 SCM. It will allow to prevent errors in variables usage.

          When are you going to release new version? Probably, I could add several additional features to current or future version:

          • Built-in p4 checkout timeout, which will prevent hanging of p4 client. BTW, it's just a workaround for the bug.
          • Validation of client name (according to pattern from a global configuration)
          Show
          oleg_nenashev Oleg Nenashev added a comment - I've tested plugin at my servers, and there weren't any additional issues with workspaces. I suppose that patch has successfully passed tests at your test stand as well. Therefore, issue seems to be resolved. Regarding this issue, I'm going to add validation of unsupported variables during configuration of p4 SCM. It will allow to prevent errors in variables usage. When are you going to release new version? Probably, I could add several additional features to current or future version: Built-in p4 checkout timeout, which will prevent hanging of p4 client. BTW, it's just a workaround for the bug. Validation of client name (according to pattern from a global configuration)
          Hide
          oleg_nenashev Oleg Nenashev added a comment - - edited

          Resolved by the pull request

          Show
          oleg_nenashev Oleg Nenashev added a comment - - edited Resolved by the pull request
          Hide
          rpetti Rob Petti added a comment -

          I'll probably kick off a release at the end of the week if I don't find anything wrong with it.

          The checkout timeout is a bit tricky to implement, since it's entirely possible that a user might have a checkout that takes hours. Toss me an email if you want to discuss further.

          Show
          rpetti Rob Petti added a comment - I'll probably kick off a release at the end of the week if I don't find anything wrong with it. The checkout timeout is a bit tricky to implement, since it's entirely possible that a user might have a checkout that takes hours. Toss me an email if you want to discuss further.

            People

            • Assignee:
              oleg_nenashev Oleg Nenashev
              Reporter:
              oleg_nenashev Oleg Nenashev
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: