Skip to content

Commit cc2f9db

Browse files
committed
Added strategyId to @DataBoundConstructor on ProjectNamingStrategyTrait
1 parent 41fde82 commit cc2f9db

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ you require the following plugins:
1717
* `io.jenkins.plugins.gitlabserverconfig` - Manages server configuration and web hooks management. Ideally should reside inside another plugin with name `GitLab Plugin`. In future, this package will be moved into a new plugin.
1818

1919
* `io.jenkins.plugins.gitlabbranchsource` - Adds GitLab Branch Source for Multi-branch Pipeline Jobs (including
20-
Merge Requests) and Folder organisation.
20+
Merge Requests) and Folder organization.
2121

2222
## Getting Started
2323

@@ -365,7 +365,7 @@ See handling secrets [section](https://github.com/jenkinsci/configuration-as-cod
365365
GitLab Branch Source Plugin allows you to create 2 type of jobs:
366366
367367
* `Multibranch Pipeline Jobs` - For single project.
368-
* `Folder Organisation` - For multiple projects inside a owner (user/group/subgroup).
368+
* `Folder Organization` - For multiple projects inside a owner (user/group/subgroup).
369369
370370
### Multibranch Pipeline Jobs
371371
@@ -748,7 +748,7 @@ GITLAB_CHANGES_UPDATED_AT_CURR
748748
749749
To create a Job DSL seed job see this [tutorial](https://github.com/jenkinsci/job-dsl-plugin/wiki/Tutorial---Using-the-Jenkins-Job-DSL).
750750
751-
Here is a sample seed job script for folder organisation job:
751+
Here is a sample seed job script for folder organization job:
752752
753753
```groovy
754754
organizationFolder('GitLab Organization Folder') {

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<jcasc.version>1.36</jcasc.version>
2020
</properties>
2121
<name>GitLab Branch Source Plugin</name>
22-
<description>GitLab Provides branch source and folder organisation functionality for GitLab
22+
<description>GitLab Provides branch source and folder organization functionality for GitLab
2323
Repositories in Jenkins Source Plugin
2424
</description>
2525
<licenses>

src/main/java/io/jenkins/plugins/gitlabbranchsource/ProjectNamingStrategyTrait.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public class ProjectNamingStrategyTrait extends SCMNavigatorTrait {
1818
private int strategyId = 1;
1919

2020
@DataBoundConstructor
21-
public ProjectNamingStrategyTrait() {
22-
// empty
21+
public ProjectNamingStrategyTrait(int strategyId) {
22+
this.strategyId = strategyId;
2323
}
2424

2525
public int getStrategyId() {
@@ -38,7 +38,7 @@ public void setStrategyId(int strategyId) {
3838
protected void decorateContext(SCMNavigatorContext<?, ?> context) {
3939
if (context instanceof GitLabSCMNavigatorContext) {
4040
GitLabSCMNavigatorContext ctx = (GitLabSCMNavigatorContext) context;
41-
ctx.withProjectNamingStrategy(strategyId);
41+
ctx.withProjectNamingStrategy(getStrategyId());
4242
}
4343
}
4444

src/main/java/io/jenkins/plugins/gitlabbranchsource/helpers/GitLabPipelineStatusNotifier.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,26 +256,23 @@ private static void sendNotifications(Run<?, ?> build, TaskListener listener) {
256256
status.setTargetUrl(url);
257257

258258
if (Result.SUCCESS.equals(result)) {
259-
status.setDescription(build.getParent().getFullName() + ": This commit looks good");
259+
status.setDescription(build.toString() + ": This commit looks good.");
260260
status.setStatus("SUCCESS");
261261
state = Constants.CommitBuildState.SUCCESS;
262262
} else if (Result.UNSTABLE.equals(result)) {
263-
status.setDescription(
264-
build.getParent().getFullName() + ": This commit has test failures");
263+
status.setDescription(build.toString() + ": This commit is unstable with partial failure.");
265264
status.setStatus("FAILED");
266265
state = Constants.CommitBuildState.FAILED;
267266
} else if (Result.FAILURE.equals(result)) {
268-
status.setDescription(
269-
build.getParent().getFullName() + ": There was a failure building this commit");
267+
status.setDescription(build.toString() + ": There was a failure building this commit.");
270268
status.setStatus("FAILED");
271269
state = Constants.CommitBuildState.FAILED;
272270
} else if (result != null) { // ABORTED, NOT_BUILT.
273-
status.setDescription(build.getParent().getFullName()
274-
+ ": Something is wrong with the build of this commit");
271+
status.setDescription(build.toString() + ": Something is wrong with the build of this commit.");
275272
status.setStatus("CANCELED");
276273
state = Constants.CommitBuildState.CANCELED;
277274
} else {
278-
status.setDescription(build.getParent().getFullName() + ": Build started...");
275+
status.setDescription(build.toString() + ": Build started...");
279276
status.setStatus("RUNNING");
280277
state = Constants.CommitBuildState.RUNNING;
281278
}

src/main/resources/index.jelly

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?jelly escape-by-default='true'?>
22
<div>
3-
Provides branch source and folder organisation functionality for GitLab Repositories in Jenkins
3+
Provides branch source and folder organization functionality for GitLab Repositories in Jenkins
44
</div>

0 commit comments

Comments
 (0)