Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JENKINS-47948 Delete deprecated api classes with Object #53

Merged
merged 1 commit into from Nov 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/pages/general/release_notes.md
Expand Up @@ -7,7 +7,8 @@ sidebar: jira_sidebar
permalink: release_notes.html
---
* ## **1.3.0** (Unreleased)
*
* [JENKINS-47948]() Delete deprecated api classes with Object.
* <span style="color:red">Note: EditVersion and EditComponent are updated to support all the JIRA Versions, which would break existing code. Please refer the appropriate steps guides for the new Syntax.</span>.
* ## **1.2.5**
* [JENKINS-47914](https://issues.jenkins-ci.org/browse/JENKINS-47914) Use Jenkins user id instead of user name as buildUser.
* ## **1.2.4**
Expand Down
16 changes: 7 additions & 9 deletions docs/pages/steps/jira_edit_component.md
Expand Up @@ -16,6 +16,7 @@ Note: Sometimes it may not possible to directly edit component (rename it) witho

## Input

* **id** - component id. (Note: Applicable only from version 1.3.0)
* **component** - component to be edited.
* **site** - Optional, default: `JIRA_SITE` environment variable.
* **failOnError** - Optional. default: `true`.
Expand All @@ -39,11 +40,10 @@ Note: response.data returns all the fields returned by JIRA API.
```groovy
node {
stage('JIRA') {
def testComponent = [ id: "1000",
name: "test-component",
def testComponent = [ name: "test-component",
description: "desc",
project: "TEST" ]
jiraEditComponent component: testComponent
jiraEditComponent id:'1000', component: testComponent
}
}
```
Expand All @@ -53,23 +53,21 @@ Note: response.data returns all the fields returned by JIRA API.
node {
stage('JIRA') {
withEnv(['JIRA_SITE=LOCAL']) {
def testComponent = [ id: "1000",
name: "test-component",
def testComponent = [ name: "test-component",
description: "desc",
project: "TEST" ]
jiraEditComponent component: testComponent
jiraEditComponent id: '1000', component: testComponent
}
}
}
```
* Without environment variables.

```groovy
def testComponent = [ id: "1000",
name: "test-component",
def testComponent = [ name: "test-component",
description: "desc",
project: "TEST" ]
jiraEditComponent site: "LOCAL", component: testComponent
jiraEditComponent id: '1000', site: "LOCAL", component: testComponent
```

{% include links.html %}
16 changes: 7 additions & 9 deletions docs/pages/steps/jira_edit_version.md
Expand Up @@ -18,6 +18,7 @@ TODO: probably we should try move version

## Input

* **id** - version id. (Note: Applicable only from version 1.3.0)
* **version** - version to be edited.
* **site** - Optional, default: `JIRA_SITE` environment variable.
* **failOnError** - Optional. default: `true`.
Expand All @@ -41,13 +42,12 @@ Note: response.data returns all the fields returned by JIRA API.
```groovy
node {
stage('JIRA') {
def testVersion = [ id: '1000',
name: 'test-version',
def testVersion = [ name: 'test-version',
archived: true,
released: true,
description: 'desc',
project: 'TEST' ]
jiraEditVersion version: testVersion
jiraEditVersion id: '1000', version: testVersion
}
}
```
Expand All @@ -57,27 +57,25 @@ Note: response.data returns all the fields returned by JIRA API.
node {
stage('JIRA') {
withEnv(['JIRA_SITE=LOCAL']) {
def testVersion = [ id: '1000',
name: 'test-version',
def testVersion = [ name: 'test-version',
archived: true,
released: true,
description: 'desc',
project: 'TEST' ]
jiraEditVersion version: testVersion
jiraEditVersion id: '1000', version: testVersion
}
}
}
```
* Without environment variables.

```groovy
def testVersion = [ id: '1000',
name: 'test-version',
def testVersion = [ name: 'test-version',
archived: true,
released: true,
description: 'desc',
project: 'TEST' ]
jiraEditVersion version: testVersion, site: 'LOCAL'
jiraEditVersion id: '1000', version: testVersion, site: 'LOCAL'
```

{% include links.html %}
32 changes: 32 additions & 0 deletions pom.xml
Expand Up @@ -181,7 +181,39 @@
<version>${assertj-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.12</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<goals>
<goal>addSources</goal>
<goal>addTestSources</goal>
<goal>generateStubs</goal>
<goal>compile</goal>
<goal>generateTestStubs</goal>
<goal>compileTests</goal>
<goal>removeStubs</goal>
<goal>removeTestStubs</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>doclint-java8-disable</id>
Expand Down
@@ -0,0 +1,10 @@
package org.thoughtslive.jenkins.plugins.jira.api

class InputBuilder {

static appendDescription(object, description) {
if(object.description) {
return object.description += description
}
}
}
@@ -1,7 +1,5 @@
package org.thoughtslive.jenkins.plugins.jira.service

import org.thoughtslive.jenkins.plugins.jira.api.Component;
import org.thoughtslive.jenkins.plugins.jira.api.Version;
import org.thoughtslive.jenkins.plugins.jira.Site;


Expand All @@ -24,14 +22,14 @@ class JiraServiceIT {

println service.updateComment('TEST-27', '10604', 'changing it to something else again').code

def component = Component.builder().id('10100').name('test-comp').build()
def component = [id: '10100', name: 'test-comp']
println service.updateComponent(component).code

def issue = [fields: [summary: 'newSummary001',
customfield_10000: 'Testing']]
println service.updateIssue('TEST-27', issue).error

def version = Version.builder().id('10300').name('testingT').build()
def version = [id: '10300', name: 'testingT']
println service.updateVersion('10300', version).code

println service.getComments('TEST-27').code
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.