Exclude team from contributor listing in GitHub releases.

Closes #177
This commit is contained in:
Mark Paluch
2021-03-31 11:00:45 +02:00
parent b6666650cd
commit 9d5af005d7
4 changed files with 18 additions and 4 deletions

View File

@@ -16,10 +16,13 @@
package org.springframework.data.release.issues.github; package org.springframework.data.release.issues.github;
import lombok.Getter;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.HashSet; import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@@ -40,17 +43,20 @@ public class ChangelogGenerator {
private static final Pattern ghUserMentionPattern = Pattern.compile("(^|[^\\w`])(@[\\w-]+)"); private static final Pattern ghUserMentionPattern = Pattern.compile("(^|[^\\w`])(@[\\w-]+)");
@Getter
private final Set<String> excludeLabels; private final Set<String> excludeLabels;
@Getter
private final Set<String> excludeContributors; private final Set<String> excludeContributors;
@Getter
private final String contributorsTitle; private final String contributorsTitle;
private final ChangelogSections sections; private final ChangelogSections sections;
public ChangelogGenerator() { public ChangelogGenerator() {
this.excludeLabels = new HashSet<>(Arrays.asList("type: task")); this.excludeLabels = new HashSet<>(Arrays.asList("type: task"));
this.excludeContributors = Collections.emptySet(); this.excludeContributors = new LinkedHashSet<>();
this.contributorsTitle = null; this.contributorsTitle = null;
this.sections = new ChangelogSections(); this.sections = new ChangelogSections();
} }

View File

@@ -553,6 +553,8 @@ public class GitHub extends GitHubSupport implements IssueTracker {
DocumentationMetadata documentation = DocumentationMetadata.of(module.getProject(), version); DocumentationMetadata documentation = DocumentationMetadata.of(module.getProject(), version);
ChangelogGenerator generator = new ChangelogGenerator(); ChangelogGenerator generator = new ChangelogGenerator();
generator.getExcludeContributors().addAll(properties.getTeam());
String releaseBody = generator.generate(gitHubIssues, (changelogSection, s) -> s); String releaseBody = generator.generate(gitHubIssues, (changelogSection, s) -> s);
String documentationLinks = getDocumentationLinks(module, documentation); String documentationLinks = getDocumentationLinks(module, documentation);

View File

@@ -20,6 +20,8 @@ import lombok.Data;
import lombok.Getter; import lombok.Getter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import java.util.List;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -30,6 +32,7 @@ import org.springframework.util.Assert;
/** /**
* @author Oliver Gierke * @author Oliver Gierke
* @author Mark Paluch
*/ */
@Data @Data
@Component @Component
@@ -41,6 +44,11 @@ public class GitHubProperties {
private String apiUrl; private String apiUrl;
/**
* Usernames of project team members.
*/
private List<String> team;
public String getUsername() { public String getUsername() {
return gitProperties.getUsername(); return gitProperties.getUsername();
} }

View File

@@ -11,15 +11,13 @@ deployment.staging-repository=libs-staging-local
deployment.distribution-repository=temp-private-local deployment.distribution-repository=temp-private-local
deployment.username=buildmaster deployment.username=buildmaster
#deployment.password <- local #deployment.password <- local
github.team=christophstrobl,gregturn,jxblum,mp911de,odrotbohm,schauder,meistermeier,michael-simons,sothawo,daschl,mikereiche,davidkelly
# GPG setup # GPG setup
gpg.executable=/usr/local/bin/gpg2 gpg.executable=/usr/local/bin/gpg2
# gpg.keyname # gpg.keyname
# gpg.password # gpg.password
# JIRA # JIRA
jira.api-url=https://jira.spring.io jira.api-url=https://jira.spring.io
# GitHub # GitHub
github.api-url=https://api.github.com github.api-url=https://api.github.com
logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(%-20.20logger{19}){cyan}%clr(:){faint} %m%n%wEx logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(%-20.20logger{19}){cyan}%clr(:){faint} %m%n%wEx