Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Strohgelaender committed Feb 5, 2024
2 parents e017940 + 0a94d79 commit d9cf579
Show file tree
Hide file tree
Showing 125 changed files with 1,916 additions and 1,187 deletions.
10 changes: 9 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ trim_trailing_whitespace = false
ij_java_class_count_to_use_import_on_demand = 4

[{*.yml,*.yaml}]
indent_size = 2
indent_size = 2

[{*.ats,*.cts,*.mts,*.ts}]
ij_typescript_use_double_quotes = false
ij_typescript_spaces_within_imports = true

[{*.cjs,*.js}]
ij_javascript_use_double_quotes = false
ij_javascript_spaces_within_imports = true
27 changes: 19 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,53 @@
<!-- Thanks for contributing to Artemis! Before you submit your pull request, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->
<!-- Thanks for contributing to Artemis! Before you submit your pull request, please make sure to check all tasks by putting an x in the [ ] (don't: [x ], [ x], do: [x]). Remove not applicable tasks and do not leave them unchecked -->
<!-- If your pull request is not ready for review yet, create a draft pull request! -->

### Checklist
#### General
<!-- Remove tasks that are not applicable for your PR. Please only put the PR into ready for review, if all relevant tasks are checked! -->
<!-- You only need to choose one of the first two check items: Generally, test on the test servers. -->
<!-- If it's only a small change, testing it locally is acceptable and you may remove the first checkmark. If you are unsure, please test on the test servers. -->
- [ ] I tested **all** changes and their related features with **all** corresponding user types on a test server.
- [ ] This is a small issue that I tested locally and was confirmed by another developer on a test server.
- [ ] Language: I followed the [guidelines for inclusive, diversity-sensitive, and appreciative language](https://docs.artemis.cit.tum.de/dev/guidelines/language-guidelines/).
- [ ] I chose a title conforming to the [naming conventions for pull requests](https://docs.artemis.cit.tum.de/dev/development-process/#naming-conventions-for-github-pull-requests).


#### Server
- [ ] **Important**: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
- [ ] I followed the [coding and design guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/server/).
- [ ] I **strictly** followed the [server coding and design guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/server/).
- [ ] I added multiple integration tests (Spring) related to the features (with a high test coverage).
- [ ] I added pre-authorization annotations according to the [guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/server/#rest-endpoint-best-practices-for-authorization) and checked the course groups for all new REST Calls (security).
- [ ] I documented the Java code using JavaDoc style.


#### Client
- [ ] **Important**: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data.
- [ ] I followed the [coding and design guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/client/).
- [ ] I **strictly** followed the [client coding and design guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/client/).
- [ ] Following the [theming guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/client-design/), I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
- [ ] I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the [test guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/client-tests/).
- [ ] I added `authorities` to all new routes and checked the course groups for displaying navigation elements (links, buttons).
- [ ] I documented the TypeScript code using JSDoc style.
- [ ] I added multiple screenshots/screencasts of my UI changes.
- [ ] I translated all newly inserted strings into English and German.


#### Changes affecting Programming Exercises
- [ ] I tested **all** changes and their related features with **all** corresponding user types on Test Server 1 (Atlassian Suite).
- [ ] I tested **all** changes and their related features with **all** corresponding user types on Test Server 2 (Jenkins and Gitlab).
- [ ] **High priority**: I tested **all** changes and their related features with **all** corresponding user types on a test server configured with the **integrated lifecycle setup** (LocalVC and LocalCI).
- [ ] I tested **all** changes and their related features with **all** corresponding user types on a test server configured with **Gitlab** and **Jenkins**.
- [ ] I tested **all** changes and their related features with **all** corresponding user types on a test server configured with **Bitbucket** and **Bamboo**.


### Motivation and Context
<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->


### Description
<!-- Describe your changes in detail -->


### Steps for Testing
<!-- Please describe in detail how the reviewer can test your changes. -->
<!-- Please describe in detail how reviewers can test your changes. Make sure to take all related features and views into account! Below is an example that you can refine. -->
Prerequisites:
- 1 Instructor
- 2 Students
Expand Down Expand Up @@ -74,7 +85,7 @@ Prerequisites:
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test9)

### Review Progress
<!-- Each Pull Request should be reviewed by at least two other developers. The code, the functionality (= manual test) and the exam mode need to be reviewed. -->
<!-- Each PR should be reviewed by at least two other developers. The code, the functionality (= manual test) and the exam mode need to be reviewed. -->
<!-- The reviewer or author check the following boxes depending on what was reviewed or tested. All boxes should be checked before merge. -->
<!-- You can add additional checkboxes if it makes sense to only review parts of the code or functionality. -->
<!-- When changes are pushed, uncheck the affected boxes. (Not all changes require full re-reviews.) -->
Expand Down Expand Up @@ -107,5 +118,5 @@ Prerequisites:
-->

### Screenshots
<!-- Add screenshots to demonstrate the changes in the UI. -->
<!-- Add screenshots to demonstrate the changes in the UI. Remove the section if you did not change the UI. -->
<!-- Create a GIF file from a screen recording in a docker container https://toub.es/2017/09/11/high-quality-gif-with-ffmpeg-and-docker/ -->
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/wrapper-validation-action@v2
with:
min-wrapper-count: 6 # 5 in the different gradle templates and 1 for the Artemis project itself
24 changes: 12 additions & 12 deletions .idea/runConfigurations/Artemis__Server__LocalVC___LocalCI_.xml

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

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

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

2 changes: 1 addition & 1 deletion docker/artemis/config/cypress-local.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Artemis configuration overrides for the Cypress E2E Postgres setups
# ----------------------------------------------------------------------------------------------------------------------

SPRING_PROFILES_ACTIVE="artemis,scheduling,localvc,localci,prod,docker"
SPRING_PROFILES_ACTIVE="artemis,scheduling,localvc,localci,buildagent,prod,docker"

ARTEMIS_USERMANAGEMENT_USEEXTERNAL="false"
ARTEMIS_VERSIONCONTROL_URL='https://localhost'
Expand Down
2 changes: 1 addition & 1 deletion docker/artemis/config/dev-local-vc-local-ci.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://docs.artemis.cit.tum.de/dev/setup.html#debugging-with-docker
_JAVA_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005

SPRING_PROFILES_ACTIVE: artemis,scheduling,localci,localvc,dev,docker
SPRING_PROFILES_ACTIVE: artemis,scheduling,localci,localvc,buildagent,dev,docker

# Integrated Code Lifecycle settings with Jira
ARTEMIS_USERMANAGEMENT_USEEXTERNAL="false"
Expand Down
2 changes: 1 addition & 1 deletion docs/admin/registration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Example:
jhipster:
mail:
base-url: https://artemis.cit.tum.de
from: artemis.in@tum.de
from: artemis@xcit.tum.de
management:
health:
mail:
Expand Down
2 changes: 2 additions & 0 deletions docs/dev/guidelines/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Some general aspects:
2. Do not introduce new types/values to the global namespace.
3. Shared types should be defined in 'types.ts'.
4. Within a file, type definitions should come first.
5. Interfaces and types offer almost the same functionality. To ensure consistency, choose ``interface`` over ``type`` whenever possible.
6. Use strict typing to avoid type errors: Do not use ``any``.

4. ``null`` and ``undefined``
=============================
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/setup/gitlabci-gitlab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Artemis
artemis-authentication-token-value: notification-plugin-token # change this value
git:
name: Artemis
email: artemis.in@tum.de
email: artemis@xcit.tum.de
server:
url: http://host.docker.internal:8080
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/setup/jenkins-gitlab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ the `Gitlab Server Quickstart <#gitlab-server-quickstart>`__ guide.
build-timeout: 30
git:
name: Artemis
email: artemis.in@tum.de
email: artemis@xcit.tum.de
jenkins:
internal-urls:
ci-url: http://jenkins:8080
Expand Down
42 changes: 35 additions & 7 deletions docs/user/plagiarism-check.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,45 @@ The following activity diagram depicts the CPC flow described above.
|cpc-activity-diagram|


The video below shows the full CPC process from student's and instructor's perspective. It includes:
Videos below show the full CPC process from student's and instructor's perspective.

#. Creating a new exercise with the CPC enabled.
#. Reviewing check's results by a student and by an instructor.
#. Fixing submissions marked as a significant similarity.
#. Responding to a significant similarity plagiarism case that persisted after the exercise due date.
#. Adding a verdict to a significant similarity plagiarism case that persisted after the exercise due date.
Creating a new exercise with the CPC enabled.

.. raw:: html

<iframe src="https://live.rbg.tum.de/w/artemisintro/42026?video_only=1&t=0" allowfullscreen="1" frameborder="0" width="600" height="350">
<iframe src="https://live.rbg.tum.de/w/artemisintro/42153?video_only=1&t=0" allowfullscreen="1" frameborder="0" width="600" height="350">
Watch this video on TUM-Live.
</iframe>

Reviewing check's results by an instructor.

.. raw:: html

<iframe src="https://live.rbg.tum.de/w/artemisintro/42154?video_only=1&t=0" allowfullscreen="1" frameborder="0" width="600" height="350">
Watch this video on TUM-Live.
</iframe>

Reviewing check's results by a student.

.. raw:: html

<iframe src="https://live.rbg.tum.de/w/artemisintro/42155?video_only=1&t=0" allowfullscreen="1" frameborder="0" width="600" height="350">
Watch this video on TUM-Live.
</iframe>

Fixing submissions marked as a significant similarity.

.. raw:: html

<iframe src="https://live.rbg.tum.de/w/artemisintro/42156?video_only=1&t=0" allowfullscreen="1" frameborder="0" width="600" height="350">
Watch this video on TUM-Live.
</iframe>

Responding to a significant similarity plagiarism case that persisted after the exercise due date and adding a verdict to it.

.. raw:: html

<iframe src="https://live.rbg.tum.de/w/artemisintro/42157?video_only=1&t=0" allowfullscreen="1" frameborder="0" width="600" height="350">
Watch this video on TUM-Live.
</iframe>

Expand Down
22 changes: 22 additions & 0 deletions src/main/java/de/tum/in/www1/artemis/domain/BuildJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import de.tum.in.www1.artemis.domain.enumeration.BuildJobResult;
import de.tum.in.www1.artemis.domain.enumeration.RepositoryType;
import de.tum.in.www1.artemis.service.connectors.localci.dto.LocalCIBuildJobQueueItem;

@Entity
@Table(name = "build_job")
Expand Down Expand Up @@ -62,6 +63,27 @@ public class BuildJob extends DomainObject {
@Column(name = "docker_image")
private String dockerImage;

public BuildJob() {
}

public BuildJob(LocalCIBuildJobQueueItem queueItem, BuildJobResult result) {
this.name = queueItem.name();
this.exerciseId = queueItem.exerciseId();
this.courseId = queueItem.courseId();
this.participationId = queueItem.participationId();
this.buildAgentAddress = queueItem.buildAgentAddress();
this.buildStartDate = queueItem.jobTimingInfo().buildStartDate();
this.buildCompletionDate = queueItem.jobTimingInfo().buildCompletionDate();
this.repositoryType = queueItem.repositoryInfo().repositoryType();
this.repositoryName = queueItem.repositoryInfo().repositoryName();
this.commitHash = queueItem.buildConfig().commitHash();
this.retryCount = queueItem.retryCount();
this.priority = queueItem.priority();
this.triggeredByPushTo = queueItem.repositoryInfo().triggeredByPushTo();
this.buildJobResult = result;
this.dockerImage = queueItem.buildConfig().dockerImage();
}

public String getName() {
return name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
@Repository
public interface AttachmentRepository extends JpaRepository<Attachment, Long> {

@Query("select a FROM Attachment a WHERE a.lecture.id = :#{#lectureId}")
@Query("""
SELECT a
FROM Attachment a
WHERE a.lecture.id = :lectureId
""")
List<Attachment> findAllByLectureId(@Param("lectureId") Long lectureId);

default Attachment findByIdOrElseThrow(Long attachmentId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ ORDER BY INDEX(attachmentUnit)
* @throws EntityNotFoundException if no results are found
*/
@NotNull
default List<AttachmentUnit> findAllByLectureIdAndAttachmentTypeElseThrow(@Param("lectureId") Long lectureId, @Param("attachmentType") AttachmentType attachmentType)
throws EntityNotFoundException {
default List<AttachmentUnit> findAllByLectureIdAndAttachmentTypeElseThrow(Long lectureId, AttachmentType attachmentType) throws EntityNotFoundException {
List<AttachmentUnit> attachmentUnits = findAllByLectureIdAndAttachmentType(lectureId, attachmentType);
if (attachmentUnits.isEmpty()) {
throw new EntityNotFoundException("AttachmentUnit");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ default Bonus findByIdElseThrow(Long bonusId) throws EntityNotFoundException {
""")
Set<Bonus> findAllByBonusToExamId(@Param("examId") Long examId);

boolean existsByBonusToGradingScaleId(@Param("bonusToGradingScaleId") Long bonusToGradingScaleId);
boolean existsByBonusToGradingScaleId(Long bonusToGradingScaleId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public interface BuildPlanRepository extends JpaRepository<BuildPlan, Long> {
JOIN buildPlan.programmingExercises programmingExercises
WHERE programmingExercises.id = :exerciseId
""")
Optional<BuildPlan> findByProgrammingExercises_Id(long exerciseId);
Optional<BuildPlan> findByProgrammingExercises_Id(@Param("exerciseId") long exerciseId);

default BuildPlan findByProgrammingExercises_IdWithProgrammingExercisesElseThrow(final long exerciseId) {
return findByProgrammingExercises_IdWithProgrammingExercises(exerciseId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface CompetencyProgressRepository extends JpaRepository<CompetencyPr
@Transactional // ok because of delete
@Modifying
@Query("DELETE FROM CompetencyProgress cp WHERE cp.competency.id = :competencyId")
void deleteAllByCompetencyId(Long competencyId);
void deleteAllByCompetencyId(@Param("competencyId") Long competencyId);

@Transactional // ok because of delete
@Modifying
Expand Down Expand Up @@ -74,7 +74,7 @@ SELECT AVG(cp.confidence)
Optional<Double> findAverageConfidenceByCompetencyId(@Param("competencyId") Long competencyId);

@Query("""
SELECT count(cp)
SELECT COUNT(cp)
FROM CompetencyProgress cp
WHERE cp.competency.id = :competencyId
""")
Expand Down
Loading

0 comments on commit d9cf579

Please sign in to comment.