-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the "search issues" API instead of the "query issues" API
Because it's (much) more flexible.
- Loading branch information
Showing
5 changed files
with
291 additions
and
283 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
39 changes: 39 additions & 0 deletions
39
src/main/java/io/quarkus/github/lottery/github/GitHubSearchClauses.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,39 @@ | ||
package io.quarkus.github.lottery.github; | ||
|
||
import java.time.Instant; | ||
import java.time.ZoneOffset; | ||
import java.util.Set; | ||
|
||
public final class GitHubSearchClauses { | ||
|
||
private GitHubSearchClauses() { | ||
} | ||
|
||
public static String repo(GitHubRepositoryRef ref) { | ||
return "repo:" + ref.repositoryName(); | ||
} | ||
|
||
public static String isIssue() { | ||
return "is:issue"; | ||
} | ||
|
||
public static String anyLabel(Set<String> labels) { | ||
return label(String.join(",", labels)); | ||
} | ||
|
||
public static String label(String label) { | ||
return "label:" + label; | ||
} | ||
|
||
public static String updatedBefore(Instant updatedBefore) { | ||
return "updated:<" + updatedBefore.atOffset(ZoneOffset.UTC).toLocalDateTime().toString(); | ||
} | ||
|
||
public static String author(String author) { | ||
return "author:" + author; | ||
} | ||
|
||
public static String assignee(String assignee) { | ||
return "assignee:" + assignee; | ||
} | ||
} |
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.