Skip to content

Commit

Permalink
Added issue filter builders to make it easier to filter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
stianst committed Mar 6, 2024
1 parent ea9a54e commit 1eeda63
Show file tree
Hide file tree
Showing 12 changed files with 325 additions and 127 deletions.
186 changes: 82 additions & 104 deletions data.json
Original file line number Diff line number Diff line change
Expand Up @@ -4148,17 +4148,6 @@
"labels" : [ "area/oidc", "kind/bug" ],
"commentsCount" : 1,
"teams" : [ ]
}, {
"createdAt" : 1693992616000,
"updatedAt" : 1693992625000,
"closedAt" : 1693992625000,
"number" : 23004,
"title" : "Flaky test: org.keycloak.testsuite.admin.concurrency.ConcurrencyTest#createRemoveClient",
"userLogin" : "stianst",
"milestone" : null,
"labels" : [ "kind/bug", "area/ci", "flaky-test", "team/continuous-testing" ],
"commentsCount" : 0,
"teams" : [ "team/continuous-testing" ]
}, {
"createdAt" : 1693992162000,
"updatedAt" : 1693999860000,
Expand Down Expand Up @@ -4192,17 +4181,6 @@
"labels" : [ "kind/bug", "area/admin/ui", "team/ui" ],
"commentsCount" : 3,
"teams" : [ "team/ui" ]
}, {
"createdAt" : 1693988838000,
"updatedAt" : 1693988950000,
"closedAt" : 1693988948000,
"number" : 22996,
"title" : "Could not extract the Node archive on GitHub Actions",
"userLogin" : "stianst",
"milestone" : null,
"labels" : [ "kind/bug", "area/ci", "team/continuous-testing" ],
"commentsCount" : 1,
"teams" : [ "team/continuous-testing" ]
}, {
"createdAt" : 1693915394000,
"updatedAt" : 1695290678000,
Expand Down Expand Up @@ -15379,17 +15357,6 @@
"labels" : [ "kind/bug", "priority/important", "impact/medium", "area/admin/ui", "team/ui" ],
"commentsCount" : 3,
"teams" : [ "team/ui" ]
}, {
"createdAt" : 1703071672000,
"updatedAt" : 1709032885000,
"closedAt" : null,
"number" : 25725,
"title" : " Login theme set for client is not reflected when using Device Authorization Grant",
"userLogin" : "kalpa-sith",
"milestone" : "Backlog",
"labels" : [ "area/authentication", "kind/bug", "help wanted", "team/core-clients" ],
"commentsCount" : 2,
"teams" : [ "team/core-clients" ]
}, {
"createdAt" : 1701362866000,
"updatedAt" : 1709032401000,
Expand Down Expand Up @@ -18118,17 +18085,6 @@
"labels" : [ "kind/bug", "area/admin/ui", "team/ui", "status/auto-expire", "status/missing-information" ],
"commentsCount" : 1,
"teams" : [ "team/ui" ]
}, {
"createdAt" : 1709651113000,
"updatedAt" : 1709659337000,
"closedAt" : 1709659336000,
"number" : 27563,
"title" : "Not rendered images in https://www.keycloak.org/2024/03/keycloak-2400-released",
"userLogin" : "lrozenblyum",
"milestone" : null,
"labels" : [ "kind/bug", "area/docs" ],
"commentsCount" : 1,
"teams" : [ ]
}, {
"createdAt" : 1709649904000,
"updatedAt" : 1709670842000,
Expand Down Expand Up @@ -18162,17 +18118,6 @@
"labels" : [ "kind/bug", "area/admin/api", "status/triage", "team/core-shared" ],
"commentsCount" : 2,
"teams" : [ "team/core-shared" ]
}, {
"createdAt" : 1709646657000,
"updatedAt" : 1709649968000,
"closedAt" : null,
"number" : 27556,
"title" : "When you delete LDAP integration, the groups created by a group mapper do not get deleted",
"userLogin" : "avhb",
"milestone" : null,
"labels" : [ "kind/bug", "area/ldap", "team/core-iam", "status/auto-expire", "status/missing-information" ],
"commentsCount" : 1,
"teams" : [ "team/core-iam" ]
}, {
"createdAt" : 1709645402000,
"updatedAt" : 1709645407000,
Expand All @@ -18184,17 +18129,6 @@
"labels" : [ "area/oidc", "kind/bug", "status/triage", "team/core-clients" ],
"commentsCount" : 0,
"teams" : [ "team/core-clients" ]
}, {
"createdAt" : 1709640201000,
"updatedAt" : 1709667518000,
"closedAt" : null,
"number" : 27548,
"title" : "Custom Browser Flow not working anymore",
"userLogin" : "sventorben",
"milestone" : null,
"labels" : [ "kind/bug", "area/core", "status/triage", "team/core-shared" ],
"commentsCount" : 2,
"teams" : [ "team/core-shared" ]
}, {
"createdAt" : 1709636977000,
"updatedAt" : 1709646530000,
Expand Down Expand Up @@ -18360,17 +18294,6 @@
"labels" : [ "kind/bug", "area/core", "status/triage", "team/cross-dc" ],
"commentsCount" : 1,
"teams" : [ "team/cross-dc" ]
}, {
"createdAt" : 1709550986000,
"updatedAt" : 1709652863000,
"closedAt" : null,
"number" : 27489,
"title" : "`org.keycloak.adapters.KeycloakDeployment.resolveUrls()` is thread-unsafe",
"userLogin" : "lrozenblyum",
"milestone" : "Backlog",
"labels" : [ "kind/bug", "area/adapter/spring", "help wanted", "team/core-clients" ],
"commentsCount" : 6,
"teams" : [ "team/core-clients" ]
}, {
"createdAt" : 1709248027000,
"updatedAt" : 1709676220000,
Expand Down Expand Up @@ -18525,17 +18448,6 @@
"labels" : [ "kind/bug", "area/ci", "team/continuous-testing", "flaky-job", "backport/22.0", "backport/24.0" ],
"commentsCount" : 1,
"teams" : [ "team/continuous-testing" ]
}, {
"createdAt" : 1707307930000,
"updatedAt" : 1709644127000,
"closedAt" : null,
"number" : 26860,
"title" : "Messages on empty user and admin events don't make sense",
"userLogin" : "agagancarczyk",
"milestone" : null,
"labels" : [ "kind/bug", "impact/low", "area/admin/ui", "team/ui" ],
"commentsCount" : 0,
"teams" : [ "team/ui" ]
}, {
"createdAt" : 1706795186000,
"updatedAt" : 1709644992000,
Expand Down Expand Up @@ -18668,17 +18580,6 @@
"labels" : [ "kind/bug", "area/ci", "flaky-test", "team/continuous-testing" ],
"commentsCount" : 87,
"teams" : [ "team/continuous-testing" ]
}, {
"createdAt" : 1697219243000,
"updatedAt" : 1709632036000,
"closedAt" : null,
"number" : 23980,
"title" : "Keycloak Operator fails to install realm authentication flow because \"flow is null\"",
"userLogin" : "ildrummer",
"milestone" : null,
"labels" : [ "kind/bug", "area/import-export", "status/triage", "team/core-clients" ],
"commentsCount" : 10,
"teams" : [ "team/core-clients" ]
}, {
"createdAt" : 1695432957000,
"updatedAt" : 1709648613000,
Expand Down Expand Up @@ -18901,7 +18802,7 @@
"teams" : [ "team/core-clients" ]
}, {
"createdAt" : 1709715635000,
"updatedAt" : 1709715640000,
"updatedAt" : 1709718333000,
"closedAt" : null,
"number" : 27590,
"title" : "Startup/DB Migration fails with Oracle 19: ORA-00972: identifier is too long",
Expand All @@ -18910,6 +18811,50 @@
"labels" : [ "kind/bug", "area/storage", "status/triage", "team/core-shared" ],
"commentsCount" : 0,
"teams" : [ "team/core-shared" ]
}, {
"createdAt" : 1709651113000,
"updatedAt" : 1709720506000,
"closedAt" : 1709659336000,
"number" : 27563,
"title" : "Not rendered images in https://www.keycloak.org/2024/03/keycloak-2400-released",
"userLogin" : "lrozenblyum",
"milestone" : null,
"labels" : [ "kind/bug", "area/docs" ],
"commentsCount" : 2,
"teams" : [ ]
}, {
"createdAt" : 1709646657000,
"updatedAt" : 1709719348000,
"closedAt" : null,
"number" : 27556,
"title" : "When you delete LDAP integration, the groups created by a group mapper do not get deleted",
"userLogin" : "avhb",
"milestone" : null,
"labels" : [ "kind/bug", "area/ldap", "status/triage", "team/core-iam" ],
"commentsCount" : 2,
"teams" : [ "team/core-iam" ]
}, {
"createdAt" : 1709640201000,
"updatedAt" : 1709717882000,
"closedAt" : null,
"number" : 27548,
"title" : "Custom Browser Flow not working anymore",
"userLogin" : "sventorben",
"milestone" : null,
"labels" : [ "kind/bug", "area/admin/ui", "status/triage", "team/ui" ],
"commentsCount" : 2,
"teams" : [ "team/ui" ]
}, {
"createdAt" : 1709550986000,
"updatedAt" : 1709720730000,
"closedAt" : null,
"number" : 27489,
"title" : "`org.keycloak.adapters.KeycloakDeployment.resolveUrls()` is thread-unsafe",
"userLogin" : "lrozenblyum",
"milestone" : "Backlog",
"labels" : [ "kind/bug", "area/adapter/spring", "help wanted", "team/core-clients" ],
"commentsCount" : 6,
"teams" : [ "team/core-clients" ]
}, {
"createdAt" : 1709030986000,
"updatedAt" : 1709711596000,
Expand All @@ -18923,18 +18868,18 @@
"teams" : [ "team/cloud-native" ]
}, {
"createdAt" : 1708506160000,
"updatedAt" : 1709711286000,
"closedAt" : null,
"updatedAt" : 1709717721000,
"closedAt" : 1709717721000,
"number" : 27194,
"title" : "Workflow failure Admin UI E2E - matrix E2E",
"userLogin" : "ikhomyn",
"milestone" : null,
"labels" : [ "kind/bug", "area/admin/ui", "team/ui", "flaky-job", "release/22.0.9", "release/23.0.7" ],
"commentsCount" : 1,
"commentsCount" : 2,
"teams" : [ "team/ui" ]
}, {
"createdAt" : 1707445700000,
"updatedAt" : 1709701358000,
"updatedAt" : 1709718716000,
"closedAt" : null,
"number" : 26915,
"title" : "Deleting sub-realm roles throw errors (even tho it succeeded)",
Expand All @@ -18943,6 +18888,28 @@
"labels" : [ "area/authorization-services", "kind/bug", "priority/important", "area/core", "area/admin/api", "team/core-iam" ],
"commentsCount" : 12,
"teams" : [ "team/core-iam" ]
}, {
"createdAt" : 1707307930000,
"updatedAt" : 1709720764000,
"closedAt" : 1709720764000,
"number" : 26860,
"title" : "Messages on empty user and admin events don't make sense",
"userLogin" : "agagancarczyk",
"milestone" : null,
"labels" : [ "kind/bug", "impact/low", "area/admin/ui", "team/ui" ],
"commentsCount" : 0,
"teams" : [ "team/ui" ]
}, {
"createdAt" : 1703071672000,
"updatedAt" : 1709718807000,
"closedAt" : null,
"number" : 25725,
"title" : " Login theme set for client is not reflected when using Device Authorization Grant",
"userLogin" : "kalpa-sith",
"milestone" : null,
"labels" : [ "area/authentication", "kind/bug", "help wanted", "team/core-clients", "priority/low", "status/auto-expire", "status/auto-bump" ],
"commentsCount" : 3,
"teams" : [ "team/core-clients" ]
}, {
"createdAt" : 1698744903000,
"updatedAt" : 1709684612000,
Expand All @@ -18954,6 +18921,17 @@
"labels" : [ "kind/bug", "area/ci", "flaky-test", "team/continuous-testing" ],
"commentsCount" : 55,
"teams" : [ "team/continuous-testing" ]
}, {
"createdAt" : 1697219243000,
"updatedAt" : 1709720438000,
"closedAt" : null,
"number" : 23980,
"title" : "Keycloak Operator fails to install realm authentication flow because \"flow is null\"",
"userLogin" : "ildrummer",
"milestone" : null,
"labels" : [ "kind/bug", "area/import-export", "status/triage", "team/core-clients" ],
"commentsCount" : 11,
"teams" : [ "team/core-clients" ]
}, {
"createdAt" : 1678786722000,
"updatedAt" : 1709713729000,
Expand Down
43 changes: 20 additions & 23 deletions src/main/java/org/keycloak/dashboard/beans/BugTeamStat.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package org.keycloak.dashboard.beans;

import org.keycloak.dashboard.Config;
import org.keycloak.dashboard.beans.filters.IssueFilterBuilder;
import org.keycloak.dashboard.rep.GitHubIssue;
import org.keycloak.dashboard.util.Css;
import org.keycloak.dashboard.util.GHQuery;

import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;

public class BugTeamStat {
private static final String ISSUES_LINK = "https://github.com/keycloak/keycloak/issues";
Expand All @@ -30,53 +28,43 @@ public BugTeamStat(String team, String teamQuery, List<GitHubIssue> openIssues,
this.nextRelease = nextRelease;

columns.add(new Column(nextRelease,
i -> nextRelease.equals(i.getMilestone()),
"milestone:" + nextRelease,
IssueFilterBuilder.create().milestone(nextRelease),
Config.BUG_TEAM_NEXT_WARN, Config.BUG_TEAM_NEXT_ERROR));

columns.add(new Column("Triage",
i -> i.getLabels().contains("status/triage") && (i.getMilestone() == null || !i.getMilestone().equals("Backlog")),
"label:status/triage -milestone:Backlog",
IssueFilterBuilder.create().triage(true).backlog(false),
Config.BUG_TEAM_TRIAGE_WARN, Config.BUG_TEAM_TRIAGE_ERROR));

columns.add(new Column("Criticial",
i -> !i.getLabels().contains("status/triage") && (i.getLabels().contains("priority/blocker")),
"-label:status/triage label:priority/blocker",
IssueFilterBuilder.create().triage(false).priority("critical"),
-1, 1));

columns.add(new Column("Important",
i -> !i.getLabels().contains("status/triage") && (i.getLabels().contains("priority/important")),
"-label:status/triage label:priority/important",
IssueFilterBuilder.create().triage(false).priority("important"),
Config.BUG_PRIORITY_WARN, Config.BUG_PRIORITY_ERROR));

columns.add(new Column("Normal",
i -> !i.getLabels().contains("status/triage") && (i.getLabels().contains("priority/normal")),
"-label:status/triage label:priority/normal",
IssueFilterBuilder.create().triage(false).priority("normal"),
Config.BUG_OPEN_WARN, Config.BUG_OPEN_ERROR));

columns.add(new Column("Low",
i -> !i.getLabels().contains("status/triage") && (i.getLabels().contains("priority/low")),
"-label:status/triage label:priority/low",
IssueFilterBuilder.create().triage(false).priority("low"),
Config.BUG_OPEN_WARN, Config.BUG_OPEN_ERROR));

columns.add(new Column("<p>Cleanup<p><p>Triage backlog</p>",
i -> i.getLabels().contains("status/triage") && i.getMilestone() != null && i.getMilestone().equals("Backlog"),
"label:status/triage milestone:Backlog",
IssueFilterBuilder.create().triage(true).backlog(true),
-1, 1));

columns.add(new Column("<p>Cleanup</p><p>Missing priority and not in backlog</p>",
i -> !i.getLabels().contains("status/triage") && (!"Backlog".equals(i.getMilestone()) && i.getLabels().stream().noneMatch(l -> l.equals("status/missing-information") || l.startsWith("priority/"))),
"-label:status/triage,priority/blocker,priority/important,priority/normal,priority/low,status/missing-information -milestone:Backlog",
IssueFilterBuilder.create().triage(false).hasPriority(false).missingInformation(false).backlog(false),
-1, 1));

columns.add(new Column("<p>Cleanup</p><p>Backlog and not help wanted</p>",
i -> !i.getLabels().contains("status/triage") && !i.getLabels().contains("help wanted") && "Backlog".equals(i.getMilestone()),
"-label:status/triage -label:\"help wanted\" milestone:Backlog",
IssueFilterBuilder.create().triage(false).helpWanted(false).backlog(true),
-1, 1));

columns.add(new Column("<p>Cleanup</p><p>Backlog with help wanted</p>",
i -> i.getLabels().contains("help wanted") && "Backlog".equals(i.getMilestone()),
"label:\"help wanted\" milestone:backlog",
IssueFilterBuilder.create().backlog(true).helpWanted(true),
-1, 1));
}

Expand Down Expand Up @@ -107,6 +95,14 @@ public final class Column {

int errorCount;

public Column(String label, IssueFilterBuilder issueFilterBuilder, int warnCount, int errorCount) {
this.label = label;
this.link = getLink(issueFilterBuilder.toGhQuery());
this.count = getFilteredCount(issueFilterBuilder.toPredicates());
this.warnCount = warnCount;
this.errorCount = errorCount;
}

public Column(String label, Predicate<GitHubIssue> predicate, String query, int warnCount, int errorCount) {
this.label = label;
this.link = getLink(query);
Expand Down Expand Up @@ -140,4 +136,5 @@ private String getLink(String query) {
private int getFilteredCount(Predicate<GitHubIssue> predicate) {
return (int) openIssues.stream().filter(predicate).count();
}

}
Loading

0 comments on commit 1eeda63

Please sign in to comment.