Skip to content

Commit 72cb133

Browse files
Merge pull request #35 from jenkinsci/version_downgrade
Jenkins version downgrade changes and codeql alert fix
2 parents 188f9bf + 491976b commit 72cb133

File tree

13 files changed

+50
-27
lines changed

13 files changed

+50
-27
lines changed

pom.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
34
<modelVersion>4.0.0</modelVersion>
45
<parent>
56
<groupId>org.jenkins-ci.plugins</groupId>
67
<artifactId>plugin</artifactId>
7-
<version>4.62</version>
8+
<version>4.50</version>
89
<relativePath />
910
</parent>
1011
<groupId>org.jenkins-ci.plugins</groupId>
1112
<artifactId>delphix</artifactId>
12-
<version>3.0.4-SNAPSHOT</version>
13+
<version>3.1.0-SNAPSHOT</version>
1314
<packaging>hpi</packaging>
1415
<properties>
15-
<jenkins.version>2.361.4</jenkins.version>
16+
<jenkins.version>2.346.1</jenkins.version>
1617
<hpi.compatibleSinceVersion>3.0.0</hpi.compatibleSinceVersion>
1718
</properties>
1819

@@ -48,8 +49,8 @@
4849
<dependency>
4950
<!-- Pick up common dependencies for the selected LTS line: https://github.com/jenkinsci/bom#usage -->
5051
<groupId>io.jenkins.tools.bom</groupId>
51-
<artifactId>bom-2.361.x</artifactId>
52-
<version>2062.v154408a_24d20</version>
52+
<artifactId>bom-2.346.x</artifactId>
53+
<version>1409.v7659b_c072f18</version>
5354
<type>pom</type>
5455
<scope>import</scope>
5556
</dependency>

src/main/java/io/jenkins/plugins/constant/Constant.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class Constant {
66
public static final String UNIQUE_FILE_NAME = "delphix-VDB-";
77
public static final String PROPERTIES = ".properties";
88
public static final String FILE_NAME = "delphix-VDB";
9-
public static final String USER_AGENT = "Jenkins-3.0.0";
9+
public static final String USER_AGENT = "Jenkins-3.1.0";
1010
public static final String CLIENT_NAME = "Jenkins";
1111
public static final String CLIENT_NAME_HEADER = "x-dct-client-name";
1212
public static final long WAIT_TIME = 20000;

src/main/java/io/jenkins/plugins/delphix/DeleteVDB.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,35 +92,35 @@ public void perform(Run<?, ?> run, FilePath workspace, EnvVars env, Launcher lau
9292
helper.getFileList(Paths.get(workspace.toURI()), Constant.FILE_PATTERN);
9393

9494
for (String file : fileList) {
95-
DelphixProperties x = new DelphixProperties(workspace, file, listener);
96-
String vdbId = x.getVDB();
97-
listener.getLogger().println(Messages.Delete_Message2(vdbId, file));
98-
deleteVDB(run, vdbId, listener, dctSdkUtil, helper);
95+
DelphixProperties delphixProperties = new DelphixProperties(workspace, file, listener);
96+
String vdbIdFromFile = delphixProperties.getVDB();
97+
listener.getLogger().println(Messages.Delete_Message2(vdbIdFromFile, file));
98+
deleteVDB(run, vdbIdFromFile, listener, dctSdkUtil);
9999
}
100100
}
101101
else if (vdbId != null) {
102102
List<String> vdbList = Arrays.asList(vdbId.split(","));
103103
for (String vdb : vdbList) {
104104
listener.getLogger().println(Messages.Delete_Message3(vdb));
105-
deleteVDB(run, vdb, listener, dctSdkUtil, helper);
105+
deleteVDB(run, vdb, listener, dctSdkUtil);
106106
}
107107
}
108108
else if (name != null) {
109109
List<String> nameList = Arrays.asList(name.split(","));
110-
for (String name : nameList) {
111-
listener.getLogger().println(Messages.Delete_Message5(name));
112-
SearchVDBsResponse result = dctSdkUtil.searchVDB(name);
110+
for (String vdbname : nameList) {
111+
listener.getLogger().println(Messages.Delete_Message5(vdbname));
112+
SearchVDBsResponse result = dctSdkUtil.searchVDB(vdbname);
113113
if (result.getItems().size() == 0) {
114-
listener.getLogger().println(Messages.Delete_Error3(name));
114+
listener.getLogger().println(Messages.Delete_Error3(vdbname));
115115
run.setResult(Result.FAILURE);
116116
}
117117
else if (result.getItems().size() > 1) {
118-
listener.getLogger().println(Messages.Delete_Error2(name));
118+
listener.getLogger().println(Messages.Delete_Error2(vdbname));
119119
run.setResult(Result.FAILURE);
120120
}
121121
else {
122122
VDB vdb = result.getItems().get(0);
123-
deleteVDB(run, vdb.getId(), listener, dctSdkUtil, helper);
123+
deleteVDB(run, vdb.getId(), listener, dctSdkUtil);
124124
}
125125
}
126126
}
@@ -145,14 +145,14 @@ else if (result.getItems().size() > 1) {
145145
}
146146

147147
private void deleteVDB(Run<?, ?> run, String vdbId, TaskListener listener,
148-
DctSdkUtil dctSdkUtil, Helper helper) throws ApiException, Exception {
148+
DctSdkUtil dctSdkUtil) throws ApiException, Exception {
149149
DeleteVDBResponse rs = dctSdkUtil.deleteVdb(vdbId, force);
150150
Job job = rs.getJob();
151151
if (job != null) {
152152
listener.getLogger().println(Messages.Delete_Message4(job.getId()));
153153
if (!skipPolling) {
154154
JobHelper jh = new JobHelper(dctSdkUtil, listener, job.getId());
155-
boolean jobStatus = jh.waitForPolling(dctSdkUtil.getDefaultClient(), run);
155+
boolean jobStatus = jh.waitForPolling( run);
156156
if (jobStatus) {
157157
listener.getLogger().println(Messages.Delete_Fail());
158158
}

src/main/java/io/jenkins/plugins/delphix/ProvisionVDBFromBookmark.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ public void perform(Run<?, ?> run, FilePath workspace, EnvVars env, Launcher lau
136136
JobHelper jobHelper = new JobHelper(dctSdkUtil, listener, job.getId());
137137
boolean status = false;
138138
if (skipPolling) {
139-
status = jobHelper.waitForGetVDB(dctSdkUtil.getDefaultClient(), run,
139+
status = jobHelper.waitForGetVDB( run,
140140
provisionResponse.getVdbId());
141141
}
142142
else {
143-
status = jobHelper.waitForPolling(dctSdkUtil.getDefaultClient(), run);
143+
status = jobHelper.waitForPolling( run);
144144
}
145145
if (status) {
146146
listener.getLogger().println(Messages.ProvisionVDB_Fail());

src/main/java/io/jenkins/plugins/delphix/ProvisionVDBFromSnapshot.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ public void perform(Run<?, ?> run, FilePath workspace, EnvVars env, Launcher lau
132132
JobHelper jobHelper = new JobHelper(dctSdkUtil, listener, job.getId());
133133
boolean status = false;
134134
if (skipPolling) {
135-
status = jobHelper.waitForGetVDB(dctSdkUtil.getDefaultClient(), run,
135+
status = jobHelper.waitForGetVDB( run,
136136
provisionResponse.getVdbId());
137137
}
138138
else {
139-
status = jobHelper.waitForPolling(dctSdkUtil.getDefaultClient(), run);
139+
status = jobHelper.waitForPolling( run);
140140
}
141141
if (status) {
142142
listener.getLogger().println(Messages.ProvisionVDB_Fail());

src/main/java/io/jenkins/plugins/delphix/Tags.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public DescriptorImpl getDescriptor() {
3535
*/
3636
@Extension
3737
public static class DescriptorImpl extends Descriptor<Tags> {
38+
@Override
3839
public String getDisplayName() {
3940
return "";
4041
}

src/main/java/io/jenkins/plugins/job/JobHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public JobHelper(DctSdkUtil dctSdkUtil, TaskListener listener, String jobId) {
2323
this.dctSdkUtil = dctSdkUtil;
2424
}
2525

26-
public boolean waitForPolling(ApiClient defaultClient, Run<?, ?> run)
26+
public boolean waitForPolling(Run<?, ?> run)
2727
throws ApiException, Exception {
2828
this.listener.getLogger().println(Messages.Poll_Wait());
2929
boolean completed = false;
@@ -65,7 +65,7 @@ public boolean waitForPolling(ApiClient defaultClient, Run<?, ?> run)
6565
return fail;
6666
}
6767

68-
public boolean waitForGetVDB(ApiClient defaultClient, Run<?, ?> run, String vdbId)
68+
public boolean waitForGetVDB(Run<?, ?> run, String vdbId)
6969
throws InterruptedException {
7070
this.listener.getLogger().println(Messages.Vdb_Get());
7171
boolean completed = false;

src/main/java/io/jenkins/plugins/properties/DelphixProperties.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ private String read(String key) {
4444

4545
private void writeMap(Map<String, Object> vdbDetails) {
4646
try {
47-
this.file.createNewFile();
47+
// boolean fileCreated = this.file.createNewFile();
48+
if (this.file.createNewFile())
49+
this.listener.getLogger().print("Properties file created");
50+
else
51+
this.listener.getLogger().print("Properties file already exists");
4852
}
4953
catch (IOException e) {
5054
this.listener.getLogger().print(e.getMessage());
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div>
2+
(Optional) The name of the database on the target environment. If left empty, the Database Name will default to the
3+
value provided in the Name parameter.
4+
</div>

src/main/webapp/help-engineId.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div>
2+
(Optional) The ID or name of the Engine onto which to provision. If the source ID unambiguously identifies a source
3+
object, this parameter is unnecessary and ignored.
4+
</div>

0 commit comments

Comments
 (0)