Skip to content

Commit

Permalink
Merge branch 'develop' into 7085/v2/configure-messaging-code-of-conduct
Browse files Browse the repository at this point in the history
  • Loading branch information
nityanandaz committed Sep 13, 2023
2 parents 92fe251 + 4332d9e commit 75064e9
Show file tree
Hide file tree
Showing 26 changed files with 275 additions and 145 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ jobs:
if: ${{ github.event_name == 'release' }}
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
# Build and Push to GitHub Container Registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ plugins {
}

group = "de.tum.in.www1.artemis"
version = "6.4.3"
version = "6.5.0"
description = "Interactive Learning with Individual Feedback"

sourceCompatibility=17
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "artemis",
"version": "6.4.3",
"version": "6.5.0",
"description": "Interactive Learning with Individual Feedback",
"private": true,
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.core.env.Environment;
import org.springframework.core.env.Profiles;

import de.tum.in.www1.artemis.service.connectors.vcs.AbstractVersionControlService;
import tech.jhipster.config.JHipsterConstants;

/**
Expand Down Expand Up @@ -53,10 +54,14 @@ public void applicationPackagePointcut() {
*/
@AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
if (AbstractVersionControlService.isReadFullyShortReadOfBlockException(e)) {
// ignore
return;
}

if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT))) {
log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(),
e.getCause() != null ? e.getCause() : "NULL", e.getMessage(), e);

}
else {
log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(),
Expand Down Expand Up @@ -86,7 +91,6 @@ public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
}
catch (IllegalArgumentException e) {
log.error("Illegal argument: {} in {}.{}()", Arrays.toString(joinPoint.getArgs()), joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName());

throw e;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private static String getClasspathPublicSubPathLocation(String... subPaths) {
*/
private static String getFileSystemPublicSubPathResourceLocation(String... subPaths) {
var userDir = System.getProperty("user.dir");
var morePaths = Stream.concat(Stream.of("public"), Arrays.stream(subPaths)).toList().toArray(new String[1 + subPaths.length]);
var morePaths = Stream.concat(Stream.of("public"), Arrays.stream(subPaths)).toArray(String[]::new);
return "file:" + Path.of(userDir, morePaths) + "/";
}
}
27 changes: 26 additions & 1 deletion src/main/java/de/tum/in/www1/artemis/domain/UserGroup.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.tum.in.www1.artemis.domain;

import java.io.Serializable;
import java.util.Objects;

import javax.persistence.*;

Expand All @@ -18,12 +19,36 @@ public class UserGroup {
private String group;

@Embeddable
public class UserGroupKey implements Serializable {
public static class UserGroupKey implements Serializable {

@Column(name = "user_id")
private Long userId;

@Column(name = "`groups`")
private String group;

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

UserGroupKey that = (UserGroupKey) o;

if (!Objects.equals(userId, that.userId)) {
return false;
}
return Objects.equals(group, that.group);
}

@Override
public int hashCode() {
int result = userId != null ? userId.hashCode() : 0;
result = 31 * result + (group != null ? group.hashCode() : 0);
return result;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public Optional<Path> exportCourse(Course course, String outputDir, List<String>

Optional<Path> exportedCourse = zipExportedExercises(outputDir, exportErrors, notificationTopic, tmpCourseDir, exportedFiles);

log.info("Successfully exported course {}. The zip file is located at: {}", course.getId(), exportedCourse);
log.info("Successfully exported course {}. The zip file is located at: {}", course.getId(), exportedCourse.orElse(null));
return exportedCourse;
}

Expand Down Expand Up @@ -178,7 +178,7 @@ public Optional<Path> exportExam(Exam exam, String outputDir, List<String> expor

Optional<Path> exportedExamPath = zipExportedExercises(outputDir, exportErrors, notificationTopic, tempExamsDir, exportedExercises);

log.info("Successfully exported exam {}. The zip file is located at: {}", exam.getId(), exportedExamPath);
log.info("Successfully exported exam {}. The zip file is located at: {}", exam.getId(), exportedExamPath.orElse(null));
return exportedExamPath;
}

Expand Down Expand Up @@ -356,7 +356,7 @@ private List<Path> exportExercises(String notificationTopic, Set<Exercise> exerc

// Export exercises
for (var exercise : sortedExercises) {
log.info("Exporting exercise {} with id {} ", exercise.getTitle(), exercise.getId());
log.info("Exporting {} exercise {} with id {} ", exercise.getType(), exercise.getTitle(), exercise.getId());

// Notify the user after the progress
currentProgress++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ public StatsForDashboardDTO getStatsForDashboardDTO(Course course) {
*/
@Async
public void archiveCourse(Course course) {
long start = System.nanoTime();
SecurityUtils.setAuthorizationObject();

// Archiving a course is only possible after the course is over
Expand All @@ -746,7 +747,7 @@ public void archiveCourse(Course course) {
}

// This contains possible errors encountered during the archive process
ArrayList<String> exportErrors = new ArrayList<>();
List<String> exportErrors = Collections.synchronizedList(new ArrayList<>());

groupNotificationService.notifyInstructorGroupAboutCourseArchiveState(course, NotificationType.COURSE_ARCHIVE_STARTED, exportErrors);

Expand Down Expand Up @@ -775,6 +776,7 @@ public void archiveCourse(Course course) {
}

groupNotificationService.notifyInstructorGroupAboutCourseArchiveState(course, NotificationType.COURSE_ARCHIVE_FINISHED, exportErrors);
log.info("archive course took {}", TimeLogUtil.formatDurationFrom(start));
}

/**
Expand Down
Loading

0 comments on commit 75064e9

Please sign in to comment.