Skip to content

Commit b8b546a

Browse files
authored
Merge branch 'master' into JENKINS-53705
2 parents dfa8ed4 + 91fd65d commit b8b546a

19 files changed

+100
-147
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
## Changelog
22

3+
### 2.22
4+
5+
Release date: 2020-08-03
6+
7+
- Improvement: Add `durabilityHint` symbol to `DurabilityHintBranchProperty` for use in data binding ([PR 97](https://github.com/jenkinsci/workflow-multibranch-plugin/pull/97))
8+
- Improvement: Add French localization ([PR 95](https://github.com/jenkinsci/workflow-multibranch-plugin/pull/95))
9+
- Internal: Update minimum required Jenkins version to 2.176.4, update parent POM, and update dependencies ([PR 100](https://github.com/jenkinsci/workflow-multibranch-plugin/pull/100), [PR 92](https://github.com/jenkinsci/workflow-multibranch-plugin/pull/92))
10+
- Internal: Migrate documentation from wiki to plugins.jenkins.io ([PR 93](https://github.com/jenkinsci/workflow-multibranch-plugin/pull/93))
11+
- Internal: Miscellaneous code cleanup (use try-with-resources, remove redundant casts, use NIO, use type inference, etc.) ([PR 89](https://github.com/jenkinsci/workflow-multibranch-plugin/pull/89))
12+
- Internal: Update `workflow-scm-step` dependency past 2.6 to fix PCT issues ([PR 86](https://github.com/jenkinsci/workflow-multibranch-plugin/pull/86))
13+
- Internal: Replace usage of deprecated APIs with nondeprecated equivalents ([PR 85](https://github.com/jenkinsci/workflow-multibranch-plugin/pull/85))
14+
- Internal: Use the Groovy sandbox consistently in tests ([PR 84](https://github.com/jenkinsci/workflow-multibranch-plugin/pull/84))
15+
316
### 2.21
417

5-
Release date: 2019-03-07
18+
Release date: 2019-03-07
619

720
- [JENKINS-43194](https://issues.jenkins-ci.org/browse/JENKINS-43194) - Make SCMBinder try to abort builds in which Jenkinsfile has been modified by an untrusted contributor ([PR #69](https://github.com/jenkinsci/workflow-multibranch-plugin/pull/69))
821
- Migrate Chinese localization to another plugin ([PR #80](https://github.com/jenkinsci/workflow-multibranch-plugin/pull/80))

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
buildPlugin()
1+
buildPlugin(useAci: true)

pom.xml

Lines changed: 19 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ THE SOFTWARE.
2828
<parent>
2929
<groupId>org.jenkins-ci.plugins</groupId>
3030
<artifactId>plugin</artifactId>
31-
<version>3.54</version>
31+
<version>4.4</version>
3232
<relativePath />
3333
</parent>
3434
<groupId>org.jenkins-ci.plugins.workflow</groupId>
@@ -63,130 +63,115 @@ THE SOFTWARE.
6363
</pluginRepository>
6464
</pluginRepositories>
6565
<properties>
66-
<revision>2.22</revision>
66+
<revision>2.23</revision>
6767
<changelist>-SNAPSHOT</changelist>
6868
<java.level>8</java.level>
69-
<jenkins.version>2.138.4</jenkins.version>
70-
<scm-api.version>2.6.4-20200525.215035-2</scm-api.version>
69+
<jenkins.version>2.176.4</jenkins.version>
7170
<no-test-jar>false</no-test-jar>
72-
<workflow-step-api.version>2.13</workflow-step-api.version>
73-
<workflow-support.version>2.17</workflow-support.version>
74-
<workflow-cps.version>2.53</workflow-cps.version>
75-
<git-plugin.version>3.9.1</git-plugin.version>
71+
<workflow-job-plugin.version>2.39</workflow-job-plugin.version> <!-- TODO: Remove after https://github.com/jenkinsci/bom/pull/264 is released. -->
7672
<subversion-plugin.version>2.13.0</subversion-plugin.version>
7773
</properties>
74+
<dependencyManagement>
75+
<dependencies>
76+
<dependency>
77+
<groupId>io.jenkins.tools.bom</groupId>
78+
<artifactId>bom-2.176.x</artifactId>
79+
<version>11</version>
80+
<scope>import</scope>
81+
<type>pom</type>
82+
</dependency>
83+
</dependencies>
84+
</dependencyManagement>
7885
<dependencies>
7986
<dependency>
8087
<groupId>org.jenkins-ci.plugins.workflow</groupId>
8188
<artifactId>workflow-step-api</artifactId>
82-
<version>${workflow-step-api.version}</version>
8389
</dependency>
8490
<dependency>
8591
<groupId>org.jenkins-ci.plugins.workflow</groupId>
8692
<artifactId>workflow-job</artifactId>
87-
<version>2.21</version>
93+
<version>${workflow-job-plugin.version}</version>
8894
</dependency>
8995
<dependency>
9096
<groupId>org.jenkins-ci.plugins.workflow</groupId>
9197
<artifactId>workflow-support</artifactId>
92-
<version>${workflow-support.version}</version>
9398
</dependency>
9499
<dependency>
95100
<groupId>org.jenkins-ci.plugins</groupId>
96101
<artifactId>structs</artifactId>
97-
<version>1.17</version>
98102
</dependency>
99103
<dependency>
100104
<groupId>org.jenkins-ci.plugins.workflow</groupId>
101105
<artifactId>workflow-cps</artifactId>
102-
<version>${workflow-cps.version}</version>
103106
</dependency>
104107
<dependency>
105108
<groupId>org.jenkins-ci.plugins</groupId>
106109
<artifactId>scm-api</artifactId>
107-
<version>${scm-api.version}</version>
108110
</dependency>
109111
<dependency>
110112
<groupId>org.jenkins-ci.plugins</groupId>
111113
<artifactId>branch-api</artifactId>
112-
<version>2.0.21</version>
113114
</dependency>
114115
<dependency>
115116
<groupId>org.jenkins-ci.plugins</groupId>
116117
<artifactId>cloudbees-folder</artifactId>
117-
<version>6.1.2</version>
118118
</dependency>
119119
<dependency>
120120
<groupId>org.jenkins-ci.plugins.workflow</groupId>
121121
<artifactId>workflow-api</artifactId>
122-
<version>2.27</version>
123122
</dependency>
124123
<dependency>
125124
<groupId>org.jenkins-ci.plugins.workflow</groupId>
126125
<artifactId>workflow-scm-step</artifactId>
127-
<version>2.7</version>
128126
</dependency>
129127
<dependency>
130128
<groupId>org.jenkins-ci.plugins</groupId>
131129
<artifactId>script-security</artifactId>
132-
<version>1.42</version>
133130
</dependency>
134131
<dependency>
135132
<groupId>org.jenkins-ci.plugins</groupId>
136133
<artifactId>scm-api</artifactId>
137-
<version>${scm-api.version}</version>
134+
<version>2.6.4-20200525.215035-2</version>
138135
<classifier>tests</classifier>
139136
<scope>test</scope>
140137
</dependency>
141138
<dependency>
142139
<groupId>org.jenkins-ci.plugins.workflow</groupId>
143140
<artifactId>workflow-basic-steps</artifactId>
144-
<version>2.3</version>
145141
<scope>test</scope>
146142
</dependency>
147143
<dependency>
148144
<groupId>org.jenkins-ci.plugins.workflow</groupId>
149145
<artifactId>workflow-durable-task-step</artifactId>
150-
<version>2.5</version>
151146
<scope>test</scope>
152147
</dependency>
153148
<dependency>
154149
<groupId>org.jenkins-ci.plugins.workflow</groupId>
155150
<artifactId>workflow-cps-global-lib</artifactId>
156-
<version>2.4</version>
151+
<version>2.17</version> <!-- TODO: Remove after https://github.com/jenkinsci/bom/pull/278 is released. -->
157152
<scope>test</scope>
158-
<exclusions>
159-
<exclusion>
160-
<groupId>org.jenkins-ci.plugins</groupId>
161-
<artifactId>git-client</artifactId>
162-
</exclusion>
163-
</exclusions>
164153
</dependency>
165154
<dependency>
166155
<groupId>org.jenkins-ci.plugins.workflow</groupId>
167156
<artifactId>workflow-step-api</artifactId>
168-
<version>${workflow-step-api.version}</version>
169157
<classifier>tests</classifier>
170158
<scope>test</scope>
171159
</dependency>
172160
<dependency>
173161
<groupId>org.jenkins-ci.plugins.workflow</groupId>
174162
<artifactId>workflow-support</artifactId>
175-
<version>${workflow-support.version}</version>
176163
<classifier>tests</classifier>
177164
<scope>test</scope>
178165
</dependency>
179166
<dependency>
180167
<groupId>org.jenkins-ci.plugins.workflow</groupId>
181168
<artifactId>workflow-cps</artifactId>
182-
<version>${workflow-cps.version}</version>
183169
<classifier>tests</classifier>
184170
<scope>test</scope>
185171
</dependency>
186172
<dependency>
187173
<groupId>org.jenkins-ci.plugins</groupId>
188174
<artifactId>git</artifactId>
189-
<version>${git-plugin.version}</version>
190175
<scope>test</scope>
191176
<exclusions>
192177
<exclusion>
@@ -208,7 +193,6 @@ THE SOFTWARE.
208193
<dependency>
209194
<groupId>org.jenkins-ci.plugins</groupId>
210195
<artifactId>git</artifactId>
211-
<version>${git-plugin.version}</version>
212196
<classifier>tests</classifier>
213197
<scope>test</scope>
214198
<exclusions>
@@ -238,7 +222,7 @@ THE SOFTWARE.
238222
<dependency>
239223
<groupId>org.jenkins-ci.plugins.workflow</groupId>
240224
<artifactId>workflow-job</artifactId>
241-
<version>2.20</version>
225+
<version>${workflow-job-plugin.version}</version>
242226
<classifier>tests</classifier>
243227
<scope>test</scope>
244228
</dependency>
@@ -248,40 +232,19 @@ THE SOFTWARE.
248232
<version>2.2</version>
249233
<scope>test</scope>
250234
</dependency>
251-
<dependency>
252-
<groupId>org.jenkins-ci.modules</groupId>
253-
<artifactId>sshd</artifactId>
254-
<version>2.4</version>
255-
<scope>test</scope><!-- from git-server via workflow-cps-global-lib and otherwise unavailable during tests -->
256-
</dependency>
257-
<dependency>
258-
<groupId>org.jenkins-ci.modules</groupId>
259-
<artifactId>instance-identity</artifactId>
260-
<version>2.2</version>
261-
<scope>test</scope>
262-
</dependency>
263-
<dependency>
264-
<groupId>org.jenkins-ci.modules</groupId>
265-
<artifactId>ssh-cli-auth</artifactId>
266-
<version>1.4</version>
267-
<scope>test</scope>
268-
</dependency>
269235
<dependency>
270236
<groupId>org.jenkins-ci.plugins</groupId>
271237
<artifactId>credentials</artifactId>
272-
<version>2.1.16</version>
273238
<scope>test</scope>
274239
</dependency>
275240
<dependency>
276241
<groupId>org.jenkins-ci.plugins</groupId>
277242
<artifactId>mailer</artifactId>
278-
<version>1.18</version>
279243
<scope>test</scope>
280244
</dependency>
281245
<dependency>
282246
<groupId>org.jenkins-ci.plugins</groupId>
283247
<artifactId>junit</artifactId>
284-
<version>1.6</version>
285248
<scope>test</scope>
286249
</dependency>
287250
</dependencies>

src/main/java/org/jenkinsci/plugins/workflow/multibranch/AbstractWorkflowBranchProjectFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public abstract class AbstractWorkflowBranchProjectFactory extends BranchProject
5050
protected abstract SCMSourceCriteria getSCMSourceCriteria(SCMSource source);
5151

5252
@Override public WorkflowJob newInstance(Branch branch) {
53-
WorkflowJob job = new WorkflowJob((WorkflowMultiBranchProject) getOwner(), branch.getEncodedName());
53+
WorkflowJob job = new WorkflowJob(getOwner(), branch.getEncodedName());
5454
setBranch(job, branch);
5555
return job;
5656
}

src/main/java/org/jenkinsci/plugins/workflow/multibranch/DurabilityHintBranchProperty.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.jenkinsci.plugins.workflow.flow.FlowDurabilityHint;
1515
import org.jenkinsci.plugins.workflow.flow.GlobalDefaultFlowDurabilityLevel;
1616
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
17+
import org.jenkinsci.plugins.workflow.job.properties.DurabilityHintJobProperty;
1718
import org.jenkinsci.Symbol;
1819
import org.kohsuke.accmod.Restricted;
1920
import org.kohsuke.accmod.restrictions.NoExternalUse;
@@ -68,21 +69,22 @@ public static FlowDurabilityHint getDefaultDurabilityHint() {
6869
return GlobalDefaultFlowDurabilityLevel.getDefaultDurabilityHint();
6970
}
7071

72+
/** Lower ordinal than {@link DurabilityHintJobProperty} so those can override. */
7173
@Override
72-
/** Lower ordinal than {@link org.jenkinsci.plugins.workflow.job.properties.DurabilityHintJobProperty} so those can override. */
7374
public int ordinal() {
7475
return 200;
7576
}
7677

78+
/**
79+
* Dynamically fetch the property with each build, because the {@link BranchPropertyStrategy} does not re-evaluate.
80+
* @see <a href="https://issues.jenkins-ci.org/browse/JENKINS-48826">JENKINS-48826</a>
81+
*/
7782
@CheckForNull
7883
@Override
79-
/**
80-
* Dynamically fetch the property with each build, because the {@link BranchPropertyStrategy} does not re-evaluate,
81-
* resulting in {@see <a href="https://issues.jenkins-ci.org/browse/JENKINS-48826">JENKINS-48826</a>}. */
8284
public FlowDurabilityHint suggestFor(@Nonnull Item x) {
8385
// BranchJobProperty *should* be present if it's a child of a MultiBranchProject but we double-check for safety
8486
if (x instanceof WorkflowJob && x.getParent() instanceof MultiBranchProject && ((WorkflowJob)x).getProperty(BranchJobProperty.class) != null) {
85-
MultiBranchProject mp = (MultiBranchProject)(x.getParent());
87+
MultiBranchProject mp = (MultiBranchProject) x.getParent();
8688
WorkflowJob job = (WorkflowJob)x;
8789
BranchJobProperty bjp = job.getProperty(BranchJobProperty.class);
8890

src/main/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStep.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
package org.jenkinsci.plugins.workflow.multibranch;
2626

27-
import com.google.common.util.concurrent.ListenableFuture;
2827
import hudson.AbortException;
2928
import hudson.BulkChange;
3029
import hudson.Extension;
@@ -56,7 +55,6 @@
5655
import org.jenkinsci.plugins.workflow.graphanalysis.DepthFirstScanner;
5756
import org.jenkinsci.plugins.workflow.graphanalysis.NodeStepTypePredicate;
5857
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
59-
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
6058
import org.jenkinsci.plugins.workflow.steps.AbstractStepDescriptorImpl;
6159
import org.jenkinsci.plugins.workflow.steps.AbstractStepImpl;
6260
import org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution;
@@ -184,7 +182,7 @@ public DescriptorImpl() {
184182
// A modified version of RequestImpl.TypePair.convertJSON.
185183
// Works around the fact that Stapler does not call back into Descriptor.newInstance for nested objects (JENKINS-31458);
186184
// and propertiesMap virtual field name; and null values for unselected properties.
187-
List<JobProperty> properties = new ArrayList<JobProperty>();
185+
List<JobProperty> properties = new ArrayList<>();
188186
ClassLoader cl = req.getStapler().getWebApp().getClassLoader();
189187
@SuppressWarnings("unchecked") Set<Map.Entry<String,Object>> entrySet = formData.getJSONObject("propertiesMap").entrySet();
190188
for (Map.Entry<String,Object> e : entrySet) {
@@ -209,7 +207,7 @@ public DescriptorImpl() {
209207

210208
@Restricted(DoNotUse.class) // f:repeatableHeteroProperty
211209
public Collection<? extends Descriptor<?>> getPropertyDescriptors() {
212-
List<Descriptor<?>> result = new ArrayList<Descriptor<?>>();
210+
List<Descriptor<?>> result = new ArrayList<>();
213211
for (JobPropertyDescriptor p : ExtensionList.lookup(JobPropertyDescriptor.class)) {
214212
if (p.isApplicable(WorkflowJob.class)) {
215213
result.add(p);

0 commit comments

Comments
 (0)