| 1 | package edu.ucsb.cs156.frontiers.jobs; | |
| 2 | ||
| 3 | import edu.ucsb.cs156.frontiers.entities.Course; | |
| 4 | import edu.ucsb.cs156.frontiers.entities.CourseStaff; | |
| 5 | import edu.ucsb.cs156.frontiers.entities.RosterStudent; | |
| 6 | import edu.ucsb.cs156.frontiers.entities.Team; | |
| 7 | import edu.ucsb.cs156.frontiers.entities.TeamMember; | |
| 8 | import edu.ucsb.cs156.frontiers.errors.SlackApiException; | |
| 9 | import edu.ucsb.cs156.frontiers.models.SlackChannel; | |
| 10 | import edu.ucsb.cs156.frontiers.models.SlackUser; | |
| 11 | import edu.ucsb.cs156.frontiers.repositories.CourseRepository; | |
| 12 | import edu.ucsb.cs156.frontiers.repositories.CourseStaffRepository; | |
| 13 | import edu.ucsb.cs156.frontiers.repositories.TeamRepository; | |
| 14 | import edu.ucsb.cs156.frontiers.services.CanvasApiTokenSecurityService; | |
| 15 | import edu.ucsb.cs156.frontiers.services.SlackService; | |
| 16 | import edu.ucsb.cs156.frontiers.utilities.CanonicalFormConverter; | |
| 17 | import edu.ucsb.cs156.jobs.services.JobContext; | |
| 18 | import edu.ucsb.cs156.jobs.services.JobContextConsumer; | |
| 19 | import java.util.ArrayList; | |
| 20 | import java.util.HashMap; | |
| 21 | import java.util.HashSet; | |
| 22 | import java.util.LinkedHashMap; | |
| 23 | import java.util.List; | |
| 24 | import java.util.Locale; | |
| 25 | import java.util.Map; | |
| 26 | import java.util.Set; | |
| 27 | import lombok.Builder; | |
| 28 | ||
| 29 | /** | |
| 30 | * Makes the public Slack channels of a course's teams match the teams. | |
| 31 | * | |
| 32 | * <ol> | |
| 33 | * <li>For each team, works out a channel name: "team-" followed by the team name in the form | |
| 34 | * Slack requires (see {@link #sanitizeChannelName}). If two teams end up with the same | |
| 35 | * channel name, the job stops with an error naming them, before touching Slack. | |
| 36 | * <li>Creates each channel, unless it already exists. | |
| 37 | * <li>Adds each member of each team, and the instructor of the course, to the team's channel, | |
| 38 | * unless they are already in it. People are matched to Slack users by email; those without an | |
| 39 | * active Slack account cannot be added, and are only counted. | |
| 40 | * <li>Removes from each channel every person who is neither a member of the team, nor the | |
| 41 | * instructor, nor a member of the course staff. Bots (including the bot this job acts as) and | |
| 42 | * members that are not users of the workspace are never removed. | |
| 43 | * </ol> | |
| 44 | * | |
| 45 | * A problem with one channel or one person is logged, and the job carries on with the rest. The | |
| 46 | * last line of the log is a summary of how many channels were created or already existed, and how | |
| 47 | * many members were added, already present, or removed. | |
| 48 | */ | |
| 49 | @Builder | |
| 50 | public class SetupTeamSlackChannelsJob implements JobContextConsumer { | |
| 51 | ||
| 52 | public static final String CHANNEL_PREFIX = "team-"; | |
| 53 | ||
| 54 | Course course; | |
| 55 | CourseRepository courseRepository; | |
| 56 | TeamRepository teamRepository; | |
| 57 | CourseStaffRepository courseStaffRepository; | |
| 58 | SlackService slackService; | |
| 59 | CanvasApiTokenSecurityService tokenSecurityService; | |
| 60 | ||
| 61 | @Override | |
| 62 | public String getScopeType() { | |
| 63 |
1
1. getScopeType : replaced return value with "" for edu/ucsb/cs156/frontiers/jobs/SetupTeamSlackChannelsJob::getScopeType → KILLED |
return "course"; |
| 64 | } | |
| 65 | ||
| 66 | @Override | |
| 67 | public Long getScopeId() { | |
| 68 |
1
1. getScopeId : replaced Long return value with 0L for edu/ucsb/cs156/frontiers/jobs/SetupTeamSlackChannelsJob::getScopeId → KILLED |
return course.getId(); |
| 69 | } | |
| 70 | ||
| 71 | /** | |
| 72 | * Turns a team name into the form Slack requires of channel names: all lowercase, spaces replaced | |
| 73 | * by hyphens, and every character other than letters, numbers, hyphens and underscores replaced | |
| 74 | * by a hyphen. | |
| 75 | * | |
| 76 | * @param teamName the team name; may be null | |
| 77 | * @return the sanitized name (without the "team-" prefix) | |
| 78 | */ | |
| 79 | public static String sanitizeChannelName(String teamName) { | |
| 80 |
1
1. sanitizeChannelName : negated conditional → KILLED |
if (teamName == null) { |
| 81 | return ""; | |
| 82 | } | |
| 83 |
1
1. sanitizeChannelName : replaced return value with "" for edu/ucsb/cs156/frontiers/jobs/SetupTeamSlackChannelsJob::sanitizeChannelName → KILLED |
return teamName.toLowerCase(Locale.ROOT).replace(' ', '-').replaceAll("[^a-z0-9_-]", "-"); |
| 84 | } | |
| 85 | ||
| 86 | /** | |
| 87 | * @param teamName the team name | |
| 88 | * @return the name of the team's Slack channel | |
| 89 | */ | |
| 90 | public static String channelNameFor(String teamName) { | |
| 91 |
1
1. channelNameFor : replaced return value with "" for edu/ucsb/cs156/frontiers/jobs/SetupTeamSlackChannelsJob::channelNameFor → KILLED |
return CHANNEL_PREFIX + sanitizeChannelName(teamName); |
| 92 | } | |
| 93 | ||
| 94 | @Override | |
| 95 | public void accept(JobContext ctx) throws Exception { | |
| 96 | Course currentCourse = courseRepository.findById(course.getId()).orElseThrow(); | |
| 97 | String token = tokenSecurityService.decrypt(currentCourse.getSlackBotToken()); | |
| 98 |
2
1. accept : negated conditional → KILLED 2. accept : negated conditional → KILLED |
if (token == null || token.isEmpty()) { |
| 99 | throw new IllegalStateException( | |
| 100 | "No Slack token has been set for this course; enter one on the Settings tab."); | |
| 101 | } | |
| 102 | ||
| 103 | // Work out the channel names first, and stop if any two teams collide, before calling Slack | |
| 104 | Map<String, Team> teamByChannelName = new LinkedHashMap<>(); | |
| 105 | Map<String, List<String>> teamNamesByChannelName = new LinkedHashMap<>(); | |
| 106 | for (Team team : teamRepository.findByCourseIdOrderByNameAsc(currentCourse.getId())) { | |
| 107 | String channelName = channelNameFor(team.getName()); | |
| 108 | teamByChannelName.putIfAbsent(channelName, team); | |
| 109 | teamNamesByChannelName | |
| 110 |
1
1. lambda$accept$0 : replaced return value with Collections.emptyList for edu/ucsb/cs156/frontiers/jobs/SetupTeamSlackChannelsJob::lambda$accept$0 → KILLED |
.computeIfAbsent(channelName, name -> new ArrayList<>()) |
| 111 | .add(team.getName()); | |
| 112 | } | |
| 113 | List<String> collisions = new ArrayList<>(); | |
| 114 | for (Map.Entry<String, List<String>> entry : teamNamesByChannelName.entrySet()) { | |
| 115 |
2
1. accept : negated conditional → KILLED 2. accept : changed conditional boundary → KILLED |
if (entry.getValue().size() > 1) { |
| 116 | collisions.add( | |
| 117 | "#%s (teams %s)".formatted(entry.getKey(), String.join(", ", entry.getValue()))); | |
| 118 | } | |
| 119 | } | |
| 120 |
1
1. accept : negated conditional → KILLED |
if (!collisions.isEmpty()) { |
| 121 | throw new IllegalStateException( | |
| 122 | "Two or more teams would get the same Slack channel name: %s. Rename the teams so that their channel names differ, then run this job again. Nothing was changed in Slack." | |
| 123 | .formatted(String.join("; ", collisions))); | |
| 124 | } | |
| 125 |
1
1. accept : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log( |
| 126 | "Creating Team Channels (%d team(s), channel names start with %s)" | |
| 127 | .formatted(teamByChannelName.size(), CHANNEL_PREFIX)); | |
| 128 | ||
| 129 | List<SlackUser> slackUsers = slackService.listUsers(token); | |
| 130 | Map<String, SlackUser> slackUsersById = new HashMap<>(); | |
| 131 | Map<String, String> activeSlackIdByEmail = new HashMap<>(); | |
| 132 | for (SlackUser user : slackUsers) { | |
| 133 | slackUsersById.put(user.getId(), user); | |
| 134 |
2
1. accept : negated conditional → KILLED 2. accept : negated conditional → KILLED |
if (user.isActivePerson() && user.email() != null) { |
| 135 | activeSlackIdByEmail.put(canonical(user.email()), user.getId()); | |
| 136 | } | |
| 137 | } | |
| 138 |
1
1. accept : negated conditional → KILLED |
if (activeSlackIdByEmail.isEmpty()) { |
| 139 | // Without emails nobody can be matched, and everybody would be removed from the channels. | |
| 140 | throw new IllegalStateException( | |
| 141 | "Slack did not provide the email of any user. Add the users:read.email scope to the Slack app, reinstall it to the workspace, and save the new token on the Settings tab."); | |
| 142 | } | |
| 143 | ||
| 144 | Summary summary = new Summary(); | |
| 145 | Map<String, String> channelIdByName = createChannels(ctx, token, teamByChannelName, summary); | |
| 146 | ||
| 147 | String instructorSlackId = | |
| 148 |
1
1. accept : negated conditional → KILLED |
currentCourse.getInstructorEmail() == null |
| 149 | ? null | |
| 150 | : activeSlackIdByEmail.get(canonical(currentCourse.getInstructorEmail())); | |
| 151 |
2
1. accept : negated conditional → KILLED 2. accept : negated conditional → KILLED |
if (currentCourse.getInstructorEmail() != null && instructorSlackId == null) { |
| 152 |
1
1. accept : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log( |
| 153 | "The instructor (%s) does not have an active account in the Slack workspace, so cannot be added to the channels." | |
| 154 | .formatted(currentCourse.getInstructorEmail())); | |
| 155 | } | |
| 156 | Set<String> staffSlackIds = new HashSet<>(); | |
| 157 | for (CourseStaff staff : courseStaffRepository.findByCourseId(currentCourse.getId())) { | |
| 158 |
1
1. accept : negated conditional → KILLED |
if (staff.getEmail() != null) { |
| 159 | staffSlackIds.add(activeSlackIdByEmail.get(canonical(staff.getEmail()))); | |
| 160 | } | |
| 161 | } | |
| 162 | ||
| 163 |
1
1. accept : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log("Adding Team Members to Channels"); |
| 164 | Map<String, List<String>> membersByChannelName = new HashMap<>(); | |
| 165 | Map<String, Set<String>> belongingIdsByChannelName = new HashMap<>(); | |
| 166 | int membersNotInSlack = 0; | |
| 167 | for (Map.Entry<String, String> channel : channelIdByName.entrySet()) { | |
| 168 | String channelName = channel.getKey(); | |
| 169 | String channelId = channel.getValue(); | |
| 170 | Team team = teamByChannelName.get(channelName); | |
| 171 | List<String> members; | |
| 172 | try { | |
| 173 | members = slackService.listChannelMembers(token, channelId); | |
| 174 | } catch (SlackApiException e) { | |
| 175 |
1
1. accept : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log("Error listing members of #%s: %s".formatted(channelName, e.getMessage())); |
| 176 | continue; | |
| 177 | } | |
| 178 | membersByChannelName.put(channelName, members); | |
| 179 | ||
| 180 | // who belongs, with a label for the log; the instructor first | |
| 181 | Map<String, String> belonging = new LinkedHashMap<>(); | |
| 182 |
1
1. accept : negated conditional → KILLED |
if (instructorSlackId != null) { |
| 183 | belonging.put(instructorSlackId, "instructor " + currentCourse.getInstructorEmail()); | |
| 184 | } | |
| 185 | for (TeamMember member : | |
| 186 |
1
1. accept : negated conditional → KILLED |
team.getTeamMembers() == null ? List.<TeamMember>of() : team.getTeamMembers()) { |
| 187 | RosterStudent student = member.getRosterStudent(); | |
| 188 | String slackId = | |
| 189 |
2
1. accept : negated conditional → KILLED 2. accept : negated conditional → KILLED |
student == null || student.getEmail() == null |
| 190 | ? null | |
| 191 | : activeSlackIdByEmail.get(canonical(student.getEmail())); | |
| 192 |
1
1. accept : negated conditional → KILLED |
if (slackId == null) { |
| 193 |
1
1. accept : Changed increment from 1 to -1 → KILLED |
membersNotInSlack++; |
| 194 | } else { | |
| 195 | belonging.putIfAbsent(slackId, describe(student)); | |
| 196 | } | |
| 197 | } | |
| 198 | belongingIdsByChannelName.put(channelName, belonging.keySet()); | |
| 199 | ||
| 200 | List<Map.Entry<String, String>> toAdd = new ArrayList<>(); | |
| 201 | for (Map.Entry<String, String> person : belonging.entrySet()) { | |
| 202 |
1
1. accept : negated conditional → KILLED |
if (members.contains(person.getKey())) { |
| 203 |
1
1. accept : Replaced integer addition with subtraction → KILLED |
summary.membersAlreadyPresent++; |
| 204 | } else { | |
| 205 | toAdd.add(person); | |
| 206 | } | |
| 207 | } | |
| 208 |
1
1. accept : removed call to edu/ucsb/cs156/frontiers/jobs/SetupTeamSlackChannelsJob::addMembers → KILLED |
addMembers(ctx, token, channelName, channelId, toAdd, summary); |
| 209 | } | |
| 210 |
2
1. accept : negated conditional → KILLED 2. accept : changed conditional boundary → KILLED |
if (membersNotInSlack > 0) { |
| 211 |
1
1. accept : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log( |
| 212 | "%d team member(s) could not be added, because they do not have an active account in the Slack workspace; see the Slack tab. Run this job again once they have joined." | |
| 213 | .formatted(membersNotInSlack)); | |
| 214 | } | |
| 215 | ||
| 216 |
1
1. accept : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log("Removing Channel Members Who Are Not On The Team"); |
| 217 | channels: | |
| 218 | for (Map.Entry<String, String> channel : channelIdByName.entrySet()) { | |
| 219 | String channelName = channel.getKey(); | |
| 220 | List<String> members = membersByChannelName.get(channelName); | |
| 221 |
1
1. accept : negated conditional → KILLED |
if (members == null) { |
| 222 | continue; | |
| 223 | } | |
| 224 | for (String memberId : members) { | |
| 225 | SlackUser member = slackUsersById.get(memberId); | |
| 226 | boolean belongs = | |
| 227 |
1
1. accept : negated conditional → KILLED |
belongingIdsByChannelName.get(channelName).contains(memberId) |
| 228 |
1
1. accept : negated conditional → KILLED |
|| staffSlackIds.contains(memberId); |
| 229 | // Bots (including this one) and members who are not users of the workspace are left alone | |
| 230 |
3
1. accept : negated conditional → KILLED 2. accept : negated conditional → KILLED 3. accept : negated conditional → KILLED |
if (!belongs && member != null && member.isPerson()) { |
| 231 | try { | |
| 232 |
1
1. accept : removed call to edu/ucsb/cs156/frontiers/services/SlackService::removeFromChannel → KILLED |
slackService.removeFromChannel(token, channel.getValue(), memberId); |
| 233 |
1
1. accept : Replaced integer addition with subtraction → KILLED |
summary.membersRemoved++; |
| 234 |
1
1. accept : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log("Removed %s from #%s".formatted(describe(member), channelName)); |
| 235 | } catch (SlackApiException e) { | |
| 236 |
1
1. accept : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log( |
| 237 | "Error removing %s from #%s: %s" | |
| 238 | .formatted(describe(member), channelName, e.getMessage())); | |
| 239 |
1
1. accept : negated conditional → KILLED |
if (SlackService.RESTRICTED_ACTION.equals(e.getMessage())) { |
| 240 | // A workspace setting forbids it, so every other removal would fail the same way | |
| 241 |
1
1. accept : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log(SlackService.REMOVAL_RESTRICTED_ADVICE); |
| 242 | break channels; | |
| 243 | } | |
| 244 | } | |
| 245 | } | |
| 246 | } | |
| 247 | } | |
| 248 |
1
1. accept : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log( |
| 249 | "Done. Channels created: %d, already existed: %d. Members added: %d, already present: %d, removed: %d." | |
| 250 | .formatted( | |
| 251 | summary.channelsCreated, | |
| 252 | summary.channelsExisting, | |
| 253 | summary.membersAdded, | |
| 254 | summary.membersAlreadyPresent, | |
| 255 | summary.membersRemoved)); | |
| 256 | } | |
| 257 | ||
| 258 | /** The counts reported at the end of the log. */ | |
| 259 | private static class Summary { | |
| 260 | int channelsCreated; | |
| 261 | int channelsExisting; | |
| 262 | int membersAdded; | |
| 263 | int membersAlreadyPresent; | |
| 264 | int membersRemoved; | |
| 265 | } | |
| 266 | ||
| 267 | /** | |
| 268 | * Creates the channels that do not exist yet, and makes the bot a member of the ones that do. | |
| 269 | * | |
| 270 | * @return the id of each channel that is ready to be used, by name | |
| 271 | */ | |
| 272 | private Map<String, String> createChannels( | |
| 273 | JobContext ctx, String token, Map<String, Team> teamByChannelName, Summary summary) { | |
| 274 | Map<String, SlackChannel> existingByName = new HashMap<>(); | |
| 275 | for (SlackChannel existing : slackService.listPublicChannels(token)) { | |
| 276 | existingByName.put(existing.getName(), existing); | |
| 277 | } | |
| 278 | ||
| 279 | Map<String, String> channelIdByName = new LinkedHashMap<>(); | |
| 280 | for (Map.Entry<String, Team> entry : teamByChannelName.entrySet()) { | |
| 281 | String channelName = entry.getKey(); | |
| 282 | String teamName = entry.getValue().getName(); | |
| 283 | SlackChannel existing = existingByName.get(channelName); | |
| 284 | try { | |
| 285 |
1
1. createChannels : negated conditional → KILLED |
if (existing == null) { |
| 286 | SlackChannel created = slackService.createPublicChannel(token, channelName); | |
| 287 | channelIdByName.put(channelName, created.getId()); | |
| 288 |
1
1. createChannels : Replaced integer addition with subtraction → KILLED |
summary.channelsCreated++; |
| 289 |
1
1. createChannels : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log("Created channel #%s for team %s".formatted(channelName, teamName)); |
| 290 |
1
1. createChannels : negated conditional → KILLED |
} else if (existing.getArchived()) { |
| 291 |
1
1. createChannels : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log( |
| 292 | "Channel #%s for team %s already exists, but is archived; unarchive it in Slack, then run this job again. Skipping it." | |
| 293 | .formatted(channelName, teamName)); | |
| 294 | } else { | |
| 295 |
1
1. createChannels : removed call to edu/ucsb/cs156/frontiers/services/SlackService::joinChannel → KILLED |
slackService.joinChannel(token, existing.getId()); |
| 296 | channelIdByName.put(channelName, existing.getId()); | |
| 297 |
1
1. createChannels : Replaced integer addition with subtraction → KILLED |
summary.channelsExisting++; |
| 298 |
1
1. createChannels : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log("Channel #%s for team %s already exists".formatted(channelName, teamName)); |
| 299 | } | |
| 300 | } catch (SlackApiException e) { | |
| 301 |
1
1. createChannels : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log( |
| 302 | "Error setting up channel #%s for team %s: %s. Skipping it." | |
| 303 | .formatted(channelName, teamName, e.getMessage())); | |
| 304 | } | |
| 305 | } | |
| 306 |
1
1. createChannels : replaced return value with Collections.emptyMap for edu/ucsb/cs156/frontiers/jobs/SetupTeamSlackChannelsJob::createChannels → KILLED |
return channelIdByName; |
| 307 | } | |
| 308 | ||
| 309 | /** | |
| 310 | * Adds the people with one call to Slack. Slack adds all or none, so if that fails, they are | |
| 311 | * added one at a time, so that one problem person does not keep the others out. | |
| 312 | * | |
| 313 | * @param toAdd Slack id and description of each person to add | |
| 314 | */ | |
| 315 | private void addMembers( | |
| 316 | JobContext ctx, | |
| 317 | String token, | |
| 318 | String channelName, | |
| 319 | String channelId, | |
| 320 | List<Map.Entry<String, String>> toAdd, | |
| 321 | Summary summary) { | |
| 322 |
1
1. addMembers : negated conditional → KILLED |
if (toAdd.isEmpty()) { |
| 323 | return; | |
| 324 | } | |
| 325 | List<String> slackIds = toAdd.stream().map(Map.Entry::getKey).toList(); | |
| 326 | try { | |
| 327 |
1
1. addMembers : removed call to edu/ucsb/cs156/frontiers/services/SlackService::inviteToChannel → KILLED |
slackService.inviteToChannel(token, channelId, slackIds); |
| 328 | for (Map.Entry<String, String> person : toAdd) { | |
| 329 |
1
1. addMembers : Replaced integer addition with subtraction → KILLED |
summary.membersAdded++; |
| 330 |
1
1. addMembers : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log("Added %s to #%s".formatted(person.getValue(), channelName)); |
| 331 | } | |
| 332 | return; | |
| 333 | } catch (SlackApiException e) { | |
| 334 |
1
1. addMembers : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log( |
| 335 | "Could not add %d member(s) to #%s in one step (%s); adding them one at a time." | |
| 336 | .formatted(toAdd.size(), channelName, e.getMessage())); | |
| 337 | } | |
| 338 | for (Map.Entry<String, String> person : toAdd) { | |
| 339 | try { | |
| 340 |
1
1. addMembers : removed call to edu/ucsb/cs156/frontiers/services/SlackService::inviteToChannel → KILLED |
slackService.inviteToChannel(token, channelId, List.of(person.getKey())); |
| 341 |
1
1. addMembers : Replaced integer addition with subtraction → KILLED |
summary.membersAdded++; |
| 342 |
1
1. addMembers : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log("Added %s to #%s".formatted(person.getValue(), channelName)); |
| 343 | } catch (SlackApiException e) { | |
| 344 |
1
1. addMembers : removed call to edu/ucsb/cs156/jobs/services/JobContext::log → KILLED |
ctx.log( |
| 345 | "Error adding %s to #%s: %s".formatted(person.getValue(), channelName, e.getMessage())); | |
| 346 | } | |
| 347 | } | |
| 348 | } | |
| 349 | ||
| 350 | private static String describe(RosterStudent student) { | |
| 351 |
1
1. describe : replaced return value with "" for edu/ucsb/cs156/frontiers/jobs/SetupTeamSlackChannelsJob::describe → KILLED |
return "%s %s (%s)" |
| 352 | .formatted(student.getFirstName(), student.getLastName(), student.getEmail()); | |
| 353 | } | |
| 354 | ||
| 355 | private static String describe(SlackUser user) { | |
| 356 |
1
1. describe : replaced return value with "" for edu/ucsb/cs156/frontiers/jobs/SetupTeamSlackChannelsJob::describe → KILLED |
return "%s (%s)".formatted(user.getRealName(), user.email()); |
| 357 | } | |
| 358 | ||
| 359 | private static String canonical(String email) { | |
| 360 |
1
1. canonical : replaced return value with "" for edu/ucsb/cs156/frontiers/jobs/SetupTeamSlackChannelsJob::canonical → KILLED |
return CanonicalFormConverter.convertToValidEmail(email.strip()); |
| 361 | } | |
| 362 | } | |
Mutations | ||
| 63 |
1.1 |
|
| 68 |
1.1 |
|
| 80 |
1.1 |
|
| 83 |
1.1 |
|
| 91 |
1.1 |
|
| 98 |
1.1 2.2 |
|
| 110 |
1.1 |
|
| 115 |
1.1 2.2 |
|
| 120 |
1.1 |
|
| 125 |
1.1 |
|
| 134 |
1.1 2.2 |
|
| 138 |
1.1 |
|
| 148 |
1.1 |
|
| 151 |
1.1 2.2 |
|
| 152 |
1.1 |
|
| 158 |
1.1 |
|
| 163 |
1.1 |
|
| 175 |
1.1 |
|
| 182 |
1.1 |
|
| 186 |
1.1 |
|
| 189 |
1.1 2.2 |
|
| 192 |
1.1 |
|
| 193 |
1.1 |
|
| 202 |
1.1 |
|
| 203 |
1.1 |
|
| 208 |
1.1 |
|
| 210 |
1.1 2.2 |
|
| 211 |
1.1 |
|
| 216 |
1.1 |
|
| 221 |
1.1 |
|
| 227 |
1.1 |
|
| 228 |
1.1 |
|
| 230 |
1.1 2.2 3.3 |
|
| 232 |
1.1 |
|
| 233 |
1.1 |
|
| 234 |
1.1 |
|
| 236 |
1.1 |
|
| 239 |
1.1 |
|
| 241 |
1.1 |
|
| 248 |
1.1 |
|
| 285 |
1.1 |
|
| 288 |
1.1 |
|
| 289 |
1.1 |
|
| 290 |
1.1 |
|
| 291 |
1.1 |
|
| 295 |
1.1 |
|
| 297 |
1.1 |
|
| 298 |
1.1 |
|
| 301 |
1.1 |
|
| 306 |
1.1 |
|
| 322 |
1.1 |
|
| 327 |
1.1 |
|
| 329 |
1.1 |
|
| 330 |
1.1 |
|
| 334 |
1.1 |
|
| 340 |
1.1 |
|
| 341 |
1.1 |
|
| 342 |
1.1 |
|
| 344 |
1.1 |
|
| 351 |
1.1 |
|
| 356 |
1.1 |
|
| 360 |
1.1 |