Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up[JENKINS-38110] Add a libraries section #128
Conversation
Note that this is very preliminary at this point - like, it doesn't actually call the library step yet, since we don't yet have a release of workflow-cps-global-lib-plugin with that included to depend on. We also don't have parsing tests or any of that jazz. But that's ok.
|
Note that this is very preliminary at this point - like, it doesn't |
kzantow
commented
Mar 1, 2017
|
Could the |
HRMPW
commented
Mar 1, 2017
|
@kzantow |
|
Yeah, the |
|
@HRMPW LibraryStep allows an optional |
kzantow
commented
Mar 1, 2017
|
Sorry, was conflating things... my goal for the editor is - as much as possible - to give the user choices for things to minimize errors, so as much info as we can pull from jenkins, the better... e.g. which |
|
@kzantow Yup, that we can do to at least some extent - leveraging LibraryStep's auto-complete logic |
Try: |
|
Thanks, @jglick - done. |
|
Moving out of work-in-progress - decided to leave out |
reviewbybees
commented
Mar 2, 2017
|
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
|
If we go with adding folder context to the validation we should also revisit the validation of the credentials function in environment so we can fail there as well fast if the user has entered an non existent credential id. |
|
So I'm guessing we deliberately don't support static imports from the dynamic libraries. |
| import org.jenkinsci.plugins.workflow.cps.CpsScript | ||
|
|
||
| /** | ||
| * Translates a closure containing a sequence of "library('string')" calls into an instance of {@link Libraries}. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| "description": "One or more shared library identifiers to load", | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
abayer
Mar 3, 2017
Author
Member
By supporting both the current array-of-strings and a new format for LibraryRetriever - anyOf will let us do that easily enough.
| @@ -148,7 +148,7 @@ | |||
| <dependency> | |||
| <groupId>org.jenkins-ci.plugins.workflow</groupId> | |||
| <artifactId>workflow-cps-global-lib</artifactId> | |||
| <version>2.5</version> | |||
| <version>2.7-20170301.201004-1</version> <!-- TODO: Update to 2.7 once released --> | |||
abayer commentedMar 1, 2017
librariessection to Declarative. Current syntax looks like:libraries { lib('foo@1.2.3') lib('bar') }Yes, I'd prefer not to have that pointless
libthere, but the alternative is something likelibraries 'foo@1.2.3', 'bar'and as we may remember fromagentback in the day, I do not care for that syntax at all. Plus, we may end up wanting to include the ability to specify aLibraryRetriever(see LibraryRetriever.java in workflow-cps-global-lib for details), in which case going tolib(identifier:'foo@1.2.3', retriever:[$class:...])is a much better option than anything else I could find.