Add Pipeline support && generic update#2
Conversation
It was generally broken even ib the original branch.
Also changes the data structure and layout
|
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. |
Why not just use Replay? |
How it can help with Libraries? From what I see I will have to commit/push them every time. Not thet comfortable for the local development. |
No, at least for untrusted libraries you can replay library changes as well as main script or |
|
I used this snapshot in a Jenkins pipeline job. At first it was working as expected. |
|
@BerndPfaff Nope, it is not. Will try to reproduce once I find some time to finish this pull request |
|
Retriggering CI |
|
👍 Would love to see this update. We are doing something very similar and this looks immensely helpful. |
|
I hope to finalize it soon |
|
@reviewbybees back to review. |
| <licenses> | ||
| <license> | ||
| <name>MIT License</name> | ||
| <url>http://www.opensource.org/licenses/mit-license.php</url> |
There was a problem hiding this comment.
There was a problem hiding this comment.
Does Netbeans already autoresolve it?
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.jenkins-ci.plugins.workflow</groupId> | ||
| <artifactId>workflow-aggregator</artifactId> |
There was a problem hiding this comment.
Do not use this plugin as a dependency even for tests. Specify workflow-cps, workflow-job, and any step plugins you need.
| /* | ||
| * To change this license header, choose License Headers in Project Properties. | ||
| * To change this template file, choose Tools | Templates | ||
| * and open the template in the editor. |
| */ | ||
| public class PipelineLibraryTest { | ||
|
|
||
| } |
| <version>2.4</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <!-- Transient upper bound dependencies --> |
| import jenkins.SlaveToMasterFileCallable; | ||
|
|
||
| public class RemoteCopyDir implements FileCallable<Boolean> { | ||
| public class RemoteCopyDir extends SlaveToMasterFileCallable<Boolean> { |
There was a problem hiding this comment.
Probably also wrong, though the class appears unused anyway so maybe just delete it.
| import java.io.*; | ||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
| import jenkins.security.SlaveToMasterCallable; |
| <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"> | ||
| <f:entry title="Path" help="/plugin/filesystem_scm/help-path.html"> | ||
| <f:textbox name="fs_scm.path" value="${scm.path}" /> | ||
| <f:entry title="Path" field="path" help="/plugin/filesystem_scm/help-path.html"> |
There was a problem hiding this comment.
Move help file to this folder and help need not be specified.
There was a problem hiding this comment.
It came from the old structure. I would prefer to refactor it later
| </f:entry> | ||
| <f:entry title="Clear Workspace" help="/plugin/filesystem_scm/help-clearWorkspace.html"> | ||
| <f:checkbox name="fs_scm.clearWorkspace" checked="${scm.clearWorkspace}"/> | ||
| <f:entry title="Clear Workspace" field="clearWorkspace" help="/plugin/filesystem_scm/help-clearWorkspace.html"> |
| </f:block> | ||
| </f:optionalBlock> | ||
| </table> | ||
| <f:entry title="Copy Hidden Files/Folders" field="copyHidden" help="/plugin/filesystem_scm/help-copyHidden.html"> |
| } | ||
|
|
||
| @Extension | ||
| @Symbol("fsscm") |
There was a problem hiding this comment.
Should not include the scm. Maybe just filesystem?
|
|
||
| @Override | ||
| public boolean requiresWorkspaceForPolling() { | ||
| return super.requiresWorkspaceForPolling(); //To change body of generated methods, choose Tools | Templates. |
|
|
||
| public class RemoteCopyDir extends SlaveToMasterFileCallable<Boolean> { | ||
| /** | ||
| * @deprecated Not used anymore |
There was a problem hiding this comment.
Breaks binary compatibility. I do not want to touch it for now
| // Init repo | ||
| // File fsscmDir = tmpDir.newFolder("fsscm"); | ||
| // File jenkinsfile = new File(fsscmDir, "Jenkinsfile"); | ||
| // FileUtils.write(jenkinsfile, "echo `Hello, world!`"); |
There was a problem hiding this comment.
The test is still the mess
Blockers fixed. Tests still look incomplete.
|
OK, now the test just hangs |
|
@jglick @niothiel @BerndPfaff I have released the current state as alpha-1. It should become available in the experimental UC soon. I will test it more before the release, especially the case from @BerndPfaff though I was unable to reproduce it. |
|
i got the same problem as @BerndPfaff
i create new pipeline job foo and put a wrong path into fspath then save (as admin:admin) |
|
@tanandy Ack, I will double check it once I get back to the plugin |
|
@tanandy @BerndPfaff Fixed that stupid issue in the code and released alpha-2. Sorry, was working on other things and this slipped down the priority list |
|
@oleg-nenashev thanks a lot 👍 |
|
It works perfectly! :) |
|
I probably won't be able to review before then. |
|
@svanoort just let me know if you want to review it. I can wait with release till Friday EoBD in your timezone. You know, conference-driven development :) |
|
🚢 🇮🇹 |
|
I will not bump the version to 2.0, there is no significant compat breakages |
|
Well, I changed my mind after some consideration. In the worst case I will introduce 3.0 if I ever implement the SCM API |
|
Oh well, better to be on the safe side OTOH |
I'm working on a pet project, which involves automation for Jenkins Pipeline based on libs. I need to test libs without committing changes, hence I decided to use Filesystem SCM plugin for such purpose. The plugin was very outdated (last release - 2011), hence there is a bunch of changes
After the changes the plugin supports the
scmstep and can be used as a Library SCM source. Functional tests will be added later if original maintainers +1 the approach (CC @kohsuke, @samngms and @kutzi )Old Config UI:
New config UI:
@reviewbybees