Skip to content

Commit 9244144

Browse files
committed
Fix #829 : Some IDs parameter are still integer instead of long
1 parent b6b9ec4 commit 9244144

File tree

5 files changed

+36
-26
lines changed

5 files changed

+36
-26
lines changed

.github/workflows/ci-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ jobs:
4343
- name: GitLab4j verify
4444
id: gitlab4j-verify
4545
run: |
46-
./mvnw integration-test -B -V -Dmaven.javadoc.skip=true
46+
./mvnw verify -B -V

pom.xml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,6 @@
135135
</executions>
136136
</plugin>
137137

138-
<plugin>
139-
<groupId>org.apache.maven.plugins</groupId>
140-
<artifactId>maven-gpg-plugin</artifactId>
141-
<version>1.6</version>
142-
<executions>
143-
<execution>
144-
<id>sign-artifacts</id>
145-
<phase>verify</phase>
146-
<goals>
147-
<goal>sign</goal>
148-
</goals>
149-
</execution>
150-
</executions>
151-
</plugin>
152-
153138
<plugin>
154139
<groupId>org.apache.maven.plugins</groupId>
155140
<artifactId>maven-source-plugin</artifactId>
@@ -482,4 +467,29 @@
482467
</dependencies>
483468
</dependencyManagement>
484469

470+
<profiles>
471+
<profile>
472+
<id>ossrh</id>
473+
<build>
474+
<plugins>
475+
<plugin>
476+
<groupId>org.apache.maven.plugins</groupId>
477+
<artifactId>maven-gpg-plugin</artifactId>
478+
<version>1.6</version>
479+
<executions>
480+
<execution>
481+
<id>sign-artifacts</id>
482+
<phase>verify</phase>
483+
<goals>
484+
<goal>sign</goal>
485+
</goals>
486+
</execution>
487+
</executions>
488+
</plugin>
489+
</plugins>
490+
</build>
491+
</profile>
492+
493+
</profiles>
494+
485495
</project>

src/main/java/org/gitlab4j/api/JobApi.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public Stream<Job> getJobsStream(Object projectIdOrPath, JobScope scope) throws
139139
* @return a list containing the jobs for the specified project ID and pipeline ID
140140
* @throws GitLabApiException if any exception occurs during execution
141141
*/
142-
public List<Job> getJobsForPipeline(Object projectIdOrPath, int pipelineId) throws GitLabApiException {
142+
public List<Job> getJobsForPipeline(Object projectIdOrPath, long pipelineId) throws GitLabApiException {
143143
Response response = get(Response.Status.OK, getDefaultPerPageParam(),
144144
"projects", getProjectIdOrPath(projectIdOrPath), "pipelines", pipelineId, "jobs");
145145
return (response.readEntity(new GenericType<List<Job>>() {}));
@@ -156,7 +156,7 @@ public List<Job> getJobsForPipeline(Object projectIdOrPath, int pipelineId) thro
156156
* @return a list containing the jobs for the specified project ID and pipeline ID
157157
* @throws GitLabApiException if any exception occurs during execution
158158
*/
159-
public List<Job> getJobsForPipeline(Object projectIdOrPath, int pipelineId, JobScope scope) throws GitLabApiException {
159+
public List<Job> getJobsForPipeline(Object projectIdOrPath, long pipelineId, JobScope scope) throws GitLabApiException {
160160
GitLabApiForm formData = new GitLabApiForm().withParam("scope", scope).withParam(PER_PAGE_PARAM, getDefaultPerPage());
161161
Response response = get(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "pipelines", pipelineId, "jobs");
162162
return (response.readEntity(new GenericType<List<Job>>() {}));
@@ -173,7 +173,7 @@ public List<Job> getJobsForPipeline(Object projectIdOrPath, int pipelineId, JobS
173173
* @return a list containing the jobs for the specified project ID and pipeline ID
174174
* @throws GitLabApiException if any exception occurs during execution
175175
*/
176-
public Pager<Job> getJobsForPipeline(Object projectIdOrPath, int pipelineId, int itemsPerPage) throws GitLabApiException {
176+
public Pager<Job> getJobsForPipeline(Object projectIdOrPath, long pipelineId, int itemsPerPage) throws GitLabApiException {
177177
return (new Pager<Job>(this, Job.class, itemsPerPage, getDefaultPerPageParam(),
178178
"projects", getProjectIdOrPath(projectIdOrPath), "pipelines", pipelineId, "jobs"));
179179
}
@@ -187,7 +187,7 @@ public Pager<Job> getJobsForPipeline(Object projectIdOrPath, int pipelineId, int
187187
* @return a Stream containing the jobs for the specified project ID
188188
* @throws GitLabApiException if any exception occurs during execution
189189
*/
190-
public Stream<Job> getJobsStream(Object projectIdOrPath, int pipelineId) throws GitLabApiException {
190+
public Stream<Job> getJobsStream(Object projectIdOrPath, long pipelineId) throws GitLabApiException {
191191
return (getJobsForPipeline(projectIdOrPath, pipelineId, getDefaultPerPage()).stream());
192192
}
193193

src/main/java/org/gitlab4j/api/NotificationSettingsApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public NotificationSettings getProjectNotificationSettings(long projectId) throw
133133
* @return a NotificationSettings instance containing the updated project notification settings
134134
* @throws GitLabApiException if any exception occurs
135135
*/
136-
public NotificationSettings updateProjectNotificationSettings(int projectId, NotificationSettings settings) throws GitLabApiException {
136+
public NotificationSettings updateProjectNotificationSettings(long projectId, NotificationSettings settings) throws GitLabApiException {
137137

138138
GitLabApiForm formData = new GitLabApiForm()
139139
.withParam("level", settings.getLevel())

src/test/java/org/gitlab4j/api/TestUserApi.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -553,21 +553,21 @@ public void testGetMemberships() throws GitLabApiException {
553553
assertEquals(3, memberships.size());
554554

555555
Membership membership1 = memberships.get(0);
556-
assertMembershipEquals(membership1, 1, "test-project", MembershipSourceType.PROJECT, AccessLevel.MAINTAINER);
556+
assertMembershipEquals(membership1, 1L, "test-project", MembershipSourceType.PROJECT, AccessLevel.MAINTAINER);
557557

558558
Membership membership2 = memberships.get(1);
559-
assertMembershipEquals(membership2, 4, "Test Group", MembershipSourceType.NAMESPACE, AccessLevel.OWNER);
559+
assertMembershipEquals(membership2, 1L, "Test Group", MembershipSourceType.NAMESPACE, AccessLevel.OWNER);
560560

561561
Membership membership3 = memberships.get(2);
562-
assertMembershipEquals(membership3, 5, "subgroup", MembershipSourceType.NAMESPACE, AccessLevel.OWNER);
562+
assertMembershipEquals(membership3, 1L, "subgroup", MembershipSourceType.NAMESPACE, AccessLevel.OWNER);
563563
}
564564

565565
private void assertMembershipEquals(Membership actualMembership,
566-
int expectedSourceId,
566+
long expectedSourceId,
567567
String expectedSourceName,
568568
MembershipSourceType expectedSourceType,
569569
AccessLevel expectedAccessLevel) {
570-
assertEquals(expectedSourceId, actualMembership.getSourceId().intValue());
570+
assertEquals(expectedSourceId, actualMembership.getSourceId());
571571
assertEquals(expectedSourceName, actualMembership.getSourceName());
572572
assertEquals(expectedSourceType, actualMembership.getSourceType());
573573
assertEquals(expectedAccessLevel, actualMembership.getAccessLevel());

0 commit comments

Comments
 (0)