[JIRA] (JENKINS-60545) Replay with ModernSCM doesn't use relevant library version.

2 views
Skip to first unread message

kwirth@perforce.com (JIRA)

unread,
Dec 19, 2019, 12:00:02 PM12/19/19
to jenkinsc...@googlegroups.com
Karl Wirth created an issue
 
Jenkins / Improvement JENKINS-60545
Replay with ModernSCM doesn't use relevant library version.
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: p4-plugin
Created: 2019-12-19 16:59
Environment: p4-plugin 1.10.7
Labels: P4_VERIFY
Priority: Minor Minor
Reporter: Karl Wirth

Replaying a dynamically loaded library will load the latest version of the library and not the library available at the time of the build.

 

Reproduction Steps:

(1) Submit following file to Perforce:

//depot/lib_autoload/libs/src/com/f5/v4/Device.groovy

 

#!groovy
package com.f5.v4class Device implements Serializable {
     static void main()
     {
       println("This is Device in the Library I EDITED THIS.")
     }
     static void test()
     {
       println("This is test in Device in the Library")
     }     
     static String test2()
     {
       return "This is test2() in Device in the Library"
     }
}

(2) Create a pipeline job with code similar to:

 

 

def f5Lib

timestamps{
    try {
        node ('master') {
            f5Lib = loadF5Lib()
            def buildData = f5Lib.com.f5.v4.Device.test2();
            echo buildData
            }
    }
    catch (e) {
        throw e
    }    echo "Running some tests here..."
}


// Load a specific Library
def loadF5Lib() {
    def lib = library( identifier : '@now',retriever: modernSCM(globalLib(charset: 'none', credential: 'JenkinsMaster', id: '9bb4320c-c31c-46ce-8c5f-68872f519067', path: '//depot/lib_autoload/libs/...')))
    
    return lib
}

(3) Run the job (Build#1). The following text is seen in the console log:

 

 

This is test2() in Device in the Library

(4) Change the returned text in the library method ' test2' to be:

 

 

static String test2() 
{ 
     return "This is the edited test2() in Device in the Library" 
} 

 

(5) Run the job (Build #2)

(6) Replay Build #1. The text displayed is the latest text from the edit made in step (4):

This is the edited test2() in Device in the Library

Expected Result:

This is test2() in Device in the Library

 

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages