-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GitHubService when adding a new history issue and one already exi…
…sts whose title is the prefix of the new one
- Loading branch information
Showing
11 changed files
with
327 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
src/main/java/io/quarkus/github/lottery/github/GitHubDedicatedIssue.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/io/quarkus/github/lottery/github/TopicRef.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.quarkus.github.lottery.github; | ||
|
||
/** | ||
* A reference to a {@link GitHubRepository#topic(TopicRef) topic} in a GitHub repository. | ||
* | ||
* @param assignee The GitHub username of issue assignee. | ||
* @param topic The issue's topic, a string that should be prefixed to the title of dedicated issues. | ||
* @param expectedSuffixStart If issue titles are suffixed (e.g. with the last update date), | ||
* the (constant) string these suffixes are expected to start with. | ||
* If issue titles are identical to the topic, a {@code null} string. | ||
*/ | ||
public record TopicRef(String assignee, | ||
String topic, | ||
String expectedSuffixStart) { | ||
|
||
public TopicRef { | ||
if (expectedSuffixStart != null && expectedSuffixStart.isEmpty()) { | ||
throw new IllegalArgumentException("expectedSuffixStart must not be empty; pass either null or a non-empty string"); | ||
} | ||
} | ||
|
||
public static TopicRef history(String topic) { | ||
return new TopicRef(null, topic, null); | ||
} | ||
|
||
public static TopicRef notification(String assignee, String topic) { | ||
return new TopicRef(assignee, topic, " (updated"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.