Skip to content

Commit d03cdd0

Browse files
authored
Merge pull request #9 from cortexapps/CET-18547-Reduce-number-of-bitbucket-requests-for-bitbucket
CET-18547 Includes closedDate into PullRequest object to avoid additi…
2 parents 7a0d91d + 51bd312 commit d03cdd0

File tree

3 files changed

+41
-36
lines changed

3 files changed

+41
-36
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group = io.github.cdancy
2-
version = 3.1.2-CORTEX
2+
version = 3.1.3-CORTEX
33

44
artifactoryURL = http://127.0.0.1:8080/artifactory
55
artifactoryUser = admin

src/main/java/com/cdancy/bitbucket/rest/domain/pullrequest/PullRequest.java

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public abstract class PullRequest implements ErrorsHolder, LinksHolder {
5050

5151
public abstract boolean closed();
5252

53+
@Nullable
54+
public abstract Long closedDate();
55+
5356
public abstract long createdDate();
5457

5558
public abstract long updatedDate();
@@ -75,47 +78,49 @@ public abstract class PullRequest implements ErrorsHolder, LinksHolder {
7578
PullRequest() {
7679
}
7780

78-
@SerializedNames({ "id", "version", "title", "description",
79-
"state", "open", "closed", "createdDate",
80-
"updatedDate", "fromRef", "toRef", "locked",
81-
"author", "reviewers", "participants", "properties",
81+
@SerializedNames({ "id", "version", "title", "description",
82+
"state", "open", "closed", "closedDate", "createdDate",
83+
"updatedDate", "fromRef", "toRef", "locked",
84+
"author", "reviewers", "participants", "properties",
8285
"links", "errors" })
83-
public static PullRequest create(final int id,
84-
final int version,
85-
final String title,
86-
final String description,
87-
final String state,
86+
public static PullRequest create(final int id,
87+
final int version,
88+
final String title,
89+
final String description,
90+
final String state,
8891
final boolean open,
89-
final boolean closed,
90-
final long createdDate,
91-
final long updatedDate,
92+
final boolean closed,
93+
final Long closedDate,
94+
final long createdDate,
95+
final long updatedDate,
9296
final Reference fromRef,
93-
final Reference toRef,
94-
final boolean locked,
95-
final Person author,
97+
final Reference toRef,
98+
final boolean locked,
99+
final Person author,
96100
final List<Person> reviewers,
97-
final List<Person> participants,
98-
final Properties properties,
101+
final List<Person> participants,
102+
final Properties properties,
99103
final Links links,
100104
final List<Error> errors) {
101-
102-
return new AutoValue_PullRequest(BitbucketUtils.nullToEmpty(errors),
103-
links,
104-
id,
105-
version,
106-
title,
107-
description,
108-
state,
109-
open,
110-
closed,
105+
106+
return new AutoValue_PullRequest(BitbucketUtils.nullToEmpty(errors),
107+
links,
108+
id,
109+
version,
110+
title,
111+
description,
112+
state,
113+
open,
114+
closed,
115+
closedDate,
111116
createdDate,
112-
updatedDate,
113-
fromRef,
114-
toRef,
115-
locked,
116-
author,
117-
BitbucketUtils.nullToEmpty(reviewers),
118-
BitbucketUtils.nullToEmpty(participants),
117+
updatedDate,
118+
fromRef,
119+
toRef,
120+
locked,
121+
author,
122+
BitbucketUtils.nullToEmpty(reviewers),
123+
BitbucketUtils.nullToEmpty(participants),
119124
properties);
120125
}
121126
}

src/main/java/com/cdancy/bitbucket/rest/fallbacks/BitbucketFallbacks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ public static ProjectPage createProjectPageFromErrors(final List<Error> errors)
783783

784784
public static PullRequest createPullRequestFromErrors(final List<Error> errors) {
785785
return PullRequest.create(-1, -1, null, null, null,
786-
false, false, 0, 0, null,
786+
false, false, null, 0, 0, null,
787787
null, false, null, null, null,
788788
null, null, errors);
789789
}

0 commit comments

Comments
 (0)