Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jmini committed Jun 13, 2024
2 parents 6e0ff51 + e8a261a commit 91807f2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/gitlab4j/api/ProjectApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,8 @@ public Project updateProject(Project project) throws GitLabApiException {
formData.withParam("issue_branch_template", project.getIssueBranchTemplate());
formData.withParam("merge_commit_template", project.getMergeCommitTemplate());
formData.withParam("squash_commit_template", project.getSquashCommitTemplate());
formData.withParam("merge_requests_template", project.getMergeRequestsTemplate());
formData.withParam("issues_template", project.getIssuesTemplate());

if (project.getTagList() != null && !project.getTagList().isEmpty()) {
formData.withParam("tag_list", String.join(",", project.getTagList()));
Expand Down Expand Up @@ -2254,7 +2256,7 @@ public ProjectHook addHook(Object projectIdOrPath, String url, boolean doPushEve
boolean doIssuesEvents, boolean doMergeRequestsEvents) throws GitLabApiException {
return addHook(projectIdOrPath, url, doPushEvents, doIssuesEvents, doMergeRequestsEvents, null);
}

/**
* Adds a hook to project.
* Convenience method for {@link #addHook(Object, String, ProjectHook, Boolean, String)}
Expand Down Expand Up @@ -4044,7 +4046,7 @@ public ProjectAccessToken createProjectAccessToken(Object projectIdOrPath, Strin
public ProjectAccessToken rotateProjectAccessToken(Object projectIdOrPath, Long tokenId) throws GitLabApiException {
return rotateProjectAccessToken(projectIdOrPath, tokenId, null);
}

/**
* Rotates the given project access token.
* The token is revoked and a new one which will expire in one week is created to replace it.
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/org/gitlab4j/api/models/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ public String toString() {
private String mergeCommitTemplate;
private String squashCommitTemplate;
private String issueBranchTemplate;
private String mergeRequestsTemplate;
private String issuesTemplate;

@JsonProperty("_links")
private Map<String, String> links;

Expand Down Expand Up @@ -950,6 +953,22 @@ public void setIssueBranchTemplate(String issueBranchTemplate) {
this.issueBranchTemplate = issueBranchTemplate;
}

public String getMergeRequestsTemplate() {
return mergeRequestsTemplate;
}

public void setMergeRequestsTemplate(String mergeRequestsTemplate) {
this.mergeRequestsTemplate = mergeRequestsTemplate;
}

public String getIssuesTemplate() {
return issuesTemplate;
}

public void setIssuesTemplate(String issuesTemplate) {
this.issuesTemplate = issuesTemplate;
}

public Map<String, String> getLinks() {
return links;
}
Expand Down
4 changes: 3 additions & 1 deletion src/test/resources/org/gitlab4j/api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
"merge_commit_template": "Merge branch '%{source_branch}' into '%{target_branch}'",
"squash_commit_template": "Commit %{title}",
"issue_branch_template" : "issue-%{id}",
"merge_requests_template": "",
"issues_template": "",
"autoclose_referenced_issues" : true,
"permissions" : {
"project_access" : {
Expand Down Expand Up @@ -125,4 +127,4 @@
"packages_size" : 0
},
"custom_attributes" : [ ]
}
}

0 comments on commit 91807f2

Please sign in to comment.