Skip to content
Permalink
Browse files

Merge pull request #46 from jglick/JEP-200-JENKINS-49574

[JENKINS-49574] JEP-200 compatibility
  • Loading branch information...
jglick committed Feb 28, 2018
2 parents 25e0d5f + fa4b67c commit b06434d590add2c631622d32c30db76a6aaa3103
Showing with 134 additions and 246 deletions.
  1. +2 −0 Jenkinsfile
  2. +19 −43 pom.xml
  3. +6 −29 src/main/java/hudson/scm/AbstractCvs.java
  4. +15 −98 src/main/java/hudson/scm/CVSChangeLogSet.java
  5. +11 −2 src/main/java/hudson/scm/CVSSCM.java
  6. +2 −2 src/main/java/hudson/scm/CvsModuleLocation.java
  7. +7 −10 src/main/java/hudson/scm/CvsProjectset.java
  8. +1 −1 src/main/java/hudson/scm/CvsRepository.java
  9. +3 −3 src/main/java/hudson/scm/CvsRepositoryItem.java
  10. +3 −3 src/main/java/hudson/scm/CvsRepositoryLocation.java
  11. +5 −8 src/main/java/hudson/scm/CvsTagsParamDefinition.java
  12. +1 −1 src/main/java/hudson/scm/LegacyConvertor.java
  13. +2 −2 src/main/java/hudson/scm/browsers/CvsFacadeRepositoryBrowser.java
  14. +2 −2 src/main/java/hudson/scm/browsers/FishEyeCVS.java
  15. +2 −1 src/main/java/hudson/scm/cvstagging/CvsTagAction.java
  16. +3 −2 src/main/java/hudson/scm/cvstagging/LegacyTagAction.java
  17. +2 −1 src/main/resources/hudson/scm/CVSChangeLogSet/digest.jelly
  18. +2 −1 src/main/resources/hudson/scm/CVSChangeLogSet/index.jelly
  19. +1 −1 src/main/resources/hudson/scm/CVSSCM/config.jelly
  20. +1 −1 src/main/resources/hudson/scm/CVSSCM/global.jelly
  21. +1 −0 src/main/resources/hudson/scm/CvsModule/config.jelly
  22. +1 −0 src/main/resources/hudson/scm/CvsProjectset/config.jelly
  23. +1 −0 src/main/resources/hudson/scm/CvsRepository/config.jelly
  24. +1 −1 src/main/resources/hudson/scm/CvsRepositoryItem/config.jelly
  25. +1 −0 src/main/resources/hudson/scm/CvsRepositoryLocation/BranchRepositoryLocation/config.jelly
  26. +1 −0 src/main/resources/hudson/scm/CvsRepositoryLocation/HeadRepositoryLocation/config.jelly
  27. +1 −0 src/main/resources/hudson/scm/CvsRepositoryLocation/TagRepositoryLocation/config.jelly
  28. +1 −0 src/main/resources/hudson/scm/CvsTagsParamDefinition/config.jelly
  29. +1 −0 src/main/resources/hudson/scm/CvsTagsParamDefinition/index.jelly
  30. +1 −0 src/main/resources/hudson/scm/CvsTagsParamValue/value.jelly
  31. +1 −0 src/main/resources/hudson/scm/ExcludedRegion/config.jelly
  32. +1 −0 src/main/resources/hudson/scm/browsers/FishEyeCVS/config.jelly
  33. +1 −0 src/main/resources/hudson/scm/browsers/OpenGrok/config.jelly
  34. +1 −0 src/main/resources/hudson/scm/browsers/ViewCVS/config.jelly
  35. +1 −0 src/main/resources/hudson/scm/cvstagging/CvsTagAction/tagForm.jelly
  36. +1 −0 src/main/resources/hudson/scm/cvstagging/LegacyTagAction/tagForm.jelly
  37. +1 −0 src/main/resources/index.jelly
  38. +27 −34 src/test/java/hudson/scm/IntegrationTest.java
@@ -0,0 +1,2 @@
// Build the plugin using https://github.com/jenkins-infra/pipeline-library
buildPlugin(jenkinsVersions: [null, '2.107'])
62 pom.xml
@@ -4,15 +4,24 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.607</version>
<version>3.5</version>
<relativePath />
</parent>

<artifactId>cvs</artifactId>
<version>2.14-SNAPSHOT</version>
<packaging>hpi</packaging>

<name>Jenkins CVS Plug-in</name>
<url>http://wiki.jenkins-ci.org/display/JENKINS/CVS+Plugin</url>
<url>https://wiki.jenkins.io/display/JENKINS/CVS+Plugin</url>

<properties>
<jenkins.version>1.625.3</jenkins.version>
<java.level>7</java.level>
<!-- TODO: Enable once FindBugs issues are fixed -->
<findbugs.failOnError>false</findbugs.failOnError>
</properties>


<developers>
<developer>
@@ -25,14 +34,6 @@
</developer>
</developers>


<distributionManagement>
<repository>
<id>maven.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/releases</url>
</repository>
</distributionManagement>

<scm>
<connection>scm:git:https://github.com/jenkinsci/cvs-plugin.git</connection>
<developerConnection>scm:git:https://github.com/jenkinsci/cvs-plugin.git</developerConnection>
@@ -46,52 +47,27 @@
<artifactId>cvsclient</artifactId>
<version>71-jenkins-11</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>subversion</artifactId>
<groupId>org.jvnet.hudson.plugins</groupId>
</exclusion>
</exclusions>

<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.9</version>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.outputEncoding>UTF-8</project.build.outputEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>


<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
</project>
@@ -36,10 +36,10 @@
import hudson.remoting.VirtualChannel;
import hudson.scm.cvstagging.CvsTagAction;
import hudson.util.Secret;
import jenkins.MasterToSlaveFileCallable;
import jenkins.scm.cvs.QuietPeriodCompleted;

import org.apache.commons.io.output.DeferredFileOutputStream;
import org.jenkinsci.remoting.RoleChecker;
import org.netbeans.lib.cvsclient.CVSRoot;
import org.netbeans.lib.cvsclient.Client;
import org.netbeans.lib.cvsclient.admin.AdminHandler;
@@ -254,7 +254,7 @@ private boolean perform(final Command cvsCommand, final FilePath workspace, fina
final GlobalOptions globalOptions = getGlobalOptions(repository, envVars);


if (!workspace.act(new FilePath.FileCallable<Boolean>() {
if (!workspace.act(new MasterToSlaveFileCallable<Boolean>() {

private static final long serialVersionUID = -7517978923721181408L;

@@ -307,11 +307,6 @@ public Boolean invoke(final File workspace, final VirtualChannel channel) throws
}
}

@Override
public void checkRoles(RoleChecker checker)
throws SecurityException {
// Do nothing
}
})) {
listener.error("Cvs task failed");
return false;
@@ -472,7 +467,7 @@ public boolean isDisableCvsQuiet() {
* (so we can get the current workspace state), this method should never be
* called. Just for safety, we get the action and return it.
*
* @see {@link SCM#calcRevisionsFromBuild(hudson.model.AbstractBuild, hudson.Launcher, TaskListener)}
* @see SCM#calcRevisionsFromBuild(hudson.model.AbstractBuild, hudson.Launcher, TaskListener)
*/
@Override
public SCMRevisionState calcRevisionsFromBuild(final AbstractBuild<?, ?> build, final Launcher launcher,
@@ -690,17 +685,11 @@ private CvsChangeSet getRemoteLogForModule(final CvsRepository repository, final
return executeRlog(cvsClient, rlogCommand, listener, encoding, globalOptions, repository, envVars, item.getLocation());
}
else {
return workspace.act(new FilePath.FileCallable<CvsChangeSet>() {
return workspace.act(new MasterToSlaveFileCallable<CvsChangeSet>() {
@Override
public CvsChangeSet invoke(File file, VirtualChannel virtualChannel) throws IOException, InterruptedException {
return executeRlog(cvsClient, rlogCommand, listener, encoding, globalOptions, repository, envVars, item.getLocation());
}

@Override
public void checkRoles(RoleChecker checker)
throws SecurityException {
// Do nothing
}
});
}

@@ -852,7 +841,7 @@ protected void postCheckout(Run<?, ?> build, File changelogFile, CvsRepository[]
for (final CvsRepositoryItem repositoryItem : repository.getRepositoryItems()) {
for (final CvsModule module : repositoryItem.getModules()) {
FilePath target = (flatten ? workspace : workspace.child(module.getCheckoutName()));
target.act(new FilePath.FileCallable<Void>() {
target.act(new MasterToSlaveFileCallable<Void>() {
@Override
public Void invoke(File module, VirtualChannel virtualChannel) throws IOException, InterruptedException {
final AdminHandler adminHandler = new StandardAdminHandler();
@@ -862,12 +851,6 @@ public Void invoke(File module, VirtualChannel virtualChannel) throws IOExceptio
return null;
}

@Override
public void checkRoles(RoleChecker checker)
throws SecurityException {
// Do nothing
}

private void cleanup(File directory, AdminHandler adminHandler) throws IOException {
for (File file : adminHandler.getAllFiles(directory)) {
Entry entry = adminHandler.getEntry(file);
@@ -974,7 +957,7 @@ public static boolean isSymLink(File file, final TaskListener listener) {
targetWorkspace = workspace.child(envVars.expand(module.getCheckoutName()));
}

return targetWorkspace.act(new FilePath.FileCallable<List<CvsFile>>() {
return targetWorkspace.act(new MasterToSlaveFileCallable<List<CvsFile>>() {

private static final long serialVersionUID = 8158155902777163137L;

@@ -990,12 +973,6 @@ public static boolean isSymLink(File file, final TaskListener listener) {
return buildFileList(moduleLocation, envVars.expand(module.getRemoteName()));
}

@Override
public void checkRoles(RoleChecker checker)
throws SecurityException {
// Do nothing
}

public List<CvsFile> buildFileList(final File moduleLocation, final String prefix) throws IOException {
AdminHandler adminHandler = new StandardAdminHandler();
List<CvsFile> fileList = new ArrayList<CvsFile>();

0 comments on commit b06434d

Please sign in to comment.
You can’t perform that action at this time.