Skip to content

Commit

Permalink
🐛 Re-enable team sync on restart
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Jun 14, 2024
1 parent a2f8187 commit c8b2792
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import io.quarkus.arc.profile.IfBuildProfile;
import io.quarkus.arc.profile.UnlessBuildProfile;
import io.quarkus.logging.Log;
import io.quarkus.runtime.LaunchMode;
import io.quarkus.runtime.ShutdownEvent;
import io.quarkus.runtime.StartupEvent;
import io.quarkus.scheduler.Scheduled;
Expand Down Expand Up @@ -105,10 +104,8 @@ public void repositoryDiscovered(@Observes RepositoryDiscoveryEvent repoEvent) {

Log.debugf("repositoryDiscovered: %s", repo.getFullName());

if (LaunchMode.current() != LaunchMode.NORMAL) {
// Scan immediately in dev & test
scheduleQueryRepository(cfg, repo, repoEvent.github());
}
// Scan immediately in dev & test
scheduleQueryRepository(cfg, repo, repoEvent.github());
}

public void updateTeamMembers(GitHubEvent event, GitHub github, DynamicGraphQLClient graphQLClient,
Expand Down Expand Up @@ -267,7 +264,6 @@ void doSyncTeamMembers(TeamSourceConfig config, String fullTeamName, Set<String>
if (sourceLogins.contains(user)) {
toAdd.remove(user); // already in team
} else {
Log.infof("doSyncTeamMembers: remove %s from %s", user, fullTeamName);
toRemove.add(user);
}
});
Expand All @@ -282,6 +278,7 @@ void doSyncTeamMembers(TeamSourceConfig config, String fullTeamName, Set<String>
try {
GHUser user = gh.getUser(login);
team.add(user);
Log.infof("doSyncTeamMembers: add %s to %s", user, fullTeamName);
} catch (IOException e) {
Log.warnf("doSyncTeamMembers: failed to add %s to %s", login, fullTeamName);
}
Expand All @@ -290,13 +287,13 @@ void doSyncTeamMembers(TeamSourceConfig config, String fullTeamName, Set<String>
try {
GHUser user = gh.getUser(login);
team.remove(user);
Log.infof("doSyncTeamMembers: remove %s from %s", user, fullTeamName);
} catch (IOException e) {
Log.warnf("doSyncTeamMembers: failed to remove %s from %s", login, fullTeamName);
}
}
return null;
});

} else {
Set<String> finalLogins = new HashSet<>(currentLogins);
finalLogins.addAll(toAdd);
Expand Down

0 comments on commit c8b2792

Please sign in to comment.