Skip to content

Commit

Permalink
Merge branch 'develop' into feature/faq/implement-faq-basis
Browse files Browse the repository at this point in the history
  • Loading branch information
cremertim committed Sep 23, 2024
2 parents f33cad4 + 00f38c0 commit aff8ad6
Show file tree
Hide file tree
Showing 15 changed files with 228 additions and 108 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,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.28.2"

// we have to override those values to use the latest version
implementation "org.slf4j:jcl-over-slf4j:${slf4j_version}"
Expand Down
164 changes: 82 additions & 82 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
],
"dependencies": {
"@angular/animations": "18.2.5",
"@angular/cdk": "18.2.4",
"@angular/cdk": "18.2.5",
"@angular/common": "18.2.5",
"@angular/compiler": "18.2.5",
"@angular/core": "18.2.5",
"@angular/forms": "18.2.5",
"@angular/localize": "18.2.5",
"@angular/material": "18.2.4",
"@angular/material": "18.2.5",
"@angular/platform-browser": "18.2.5",
"@angular/platform-browser-dynamic": "18.2.5",
"@angular/router": "18.2.5",
Expand Down Expand Up @@ -58,12 +58,12 @@
"jszip": "3.10.1",
"lodash-es": "4.17.21",
"mobile-drag-drop": "3.0.0-rc.0",
"monaco-editor": "0.51.0",
"monaco-editor": "0.52.0",
"ngx-infinite-scroll": "18.0.0",
"ngx-webstorage": "18.0.0",
"papaparse": "5.4.1",
"pdfjs-dist": "4.6.82",
"posthog-js": "1.161.6",
"posthog-js": "1.163.0",
"rxjs": "7.8.1",
"showdown": "2.1.0",
"showdown-highlight": "3.1.0",
Expand All @@ -88,13 +88,13 @@
"d3-transition": "^3.0.1"
},
"@typescript-eslint/utils": {
"eslint": "^9.10.0"
"eslint": "^9.11.0"
},
"braces": "3.0.3",
"critters": "0.0.24",
"debug": "4.3.7",
"eslint-plugin-deprecation": {
"eslint": "^9.10.0"
"eslint": "^9.11.0"
},
"eslint-plugin-jest": {
"@typescript-eslint/eslint-plugin": "^8.6.0"
Expand All @@ -116,13 +116,13 @@
},
"devDependencies": {
"@angular-builders/jest": "18.0.0",
"@angular-devkit/build-angular": "18.2.4",
"@angular-devkit/build-angular": "18.2.5",
"@angular-eslint/builder": "18.3.1",
"@angular-eslint/eslint-plugin": "18.3.1",
"@angular-eslint/eslint-plugin-template": "18.3.1",
"@angular-eslint/schematics": "18.3.1",
"@angular-eslint/template-parser": "18.3.1",
"@angular/cli": "18.2.4",
"@angular/cli": "18.2.5",
"@angular/compiler-cli": "18.2.5",
"@angular/language-service": "18.2.5",
"@sentry/types": "8.30.0",
Expand All @@ -139,7 +139,7 @@
"@types/uuid": "10.0.0",
"@typescript-eslint/eslint-plugin": "8.6.0",
"@typescript-eslint/parser": "8.6.0",
"eslint": "9.10.0",
"eslint": "9.11.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-deprecation": "3.0.0",
"eslint-plugin-jest": "28.8.3",
Expand All @@ -158,7 +158,7 @@
"ng-mocks": "14.13.1",
"prettier": "3.3.3",
"rimraf": "6.0.1",
"sass": "1.79.1",
"sass": "1.79.3",
"ts-jest": "29.2.5",
"typescript": "5.5.4",
"weak-napi": "2.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_LOCALCI;
import static de.tum.cit.aet.artemis.programming.domain.ProgrammingLanguage.ASSEMBLER;
import static de.tum.cit.aet.artemis.programming.domain.ProgrammingLanguage.C;
import static de.tum.cit.aet.artemis.programming.domain.ProgrammingLanguage.EMPTY;
import static de.tum.cit.aet.artemis.programming.domain.ProgrammingLanguage.HASKELL;
import static de.tum.cit.aet.artemis.programming.domain.ProgrammingLanguage.JAVA;
import static de.tum.cit.aet.artemis.programming.domain.ProgrammingLanguage.JAVASCRIPT;
Expand Down Expand Up @@ -37,7 +38,7 @@ public class LocalCIProgrammingLanguageFeatureService extends ProgrammingLanguag

public LocalCIProgrammingLanguageFeatureService() {
// Must be extended once a new programming language is added
// TODO LOCALVC_CI: Local CI is not supporting EMPTY at the moment.
programmingLanguageFeatures.put(EMPTY, new ProgrammingLanguageFeature(EMPTY, false, false, false, false, false, List.of(), false, true));
programmingLanguageFeatures.put(JAVA,
new ProgrammingLanguageFeature(JAVA, true, true, true, true, false, List.of(PLAIN_GRADLE, GRADLE_GRADLE, PLAIN_MAVEN, MAVEN_MAVEN), false, true));
programmingLanguageFeatures.put(PYTHON, new ProgrammingLanguageFeature(PYTHON, false, false, true, false, false, List.of(), false, true));
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ artemis:
# possible overrides: maven, gradle
default: "ls1tum/artemis-maven-template:java17-21"
empty:
default: "ls1tum/artemis-maven-template:java17-21"
default: "ubuntu:24.04"
python:
default: "ls1tum/artemis-python-docker:latest"
c:
Expand Down
37 changes: 37 additions & 0 deletions src/main/resources/templates/aeolus/empty/default.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -e
export AEOLUS_INITIAL_DIRECTORY=${PWD}
install_dependencies () {
echo '⚙️ executing install_dependencies'
# TODO: Install dependencies not provided by the Docker image
echo 'Install dependencies'
}

run_tests () {
echo '⚙️ executing run_tests'
# TODO: Run the tests and generate JUnit XMLs
echo 'Hello World'
}

process_results () {
echo '⚙️ executing process_results'
rm -rf results
mkdir results
# TODO: Move JUnit XMLs into the results directory
}

main () {
if [[ "${1}" == "aeolus_sourcing" ]]; then
return 0 # just source to use the methods in the subshell, no execution
fi
local _script_name
_script_name=${BASH_SOURCE[0]:-$0}
cd "${AEOLUS_INITIAL_DIRECTORY}"
bash -c "source ${_script_name} aeolus_sourcing; install_dependencies"
cd "${AEOLUS_INITIAL_DIRECTORY}"
bash -c "source ${_script_name} aeolus_sourcing; run_tests"
cd "${AEOLUS_INITIAL_DIRECTORY}"
bash -c "source ${_script_name} aeolus_sourcing; process_results"
}

main "${@}"
23 changes: 23 additions & 0 deletions src/main/resources/templates/aeolus/empty/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
api: v0.0.1
metadata:
name: Empty
id: empty
description: Provides a starting point
actions:
- name: install_dependencies
script: |-
# TODO: Install dependencies not provided by the Docker image
echo 'Install dependencies'
- name: run_tests
script: |-
# TODO: Run the tests and generate JUnit XMLs
echo 'Hello World'
- name: process_results
script: |-
rm -rf results
mkdir results
# TODO: Move JUnit XMLs into the results directory
results:
- name: junit
path: results/*.xml
type: junit
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ test-job:
- git clone --branch ${ARTEMIS_SUBMISSION_GIT_BRANCH} ${CI_SERVER_PROTOCOL}://${ARTEMIS_TEST_GIT_USER}:${ARTEMIS_TEST_GIT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME} assignment
- export ARTEMIS_NOTIFICATION_SECRET=[hidden] # Workaround for overwriting the secret
- export ARTEMIS_TEST_GIT_TOKEN=[hidden]
- mvn --version && echo "ARTEMIS_BUILD_STATUS=success" > .env || echo "ARTEMIS_BUILD_STATUS=failed" > .env
# TODO: Install dependencies not provided by the Docker image
# TODO: Run the tests and generate JUnit XMLs
- echo "Hello World" && echo "ARTEMIS_BUILD_STATUS=success" > .env || echo "ARTEMIS_BUILD_STATUS=failed" > .env
# TODO: Move JUnit XMLs into the ${ARTEMIS_TEST_RESULTS_DIR} directory
after_script:
- echo "ARTEMIS_TEST_GIT_HASH=$(git rev-parse HEAD)" >> .env
- echo "ARTEMIS_SUBMISSION_GIT_HASH=${CI_COMMIT_SHA}" >> .env
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ private void runTestSteps() {
* Run unit tests
*/
private void test() {
stage('Build') {
sh '''
mvn --version
'''
stage('Install dependencies') {
// TODO: Install dependencies not provided by the Docker image
sh 'echo "Install dependencies"'
}
stage('Run tests') {
// TODO: Run the tests and generate JUnit XMLs
sh 'echo "Hello World"'
}
}

Expand All @@ -45,6 +48,7 @@ void postBuildTasks() {
rm -rf results
mkdir results
'''
// TODO: Move JUnit XMLs into the results directory
}

// very important, do not remove
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export class ProgrammingExerciseUpdateComponent implements AfterViewInit, OnDest
} else {
this.programmingExercise.buildConfig = new ProgrammingExerciseBuildConfig();
}
this.programmingExercise.customizeBuildPlanWithAeolus = language === ProgrammingLanguage.EMPTY;
}

// If we switch to another language which does not support static code analysis we need to reset options related to static code analysis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,28 @@
}
</div>
}
@if (programmingExercise.programmingLanguage === ProgrammingLanguage.EMPTY) {
<div>
<p>
<fa-icon [icon]="faExclamationTriangle" size="xl" class="text-warning"></fa-icon>
<span jhiTranslate="artemisApp.programmingExercise.otherLanguageHints.title" [translateValues]="{ documentationLink: DOCUMENTATION_LINK }"></span>
</p>
<ol>
<li jhiTranslate="artemisApp.programmingExercise.otherLanguageHints.setImage" [translateValues]="DOCKER_REGISTRY_LINKS"></li>
<li>
<p jhiTranslate="artemisApp.programmingExercise.otherLanguageHints.buildScript.title" class="mb-0"></p>
<ol>
<li jhiTranslate="artemisApp.programmingExercise.otherLanguageHints.buildScript.dependencies"></li>
<li jhiTranslate="artemisApp.programmingExercise.otherLanguageHints.buildScript.runTests"></li>
<li jhiTranslate="artemisApp.programmingExercise.otherLanguageHints.buildScript.moveResults" [translateValues]="{ resultsDirectory: './results/' }"></li>
</ol>
</li>
<li jhiTranslate="artemisApp.programmingExercise.otherLanguageHints.pushExercise" [translateValues]="{ checkoutDirectory: './assignment/' }"></li>
<li jhiTranslate="artemisApp.programmingExercise.otherLanguageHints.pushSolution"></li>
<li jhiTranslate="artemisApp.programmingExercise.otherLanguageHints.pushTest" [translateValues]="{ checkoutDirectory: './' }"></li>
</ol>
</div>
}
@if (programmingExercise.programmingLanguage && programmingExerciseCreationConfig.packageNameRequired && programmingExercise.projectType !== ProjectType.XCODE) {
<div class="form-group">
<label class="label-narrow" jhiTranslate="artemisApp.programmingExercise.packageName" for="field_packageName"></label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AfterViewChecked, AfterViewInit, Component, EventEmitter, Input, OnDestroy, ViewChild } from '@angular/core';
import { ProgrammingExercise, ProgrammingLanguage, ProjectType } from 'app/entities/programming/programming-exercise.model';
import { faQuestionCircle } from '@fortawesome/free-solid-svg-icons';
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { ProgrammingExerciseCreationConfig } from 'app/exercises/programming/manage/update/programming-exercise-creation-config';
import { PROFILE_AEOLUS, PROFILE_LOCALCI } from 'app/app.constants';
import { NgModel } from '@angular/forms';
Expand Down Expand Up @@ -32,10 +32,16 @@ export class ProgrammingExerciseLanguageComponent implements AfterViewChecked, A

fieldSubscriptions: (Subscription | undefined)[] = [];

faQuestionCircle = faQuestionCircle;
faExclamationTriangle = faExclamationTriangle;
protected readonly PROFILE_LOCALCI = PROFILE_LOCALCI;
protected readonly PROFILE_AEOLUS = PROFILE_AEOLUS;

readonly DOCKER_REGISTRY_LINKS = {
ghcrLink: 'https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry',
dockerhubLink: 'https://hub.docker.com/',
};
readonly DOCUMENTATION_LINK = 'https://docs.artemis.cit.tum.de/user/exercises/programming.html';

ngAfterViewInit() {
this.fieldSubscriptions.push(this.selectLanguageField.valueChanges?.subscribe(() => setTimeout(() => this.calculateFormValid())));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@
</div>
}
@if (!loading && !binaryFile!! && !cannotLoadFiles) {
<div
class="text-submission-viewer"
[innerHTML]="fileContent || ' '"
[ngClass]="{ 'no-file': !fileContent, 'is-code': isProgrammingExercise }"
jhiTranslate="artemisApp.plagiarism.noFileSelected"
></div>
<div class="text-submission-viewer" [innerHTML]="fileContent || ' '" [ngClass]="{ 'no-file': !fileContent, 'is-code': isProgrammingExercise }">
<span jhiTranslate="artemisApp.plagiarism.noFileSelected"></span>
</div>
}
@if (loading && !cannotLoadFiles) {
<div class="plagiarism-submission-loader">
Expand Down
13 changes: 13 additions & 0 deletions src/main/webapp/i18n/de/programmingExercise.json
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,19 @@
"template": "Vorlage",
"history": "Commit-Historie",
"result": "Ergebnis"
},
"otherLanguageHints": {
"title": "Führe folgende Schritte aus, um eine andere Sprache zu benutzen. Siehe die <a href=\"{{documentationLink}}\">Dokumentation</a> für Details.",
"setImage": "Lege ein angepasstes Docker Image mit benötigten Abhängigkeiten fest (erstelle möglicherweise ein eigenes und lade es in die <a href=\"{{ghcrLink}}\">GitHub Container Registry</a> oder auf den <a href=\"{{dockerhubLink}}\">Docker Hub</a> hoch).",
"buildScript": {
"title": "Passe das Build Skript an:",
"dependencies": "Optional: Installiere aufgabenspezifische Abhängigkeiten.",
"runTests": "Führe alle Tests aus. Sie sollten JUnit XML Dateien generieren.",
"moveResults": "Bewege die XML Dateien in das <code>{{resultsDirectory}}</code> Verzeichnis."
},
"pushExercise": "Lade den Aufgaben-Code in das entsprechende Repository. Es wird in <code>{{checkoutDirectory}}</code> ausgecheckt.",
"pushSolution": "Lade den Lösungs-Code in das entsprechende Repository. Es wird nicht ausgecheckt.",
"pushTest": "Lade den Test-Code in das entsprechende Repository. Es wird in <code>{{checkoutDirectory}}</code> ausgecheckt."
}
},
"error": {
Expand Down
13 changes: 13 additions & 0 deletions src/main/webapp/i18n/en/programmingExercise.json
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,19 @@
"template": "Template",
"history": "Commit History",
"result": "Result"
},
"otherLanguageHints": {
"title": "To use another language, complete the following tasks. See the <a href=\"{{documentationLink}}\">documentation</a> for details.",
"setImage": "Specify a custom Docker image with the required dependencies (potentially create a custom one and upload it to the <a href=\"{{ghcrLink}}\">GitHub Container Registry</a> or <a href=\"{{dockerhubLink}}\">Docker Hub</a>).",
"buildScript": {
"title": "Customize the build script to:",
"dependencies": "Optional: Install exercise specific dependencies.",
"runTests": "Run all tests. They should generate JUnit XML files.",
"moveResults": "Move the XML files into the <code>{{resultsDirectory}}</code> directory."
},
"pushExercise": "Push the exercise code to its repository. It will be checked out at <code>{{checkoutDirectory}}</code>.",
"pushSolution": "Push the solution code to its repository. It will not be checked out.",
"pushTest": "Push the test code to its repository. It will be checked out in <code>{{checkoutDirectory}}</code>."
}
},
"error": {
Expand Down

0 comments on commit aff8ad6

Please sign in to comment.