You can pin a library at a submitted changelist number to lock the job to that known good test code. For example:
@Library('my-shared-library@1234')
To allow of testing of changes to the libraries before submitting the code it would be good if you could specify a pending shelved changelist. For example:
@Library('my-shared-library@=12345')
where 12345 is a shelved changelist.
Â
Note - The intention is to provide functionality similar to shared library pull requests:
https://www.jenkins.io/doc/book/pipeline/shared-libraries/#testing-library-pull-request-changes