Skip to content

Commit

Permalink
Merge branch 'develop' into feature/text-exercises/highlight-selected…
Browse files Browse the repository at this point in the history
…-result
  • Loading branch information
FelixTJDietrich authored Dec 9, 2024
2 parents c2e972e + 390d00c commit 1c8bcf7
Show file tree
Hide file tree
Showing 93 changed files with 1,833 additions and 852 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Refer to [Using JHipster in production](http://www.jhipster.tech/production) for
The following command can automate the deployment to a server. The example shows the deployment to the main Artemis test server (which runs a virtual machine):

```shell
./artemis-server-cli deploy username@artemistest.ase.in.tum.de -w build/libs/Artemis-7.7.4.war
./artemis-server-cli deploy username@artemistest.ase.in.tum.de -w build/libs/Artemis-7.7.5.war
```

## Architecture
Expand Down
17 changes: 7 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ plugins {
}

group = "de.tum.cit.aet.artemis"
version = "7.7.4"
version = "7.7.5"
description = "Interactive Learning with Individual Feedback"

java {
Expand Down Expand Up @@ -135,8 +135,8 @@ test {
}
testLogging.showStandardStreams = true
reports.html.required = false
minHeapSize = "1024m" // initial heap size
maxHeapSize = "3072m" // maximum heap size
minHeapSize = "2g" // initial heap size
maxHeapSize = "8g" // maximum heap size
}

tasks.register("testReport", TestReport) {
Expand Down Expand Up @@ -215,9 +215,6 @@ repositories {
}
}

ext["jackson.version"] = fasterxml_version
ext["junit-jupiter.version"] = junit_version

dependencies {

// Note: jenkins-client is not well maintained and includes dependencies to libraries with critical security issues (e.g. CVE-2020-10683 for dom4j@1.6.1)
Expand Down Expand Up @@ -260,7 +257,7 @@ dependencies {
implementation "org.apache.lucene:lucene-queryparser:${lucene_version}"
implementation "org.apache.lucene:lucene-core:${lucene_version}"
implementation "org.apache.lucene:lucene-analyzers-common:${lucene_version}"
implementation "com.google.protobuf:protobuf-java:4.29.0"
implementation "com.google.protobuf:protobuf-java:4.29.1"

// we have to override those values to use the latest version
implementation "org.slf4j:jcl-over-slf4j:${slf4j_version}"
Expand Down Expand Up @@ -540,8 +537,8 @@ dependencies {
exclude module: "android-json"
}

// cannot update due to "Syntax error in SQL statement "WITH ids_to_delete"
// testImplementation "com.h2database:h2:2.3.230"
// NOTE: cannot update due to "Syntax error in SQL statement "WITH ids_to_delete" --> should be resolved when we collapse the changelogs again for Artemis 8.0
// testImplementation "com.h2database:h2:2.3.232"
testImplementation "com.h2database:h2:2.2.224"

// Lightweight JSON library needed for the internals of the MockRestServiceServer
Expand All @@ -553,7 +550,7 @@ dependencies {

dependencyManagement {
imports {
mavenBom "io.zonky.test.postgres:embedded-postgres-binaries-bom:17.0.0"
mavenBom "io.zonky.test.postgres:embedded-postgres-binaries-bom:17.2.0"
}
}

Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spring_boot_version=3.4.0
spring_framework_version=6.2.0
spring_cloud_version=4.2.0
spring_security_version=6.4.1
# TODO: upgrading to 6.6.0 currently leads to issues due to internal changes in Hibernate and potentially wrong use in Artemis server code
# TODO: upgrading to 6.6.x currently leads to issues due to internal changes in Hibernate and potentially wrong use in Artemis server code
hibernate_version=6.4.10.Final
# TODO: can we update to 5.x?
opensaml_version=4.3.2
Expand All @@ -23,8 +23,8 @@ jgit_version=7.1.0.202411261347-r
sshd_version=2.14.0
checkstyle_version=10.20.2
jplag_version=5.1.0
# not really used in Artemis, nor Jplag, nor the used version of Stanford CoreNLP, but we use the latest to avoid security vulnerabilities
# NOTE: we do not need to use the latest version 9.x here as long as Stanford CoreNLP does not reference it
# not really used in Artemis, nor JPlag, nor the used version of Stanford CoreNLP, but we use the latest to avoid security vulnerability warnings
# NOTE: we cannot need to use the latest version 9.x or 10.x here as long as Stanford CoreNLP does not reference it
lucene_version=8.11.4
slf4j_version=2.0.16
sentry_version=7.18.1
Expand All @@ -49,7 +49,7 @@ apt_plugin_version=0.21
liquibase_plugin_version=2.1.1
modernizer_plugin_version=1.10.0

org.gradle.jvmargs=-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en \
org.gradle.jvmargs=-Xmx2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en \
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
Expand Down
36 changes: 18 additions & 18 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "artemis",
"version": "7.7.4",
"version": "7.7.5",
"description": "Interactive Learning with Individual Feedback",
"private": true,
"license": "MIT",
Expand Down Expand Up @@ -68,7 +68,7 @@
"ngx-webstorage": "18.0.0",
"papaparse": "5.4.1",
"pdf-lib": "1.17.1",
"pdfjs-dist": "4.9.124",
"pdfjs-dist": "4.9.155",
"rxjs": "7.8.1",
"simple-statistics": "7.8.7",
"smoothscroll-polyfill": "0.4.4",
Expand Down Expand Up @@ -154,13 +154,13 @@
"jest-extended": "4.0.2",
"jest-fail-on-console": "3.3.1",
"jest-junit": "16.0.0",
"jest-preset-angular": "14.4.1",
"jest-preset-angular": "14.4.2",
"lint-staged": "15.2.10",
"ngxtension": "4.1.0",
"ng-mocks": "14.13.1",
"prettier": "3.4.1",
"prettier": "3.4.2",
"rimraf": "6.0.1",
"sass": "1.81.0",
"sass": "1.82.0",
"ts-jest": "29.2.5",
"typescript": "5.5.4",
"weak-napi": "2.0.2"
Expand Down
4 changes: 1 addition & 3 deletions ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ http://pmd.sourceforge.net/ruleset/2.0.0 ">

<rule ref="category/java/codestyle.xml/MethodNamingConventions">
<description>
Allows underscores in JUnit 4 and 5 test methods
Allows underscores in JUnit 5 test methods
Template from https://pmd.github.io/pmd-6.40.0/pmd_userdocs_making_rulesets.html#creating-a-ruleset
</description>
<properties>
<property name="methodPattern" value="[a-z][a-zA-Z0-9]*"/>
<property name="staticPattern" value="[a-z][a-zA-Z0-9]*"/>
<property name="nativePattern" value="[a-z][a-zA-Z0-9]*"/>
<property name="junit3TestPattern" value="test[A-Z0-9][a-zA-Z0-9]*"/>
<property name="junit4TestPattern" value="[a-z][a-zA-Z0-9_]*"/>
<property name="junit5TestPattern" value="[a-z][a-zA-Z0-9_]*"/>
</properties>
</rule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ default List<Result> findLatestAutomaticResultsWithEagerFeedbacksTestCasesForExe

Optional<Result> findFirstByParticipationIdOrderByCompletionDateDesc(long participationId);

Optional<Result> findFirstByParticipationIdAndAssessmentTypeOrderByCompletionDateDesc(long participationId, AssessmentType assessmentType);

@EntityGraph(type = LOAD, attributePaths = { "feedbacks", "feedbacks.testCase" })
Optional<Result> findResultWithFeedbacksAndTestCasesById(long resultId);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package de.tum.cit.aet.artemis.athena.dto;

import java.util.List;

import jakarta.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonInclude;
Expand All @@ -13,7 +11,7 @@
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public record ModelingFeedbackDTO(long id, long exerciseId, long submissionId, String title, String description, double credits, Long structuredGradingInstructionId,
List<String> elementIds) implements FeedbackBaseDTO {
String reference) implements FeedbackBaseDTO {

/**
* Creates a ModelingFeedbackDTO from a Feedback object
Expand All @@ -30,6 +28,6 @@ public static ModelingFeedbackDTO of(long exerciseId, long submissionId, @NotNul
}

return new ModelingFeedbackDTO(feedback.getId(), exerciseId, submissionId, feedback.getText(), feedback.getDetailText(), feedback.getCredits(), gradingInstructionId,
List.of(feedback.getReference()));
feedback.getReference());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ public void stopContainer(String containerName) {
// Get the container ID.
String containerId = container.getId();

log.info("Stopping container with id {}", containerId);

// Create a file "stop_container.txt" in the root directory of the container to indicate that the test results have been extracted or that the container should be stopped
// for some other reason.
// The container's main process is waiting for this file to appear and then stops the main process, thus stopping and removing the container.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,18 @@ private BuildResult runScriptAndParseResults(BuildJobQueueItem buildJob, String

ZonedDateTime buildCompletedDate = ZonedDateTime.now();

msg = "~~~~~~~~~~~~~~~~~~~~ Moving test results to specified directory for build job " + buildJob.id() + " ~~~~~~~~~~~~~~~~~~~~";
buildLogsMap.appendBuildLogEntry(buildJob.id(), msg);
log.debug(msg);

buildJobContainerService.moveResultsToSpecifiedDirectory(containerId, buildJob.buildConfig().resultPaths(), LOCALCI_WORKING_DIRECTORY + LOCALCI_RESULTS_DIRECTORY);

// Get an input stream of the test result files.

msg = "~~~~~~~~~~~~~~~~~~~~ Collecting test results from container " + containerId + " for build job " + buildJob.id() + " ~~~~~~~~~~~~~~~~~~~~";
buildLogsMap.appendBuildLogEntry(buildJob.id(), msg);
log.info(msg);

TarArchiveInputStream testResultsTarInputStream;

try {
Expand Down Expand Up @@ -349,6 +357,10 @@ private BuildResult runScriptAndParseResults(BuildJobQueueItem buildJob, String
}
}

msg = "~~~~~~~~~~~~~~~~~~~~ Parsing test results for build job " + buildJob.id() + " ~~~~~~~~~~~~~~~~~~~~";
buildLogsMap.appendBuildLogEntry(buildJob.id(), msg);
log.info(msg);

BuildResult buildResult;
try {
buildResult = parseTestResults(testResultsTarInputStream, buildJob.buildConfig().branch(), assignmentRepoCommitHash, testRepoCommitHash, buildCompletedDate,
Expand All @@ -362,7 +374,7 @@ private BuildResult runScriptAndParseResults(BuildJobQueueItem buildJob, String
}

msg = "Building and testing submission for repository " + assignmentRepositoryUri.repositorySlug() + " and commit hash " + assignmentRepoCommitHash + " took "
+ TimeLogUtil.formatDurationFrom(timeNanoStart);
+ TimeLogUtil.formatDurationFrom(timeNanoStart) + " for build job " + buildJob.id();
buildLogsMap.appendBuildLogEntry(buildJob.id(), msg);
log.info(msg);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Supplier;

Expand Down Expand Up @@ -176,6 +177,9 @@ public CompletableFuture<BuildResult> executeBuildJob(BuildJobQueueItem buildJob
}
else {
finishBuildJobExceptionally(buildJobItem.id(), containerName, e);
if (e instanceof TimeoutException) {
logTimedOutBuildJob(buildJobItem, buildJobTimeoutSeconds);
}
throw new CompletionException(e);
}
}
Expand All @@ -188,6 +192,18 @@ public CompletableFuture<BuildResult> executeBuildJob(BuildJobQueueItem buildJob
}));
}

private void logTimedOutBuildJob(BuildJobQueueItem buildJobItem, int buildJobTimeoutSeconds) {
String msg = "Timed out after " + buildJobTimeoutSeconds + " seconds. "
+ "This may be due to an infinite loop or inefficient code. Please review your code for potential issues. "
+ "If the problem persists, contact your instructor for assistance. (Build job ID: " + buildJobItem.id() + ")";
buildLogsMap.appendBuildLogEntry(buildJobItem.id(), msg);
log.warn(msg);

msg = "Executing build job with id " + buildJobItem.id() + " timed out after " + buildJobTimeoutSeconds + " seconds."
+ "This may be due to strict timeout settings. Consider increasing the exercise timeout and applying stricter timeout constraints within the test cases using @StrictTimeout.";
buildLogsMap.appendBuildLogEntry(buildJobItem.id(), msg);
}

Set<String> getRunningBuildJobIds() {
return Set.copyOf(runningFutures.keySet());
}
Expand Down
Loading

0 comments on commit 1c8bcf7

Please sign in to comment.