Skip to content

Commit

Permalink
Merge branch 'develop' into chore/vcs-access-log/make-async
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonEntholzer authored Oct 19, 2024
2 parents cc3f916 + 1a7959e commit ecdb10e
Show file tree
Hide file tree
Showing 124 changed files with 3,759 additions and 549 deletions.
144 changes: 144 additions & 0 deletions .github/issue-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
assessment:
- assessment
- bonus
- complaint
- submission
- grading
- grade
- score
- caseSensitive: false

athena:
- athena
- caseSensitive: false

atlas:
- atlas
- competency
- competencies
- knowledge area
- learning path
- learner profile
- science event
- adaptive learning
- caseSensitive: false

buildagent:
- buildagent
- build agent
- buildjob
- build job
- build result
- caseSensitive: false

communication:
- communication
- conversation
- notification
- agreement
- faq
- post
- reaction
- chat
- message
- caseSensitive: false

core:
- user-management
- authority
- data export
- migration
- user
- group
- caseSensitive: false

exam:
- exam
- exercisegroup
- student exam
- suspicious behavior
- suspicious behaviour
- caseSensitive: false

exercise:
- exercise
- participation
- participant
- difficulty
- lifecycle
- team
- assignment
- caseSensitive: false

fileupload:
- fileupload
- upload
- caseSensitive: false

iris:
- iris
- llm
- chatbot
- ai
- caseSensitive: false

lecture:
- lecture
- attachment
- online
- slide
- video
- text unit
- caseSensitive: false

lti:
- lti
- online course
- caseSensitive: false

modeling:
- modeling
- diagram
- uml
- caseSensitive: false

plagiarism:
- plagiarism
- caseSensitive: false

programming:
- programming
- build
- build plan
- code hint
- git
- testwise coverage
- ide
- submission policy
- aeolus
- penalty
- auxilary
- commit
- project
- static code analysis
- caseSensitive: false

quiz:
- quiz
- drag
- drop
- single choice
- multiple choice
- batch
- short answer
- caseSensitive: false

text:
- text
- block
- caseSensitive: false

tutorialgroup:
- tutorialgroup
- session
- caseSensitive: false
26 changes: 24 additions & 2 deletions .github/workflows/analysis-of-endpoint-connections.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,16 @@ jobs:
path: supporting_scripts/analysis-of-endpoint-connections/

- name: Analyze endpoints
run:
run: |
./gradlew :supporting_scripts:analysis-of-endpoint-connections:runEndpointAnalysis
continue-on-error: true
id: endpointAnalysis

- name: Analyze rest calls
run:
run: |
./gradlew :supporting_scripts:analysis-of-endpoint-connections:runRestCallAnalysis
continue-on-error: true
id: restCallAnalysis

- name: Upload analysis results
uses: actions/upload-artifact@v4
Expand All @@ -93,3 +97,21 @@ jobs:
path: |
supporting_scripts/analysis-of-endpoint-connections/endpointAnalysisResult.json
supporting_scripts/analysis-of-endpoint-connections/restCallAnalysisResult.json
- name: Check if any step failed
run: |
if [ "${{ steps.endpointAnalysis.outcome }}" != "success" ] &&
[ "${{ steps.restCallAnalysis.outcome }}" != "success" ]; then
echo "Endpoints and REST calls could not be matched."
exit 1
fi
if [ "${{ steps.endpointAnalysis.outcome }}" == "success" ] &&
[ "${{ steps.restCallAnalysis.outcome }}" != "success" ]; then
echo "REST calls could not be matched."
exit 1
fi
if [ "${{ steps.endpointAnalysis.outcome }}" != "success" ] &&
[ "${{ steps.restCallAnalysis.outcome }}" == "success" ]; then
echo "Endpoints could not be matched."
exit 1
fi
17 changes: 17 additions & 0 deletions .github/workflows/issue-labler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Issue Labeler"
on:
issues:
types: [opened, edited]

permissions:
issues: write
contents: read

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: MaximilianAnzinger/[email protected]
with:
configuration-path: .github/issue-labeler.yml
repo-token: ${{ github.token }}
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ dependencies {
implementation "de.jplag:jplag:${jplag_version}"

implementation "de.jplag:c:${jplag_version}"
implementation "de.jplag:cpp:${jplag_version}"
implementation "de.jplag:java:${jplag_version}"
implementation "de.jplag:javascript:${jplag_version}"
implementation "de.jplag:kotlin:${jplag_version}"
Expand Down
4 changes: 4 additions & 0 deletions docs/user/exercises/programming-exercise-features.inc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Instructors can still use those templates to generate programming exercises and
+----------------------+----------+---------+
| R | yes | yes |
+----------------------+----------+---------+
| C++ | yes | yes |
+----------------------+----------+---------+

- Not all ``templates`` support the same feature set and supported features can also change depending on the continuous integration system setup.
Depending on the feature set, some options might not be available during the creation of the programming exercise.
Expand Down Expand Up @@ -75,6 +77,8 @@ Instructors can still use those templates to generate programming exercises and
+----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+
| R | no | no | yes | no | n/a | no | no | L: yes, J: no |
+----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+
| C++ | no | no | yes | no | n/a | no | no | L: yes, J: no |
+----------------------+----------------------+----------------------+---------------------+--------------+------------------------------------------+------------------------------+----------------------------+------------------------+

- *Sequential Test Runs*: ``Artemis`` can generate a build plan which first executes structural and then behavioral tests. This feature can help students to better concentrate on the immediate challenge at hand.
- *Static Code Analysis*: ``Artemis`` can generate a build plan which additionally executes static code analysis tools.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import java.util.Locale;
import java.util.Set;

import org.commonmark.parser.Parser;
import org.commonmark.renderer.html.HtmlRenderer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
Expand Down Expand Up @@ -261,6 +263,18 @@ public void sendNotification(Notification notification, User user, Object notifi
// posts use a different mechanism for the url
context.setVariable(NOTIFICATION_URL, extractNotificationUrl(post, artemisServerUrl.toString()));
subject = createAnnouncementText(notificationSubject, locale);

// Render markdown content of post to html
try {
Parser parser = Parser.builder().build();
HtmlRenderer renderer = HtmlRenderer.builder().build();
String postContent = post.getContent();
String renderedPostContent = renderer.render(parser.parse(postContent));
post.setContent(renderedPostContent);
}
catch (Exception e) {
// In case something goes wrong, leave content of post as-is
}
}
else {
context.setVariable(NOTIFICATION_URL, extractNotificationUrl(notification, artemisServerUrl.toString()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ public void addResourceHandlers(@NotNull ResourceHandlerRegistry registry) {
// Add caching for course icons, user profile pictures, and drag and drop quiz pictures
// Add resource handlers for dynamic image paths based on fileUploadPath
// TODO: those paths have to be the same as in FilePathService, ideally we reuse the constants and define them only once
registry.addResourceHandler("/images/course/icons/**").addResourceLocations("file:" + fileUploadPath + "/images/course/icons/").setCacheControl(defaultCacheControl);
registry.addResourceHandler("/course/icons/**").addResourceLocations("file:" + fileUploadPath + "/images/course/icons/").setCacheControl(defaultCacheControl);

registry.addResourceHandler("/images/user/profile-pictures/**").addResourceLocations("file:" + fileUploadPath + "/images/user/profile-pictures/")
registry.addResourceHandler("/user/profile-pictures/**").addResourceLocations("file:" + fileUploadPath + "/images/user/profile-pictures/")
.setCacheControl(defaultCacheControl);

registry.addResourceHandler("/images/drag-and-drop/**").addResourceLocations("file:" + fileUploadPath + "/images/drag-and-drop/").setCacheControl(defaultCacheControl);
registry.addResourceHandler("/drag-and-drop/**").addResourceLocations("file:" + fileUploadPath + "/images/drag-and-drop/").setCacheControl(defaultCacheControl);

// e.g. public/videos/course-competencies/create-competencies.gif
addResourceHandlerForPath(registry, "videos", "course-competencies").setCacheControl(defaultCacheControl);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.tum.cit.aet.artemis.lecture.web;

import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_CORE;
import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_IRIS;

import java.net.URI;
import java.net.URISyntaxException;
Expand Down Expand Up @@ -40,6 +41,7 @@
import de.tum.cit.aet.artemis.core.security.annotations.EnforceAtLeastEditor;
import de.tum.cit.aet.artemis.core.security.annotations.EnforceAtLeastInstructor;
import de.tum.cit.aet.artemis.core.security.annotations.EnforceAtLeastStudent;
import de.tum.cit.aet.artemis.core.security.annotations.enforceRoleInCourse.EnforceAtLeastInstructorInCourse;
import de.tum.cit.aet.artemis.core.service.AuthorizationCheckService;
import de.tum.cit.aet.artemis.core.util.HeaderUtil;
import de.tum.cit.aet.artemis.exercise.domain.Exercise;
Expand Down Expand Up @@ -261,13 +263,15 @@ public ResponseEntity<Lecture> importLecture(@PathVariable long sourceLectureId,

/**
* POST /courses/{courseId}/ingest
* This endpooint is for starting the ingestion of all lectures or only one lecture when triggered in Artemis.
* This endpoint is for starting the ingestion of all lectures or only one lecture when triggered in Artemis.
*
* @param courseId the ID of the course for which all lectures should be ingested in pyris
* @param lectureId If this id is present then only ingest this one lecture of the respective course
* @return the ResponseEntity with status 200 (OK) and a message success or null if the operation failed
*/
@Profile(PROFILE_IRIS)
@PostMapping("courses/{courseId}/ingest")
@EnforceAtLeastInstructorInCourse
public ResponseEntity<Boolean> ingestLectures(@PathVariable Long courseId, @RequestParam(required = false) Optional<Long> lectureId) {
log.debug("REST request to ingest lectures of course : {}", courseId);
Course course = courseRepository.findByIdWithLecturesAndLectureUnitsElseThrow(courseId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import de.jplag.Language;
import de.jplag.c.CLanguage;
import de.jplag.clustering.ClusteringOptions;
import de.jplag.cpp.CPPLanguage;
import de.jplag.exceptions.ExitException;
import de.jplag.java.JavaLanguage;
import de.jplag.javascript.JavaScriptLanguage;
Expand Down Expand Up @@ -312,16 +313,16 @@ public void deleteTempLocalRepository(Repository repository) {
private Language getJPlagProgrammingLanguage(ProgrammingExercise programmingExercise) {
return switch (programmingExercise.getProgrammingLanguage()) {
case C -> new CLanguage();
case C_PLUS_PLUS -> new CPPLanguage();
case JAVA -> new JavaLanguage();
case JAVASCRIPT -> new JavaScriptLanguage();
case KOTLIN -> new KotlinLanguage();
case PYTHON -> new PythonLanguage();
case R -> new RLanguage();
case RUST -> new RustLanguage();
case SWIFT -> new SwiftLanguage();
case EMPTY, PHP, DART, HASKELL, ASSEMBLER, OCAML, C_SHARP, C_PLUS_PLUS, SQL, TYPESCRIPT, GO, MATLAB, BASH, VHDL, RUBY, POWERSHELL, ADA ->
throw new BadRequestAlertException("Programming language " + programmingExercise.getProgrammingLanguage() + " not supported for plagiarism check.",
"ProgrammingExercise", "notSupported");
case EMPTY, PHP, DART, HASKELL, ASSEMBLER, OCAML, C_SHARP, SQL, TYPESCRIPT, GO, MATLAB, BASH, VHDL, RUBY, POWERSHELL, ADA -> throw new BadRequestAlertException(
"Programming language " + programmingExercise.getProgrammingLanguage() + " not supported for plagiarism check.", "ProgrammingExercise", "notSupported");
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public enum ProgrammingLanguage {
private static final Set<ProgrammingLanguage> ENABLED_LANGUAGES = Set.of(
ASSEMBLER,
C,
C_PLUS_PLUS,
HASKELL,
JAVA,
JAVASCRIPT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public TemplateUpgradePolicyService(JavaTemplateUpgradeService javaRepositoryUpg
public TemplateUpgradeService getUpgradeService(ProgrammingLanguage programmingLanguage) {
return switch (programmingLanguage) {
case JAVA -> javaRepositoryUpgradeService;
case KOTLIN, PYTHON, C, HASKELL, VHDL, ASSEMBLER, SWIFT, OCAML, EMPTY, RUST, JAVASCRIPT, R -> defaultRepositoryUpgradeService;
case C_SHARP, C_PLUS_PLUS, SQL, TYPESCRIPT, GO, MATLAB, BASH, RUBY, POWERSHELL, ADA, DART, PHP ->
case KOTLIN, PYTHON, C, HASKELL, VHDL, ASSEMBLER, SWIFT, OCAML, EMPTY, RUST, JAVASCRIPT, R, C_PLUS_PLUS -> defaultRepositoryUpgradeService;
case C_SHARP, SQL, TYPESCRIPT, GO, MATLAB, BASH, RUBY, POWERSHELL, ADA, DART, PHP ->
throw new UnsupportedOperationException("Unsupported programming language: " + programmingLanguage);
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ enum RepositoryCheckoutPath implements CustomizableCheckoutPath {
@Override
public String forProgrammingLanguage(ProgrammingLanguage language) {
return switch (language) {
case JAVA, PYTHON, C, HASKELL, KOTLIN, VHDL, ASSEMBLER, SWIFT, OCAML, EMPTY, RUST, JAVASCRIPT, R -> "assignment";
case C_SHARP, C_PLUS_PLUS, SQL, TYPESCRIPT, GO, MATLAB, BASH, RUBY, POWERSHELL, ADA, DART, PHP ->
case JAVA, PYTHON, C, HASKELL, KOTLIN, VHDL, ASSEMBLER, SWIFT, OCAML, EMPTY, RUST, JAVASCRIPT, R, C_PLUS_PLUS -> "assignment";
case C_SHARP, SQL, TYPESCRIPT, GO, MATLAB, BASH, RUBY, POWERSHELL, ADA, DART, PHP ->
throw new UnsupportedOperationException("Unsupported programming language: " + language);
};
}
Expand All @@ -230,9 +230,9 @@ public String forProgrammingLanguage(ProgrammingLanguage language) {
@Override
public String forProgrammingLanguage(ProgrammingLanguage language) {
return switch (language) {
case JAVA, PYTHON, HASKELL, KOTLIN, SWIFT, EMPTY, RUST, JAVASCRIPT, R -> "";
case JAVA, PYTHON, HASKELL, KOTLIN, SWIFT, EMPTY, RUST, JAVASCRIPT, R, C_PLUS_PLUS -> "";
case C, VHDL, ASSEMBLER, OCAML -> "tests";
case C_SHARP, C_PLUS_PLUS, SQL, TYPESCRIPT, GO, MATLAB, BASH, RUBY, POWERSHELL, ADA, DART, PHP ->
case C_SHARP, SQL, TYPESCRIPT, GO, MATLAB, BASH, RUBY, POWERSHELL, ADA, DART, PHP ->
throw new UnsupportedOperationException("Unsupported programming language: " + language);
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.tum.cit.aet.artemis.programming.service.jenkins;

import static de.tum.cit.aet.artemis.programming.domain.ProgrammingLanguage.C;
import static de.tum.cit.aet.artemis.programming.domain.ProgrammingLanguage.C_PLUS_PLUS;
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;
Expand Down Expand Up @@ -35,6 +36,7 @@ public JenkinsProgrammingLanguageFeatureService() {
// Must be extended once a new programming language is added
programmingLanguageFeatures.put(EMPTY, new ProgrammingLanguageFeature(EMPTY, false, false, false, false, false, List.of(), false, false));
programmingLanguageFeatures.put(C, new ProgrammingLanguageFeature(C, false, false, true, false, false, List.of(FACT, GCC), false, false));
programmingLanguageFeatures.put(C_PLUS_PLUS, new ProgrammingLanguageFeature(C_PLUS_PLUS, false, false, true, false, false, List.of(), false, false));
programmingLanguageFeatures.put(HASKELL, new ProgrammingLanguageFeature(HASKELL, false, false, false, false, true, List.of(), false, false));
programmingLanguageFeatures.put(JAVA,
new ProgrammingLanguageFeature(JAVA, true, true, true, true, false, List.of(PLAIN_GRADLE, GRADLE_GRADLE, PLAIN_MAVEN, MAVEN_MAVEN, MAVEN_BLACKBOX), true, false));
Expand Down
Loading

0 comments on commit ecdb10e

Please sign in to comment.