Skip to content

Commit

Permalink
remove hestia server code
Browse files Browse the repository at this point in the history
WIP:
* server tests do not compile yet
* client hestia code needs to be removed
  • Loading branch information
krusche committed Dec 10, 2024
1 parent b44dafa commit 3256303
Show file tree
Hide file tree
Showing 116 changed files with 107 additions and 5,094 deletions.
19 changes: 0 additions & 19 deletions src/main/java/de/tum/cit/aet/artemis/assessment/domain/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

import jakarta.persistence.CascadeType;
Expand All @@ -28,7 +26,6 @@
import jakarta.persistence.OneToMany;
import jakarta.persistence.OrderColumn;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;
import jakarta.validation.constraints.NotNull;

import org.apache.commons.lang3.StringUtils;
Expand All @@ -53,7 +50,6 @@
import de.tum.cit.aet.artemis.exercise.domain.participation.Participation;
import de.tum.cit.aet.artemis.exercise.service.ExerciseDateService;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExercise;
import de.tum.cit.aet.artemis.programming.domain.hestia.CoverageFileReport;
import de.tum.cit.aet.artemis.programming.dto.ResultDTO;
import de.tum.cit.aet.artemis.quiz.config.QuizView;
import de.tum.cit.aet.artemis.quiz.domain.QuizExercise;
Expand Down Expand Up @@ -152,13 +148,6 @@ public class Result extends DomainObject implements Comparable<Result> {
@JsonIgnore
private Instant lastModifiedDate;

// This attribute is required to forward the coverage file reports after creating the build result. This is required in order to
// delay referencing the corresponding test cases from the entries because the test cases are not saved in the database
// at this point of time but the required test case name would be lost, otherwise.
@Transient
@JsonIgnore
private Map<String, Set<CoverageFileReport>> fileReportsByTestCaseName;

public ZonedDateTime getCompletionDate() {
return completionDate;
}
Expand Down Expand Up @@ -500,14 +489,6 @@ public void setCodeIssueCount(int codeIssueCount) {
this.codeIssueCount = Math.min(codeIssueCount, SIZE_OF_UNSIGNED_TINYINT);
}

public Map<String, Set<CoverageFileReport>> getCoverageFileReportsByTestCaseName() {
return fileReportsByTestCaseName;
}

public void setCoverageFileReportsByTestCaseName(Map<String, Set<CoverageFileReport>> fileReportsByTestCaseName) {
this.fileReportsByTestCaseName = fileReportsByTestCaseName;
}

/**
* Checks the initialization status of the assessment note before returning. Only a single element is returned instead of the list,
* because it is modelled that way on the client-side. Jackson therefore needs a single object for the (de-)serialization.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExercise;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseParticipation;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseStudentParticipation;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseTask;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseTestCase;
import de.tum.cit.aet.artemis.programming.domain.build.BuildPlanType;
import de.tum.cit.aet.artemis.programming.domain.hestia.ProgrammingExerciseTask;
import de.tum.cit.aet.artemis.programming.repository.BuildJobRepository;
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseRepository;
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseStudentParticipationRepository;
import de.tum.cit.aet.artemis.programming.repository.SolutionProgrammingExerciseParticipationRepository;
import de.tum.cit.aet.artemis.programming.repository.TemplateProgrammingExerciseParticipationRepository;
import de.tum.cit.aet.artemis.programming.service.BuildLogEntryService;
import de.tum.cit.aet.artemis.programming.service.hestia.ProgrammingExerciseTaskService;
import de.tum.cit.aet.artemis.programming.service.ProgrammingExerciseTaskService;

@Profile(PROFILE_CORE)
@Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import de.tum.cit.aet.artemis.programming.service.ProgrammingMessagingService;
import de.tum.cit.aet.artemis.programming.service.ProgrammingTriggerService;
import de.tum.cit.aet.artemis.programming.service.ci.ContinuousIntegrationService;
import de.tum.cit.aet.artemis.programming.service.hestia.TestwiseCoverageService;

/**
* REST controller for receiving build results.
Expand All @@ -51,19 +50,15 @@ public class PublicResultResource {

private final ResultService resultService;

private final TestwiseCoverageService testwiseCoverageService;

private final ProgrammingTriggerService programmingTriggerService;

private final ProgrammingMessagingService programmingMessagingService;

public PublicResultResource(Optional<ContinuousIntegrationService> continuousIntegrationService, ProgrammingExerciseGradingService programmingExerciseGradingService,
ResultService resultService, TestwiseCoverageService testwiseCoverageService, ProgrammingTriggerService programmingTriggerService,
ProgrammingMessagingService programmingMessagingService) {
ResultService resultService, ProgrammingTriggerService programmingTriggerService, ProgrammingMessagingService programmingMessagingService) {
this.continuousIntegrationService = continuousIntegrationService;
this.programmingExerciseGradingService = programmingExerciseGradingService;
this.resultService = resultService;
this.testwiseCoverageService = testwiseCoverageService;
this.programmingTriggerService = programmingTriggerService;
this.programmingMessagingService = programmingMessagingService;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
import de.tum.cit.aet.artemis.plagiarism.service.PlagiarismDetectionConfigHelper;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExercise;
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseRepository;
import de.tum.cit.aet.artemis.programming.repository.hestia.ProgrammingExerciseTaskRepository;
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseTaskRepository;
import de.tum.cit.aet.artemis.programming.service.ProgrammingExerciseImportService;
import de.tum.cit.aet.artemis.quiz.domain.QuizExercise;
import de.tum.cit.aet.artemis.quiz.repository.QuizExerciseRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import de.tum.cit.aet.artemis.exercise.domain.Exercise;
import de.tum.cit.aet.artemis.lecture.domain.Lecture;
import de.tum.cit.aet.artemis.modeling.domain.ApollonDiagram;
import de.tum.cit.aet.artemis.programming.domain.hestia.ExerciseHint;

/**
* Listens to Hibernate events and invalidates the cached titles of an entity if the title changed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import de.tum.cit.aet.artemis.modeling.service.ModelingExerciseImportService;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExercise;
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseRepository;
import de.tum.cit.aet.artemis.programming.repository.hestia.ProgrammingExerciseTaskRepository;
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseTaskRepository;
import de.tum.cit.aet.artemis.programming.service.ProgrammingExerciseImportService;
import de.tum.cit.aet.artemis.programming.service.ProgrammingExerciseService;
import de.tum.cit.aet.artemis.quiz.domain.QuizExercise;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package de.tum.cit.aet.artemis.exercise.dto;

import java.util.Set;

import com.fasterxml.jackson.annotation.JsonInclude;

import de.tum.cit.aet.artemis.exercise.domain.Exercise;
import de.tum.cit.aet.artemis.iris.dto.IrisCombinedSettingsDTO;
import de.tum.cit.aet.artemis.plagiarism.dto.PlagiarismCaseInfoDTO;
import de.tum.cit.aet.artemis.programming.domain.hestia.ExerciseHint;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
public record ExerciseDetailsDTO(Exercise exercise, IrisCombinedSettingsDTO irisSettings, PlagiarismCaseInfoDTO plagiarismCaseInfo, Set<ExerciseHint> availableExerciseHints,
Set<ExerciseHint> activatedExerciseHints) {
public record ExerciseDetailsDTO(Exercise exercise, IrisCombinedSettingsDTO irisSettings, PlagiarismCaseInfoDTO plagiarismCaseInfo) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import de.tum.cit.aet.artemis.programming.repository.BuildLogStatisticsEntryRepository;
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseRepository;
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseStudentParticipationRepository;
import de.tum.cit.aet.artemis.programming.repository.hestia.CoverageReportRepository;
import de.tum.cit.aet.artemis.programming.service.BuildLogEntryService;
import de.tum.cit.aet.artemis.programming.service.GitService;
import de.tum.cit.aet.artemis.programming.service.ParticipationVcsAccessTokenService;
Expand Down Expand Up @@ -93,8 +92,6 @@ public class ParticipationService {

private final ResultService resultService;

private final CoverageReportRepository coverageReportRepository;

private final BuildLogStatisticsEntryRepository buildLogStatisticsEntryRepository;

private final ParticipantScoreRepository participantScoreRepository;
Expand All @@ -115,10 +112,9 @@ public ParticipationService(GitService gitService, Optional<ContinuousIntegratio
BuildLogEntryService buildLogEntryService, ParticipationRepository participationRepository, StudentParticipationRepository studentParticipationRepository,
ProgrammingExerciseStudentParticipationRepository programmingExerciseStudentParticipationRepository, ProgrammingExerciseRepository programmingExerciseRepository,
SubmissionRepository submissionRepository, TeamRepository teamRepository, UriService uriService, ResultService resultService,
CoverageReportRepository coverageReportRepository, BuildLogStatisticsEntryRepository buildLogStatisticsEntryRepository,
ParticipantScoreRepository participantScoreRepository, StudentScoreRepository studentScoreRepository, TeamScoreRepository teamScoreRepository,
Optional<SharedQueueManagementService> localCISharedBuildJobQueueService, ProfileService profileService,
ParticipationVcsAccessTokenService participationVCSAccessTokenService, CompetencyProgressApi competencyProgressApi) {
BuildLogStatisticsEntryRepository buildLogStatisticsEntryRepository, ParticipantScoreRepository participantScoreRepository,
StudentScoreRepository studentScoreRepository, TeamScoreRepository teamScoreRepository, Optional<SharedQueueManagementService> localCISharedBuildJobQueueService,
ProfileService profileService, ParticipationVcsAccessTokenService participationVCSAccessTokenService, CompetencyProgressApi competencyProgressApi) {
this.gitService = gitService;
this.continuousIntegrationService = continuousIntegrationService;
this.versionControlService = versionControlService;
Expand All @@ -131,7 +127,6 @@ public ParticipationService(GitService gitService, Optional<ContinuousIntegratio
this.teamRepository = teamRepository;
this.uriService = uriService;
this.resultService = resultService;
this.coverageReportRepository = coverageReportRepository;
this.buildLogStatisticsEntryRepository = buildLogStatisticsEntryRepository;
this.participantScoreRepository = participantScoreRepository;
this.studentScoreRepository = studentScoreRepository;
Expand Down Expand Up @@ -901,7 +896,6 @@ public void deleteResultsAndSubmissionsOfParticipation(Long participationId, boo
// We have to set the results to an empty list because otherwise clearing the build log entries does not work correctly
submission.setResults(Collections.emptyList());
if (submission instanceof ProgrammingSubmission programmingSubmission) {
coverageReportRepository.deleteBySubmissionId(submission.getId());
buildLogEntryService.deleteBuildLogEntriesForProgrammingSubmission(programmingSubmission);
buildLogStatisticsEntryRepository.deleteByProgrammingSubmissionId(submission.getId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@
import de.tum.cit.aet.artemis.plagiarism.dto.PlagiarismCaseInfoDTO;
import de.tum.cit.aet.artemis.plagiarism.service.PlagiarismCaseService;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExercise;
import de.tum.cit.aet.artemis.programming.domain.hestia.ExerciseHint;
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseRepository;
import de.tum.cit.aet.artemis.programming.service.hestia.ExerciseHintService;
import de.tum.cit.aet.artemis.quiz.domain.QuizExercise;
import de.tum.cit.aet.artemis.quiz.service.QuizBatchService;
import de.tum.cit.aet.artemis.tutorialgroup.domain.TutorParticipationStatus;
Expand Down Expand Up @@ -104,14 +102,12 @@ public class ExerciseResource {

private final PlagiarismCaseService plagiarismCaseService;

private final ExerciseHintService exerciseHintService;

public ExerciseResource(ExerciseService exerciseService, ExerciseDeletionService exerciseDeletionService, ParticipationService participationService,
UserRepository userRepository, ExamDateService examDateService, AuthorizationCheckService authCheckService, TutorParticipationService tutorParticipationService,
ExampleSubmissionRepository exampleSubmissionRepository, ProgrammingExerciseRepository programmingExerciseRepository,
GradingCriterionRepository gradingCriterionRepository, ExerciseRepository exerciseRepository, QuizBatchService quizBatchService,
ParticipationRepository participationRepository, ExamAccessService examAccessService, Optional<IrisSettingsService> irisSettingsService,
PlagiarismCaseService plagiarismCaseService, ExerciseHintService exerciseHintService) {
PlagiarismCaseService plagiarismCaseService) {
this.exerciseService = exerciseService;
this.exerciseDeletionService = exerciseDeletionService;
this.participationService = participationService;
Expand All @@ -128,7 +124,6 @@ public ExerciseResource(ExerciseService exerciseService, ExerciseDeletionService
this.examAccessService = examAccessService;
this.irisSettingsService = irisSettingsService;
this.plagiarismCaseService = plagiarismCaseService;
this.exerciseHintService = exerciseHintService;
}

/**
Expand Down Expand Up @@ -349,13 +344,7 @@ public ResponseEntity<ExerciseDetailsDTO> getExerciseDetails(@PathVariable Long
.orElse(null);
PlagiarismCaseInfoDTO plagiarismCaseInfo = plagiarismCaseService.getPlagiarismCaseInfoForExerciseAndUser(exercise.getId(), user.getId()).orElse(null);

if (exercise instanceof ProgrammingExercise programmingExercise) {
Set<ExerciseHint> activatedExerciseHints = exerciseHintService.getActivatedExerciseHints(programmingExercise, user);
Set<ExerciseHint> availableExerciseHints = exerciseHintService.getAvailableExerciseHints(programmingExercise, user);
return ResponseEntity.ok(new ExerciseDetailsDTO(exercise, irisSettings, plagiarismCaseInfo, availableExerciseHints, activatedExerciseHints));
}

return ResponseEntity.ok(new ExerciseDetailsDTO(exercise, irisSettings, plagiarismCaseInfo, null, null));
return ResponseEntity.ok(new ExerciseDetailsDTO(exercise, irisSettings, plagiarismCaseInfo));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
import de.tum.cit.aet.artemis.programming.repository.ProgrammingExerciseRepository;
import de.tum.cit.aet.artemis.programming.service.GitService;
import de.tum.cit.aet.artemis.programming.service.ProgrammingExerciseExportService;
import de.tum.cit.aet.artemis.programming.service.ProgrammingExerciseGitDiffReportService;
import de.tum.cit.aet.artemis.programming.service.UriService;
import de.tum.cit.aet.artemis.programming.service.hestia.ProgrammingExerciseGitDiffReportService;

@Profile(PROFILE_CORE)
@Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
import de.tum.cit.aet.artemis.exercise.domain.participation.StudentParticipation;
import de.tum.cit.aet.artemis.exercise.service.ExerciseDateService;
import de.tum.cit.aet.artemis.programming.domain.build.BuildPlanType;
import de.tum.cit.aet.artemis.programming.domain.hestia.ExerciseHint;
import de.tum.cit.aet.artemis.programming.domain.hestia.ProgrammingExerciseTask;
import de.tum.cit.aet.artemis.programming.domain.submissionpolicy.SubmissionPolicy;
import de.tum.cit.aet.artemis.programming.service.ProgrammingLanguageFeature;

Expand Down Expand Up @@ -149,9 +147,6 @@ public String getType() {
@Column(name = "project_type", table = "programming_exercise_details")
private ProjectType projectType;

@OneToMany(mappedBy = "exercise", cascade = CascadeType.REMOVE, orphanRemoval = true, fetch = FetchType.LAZY)
private Set<ExerciseHint> exerciseHints = new HashSet<>();

@Column(name = "release_tests_with_example_solution", table = "programming_exercise_details", nullable = false)
private boolean releaseTestsWithExampleSolution = false;

Expand Down Expand Up @@ -815,21 +810,12 @@ public void validateSettingsForFeedbackRequest() {
}
}

public Set<ExerciseHint> getExerciseHints() {
return exerciseHints;
}

public void setExerciseHints(Set<ExerciseHint> exerciseHints) {
this.exerciseHints = exerciseHints;
}

/**
* {@inheritDoc}
*/
@Override
public void disconnectRelatedEntities() {
Stream.of(exerciseHints, testCases, staticCodeAnalysisCategories).filter(Objects::nonNull).forEach(Collection::clear);

Stream.of(testCases, staticCodeAnalysisCategories).filter(Objects::nonNull).forEach(Collection::clear);
super.disconnectRelatedEntities();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ public class ProgrammingExerciseBuildConfig extends DomainObject {
@JsonIgnoreProperties("buildConfig")
private ProgrammingExercise programmingExercise;

@Column(name = "testwise_coverage_enabled")
private boolean testwiseCoverageEnabled;

@Nullable
@Column(name = "theia_image")
private String theiaImage;
Expand Down Expand Up @@ -98,7 +95,6 @@ public ProgrammingExerciseBuildConfig(ProgrammingExerciseBuildConfig originalBui
this.setDockerFlags(originalBuildConfig.getDockerFlags());
this.setSequentialTestRuns(originalBuildConfig.hasSequentialTestRuns());
this.setBuildScript(originalBuildConfig.getBuildScript());
this.setTestwiseCoverageEnabled(originalBuildConfig.isTestwiseCoverageEnabled());
this.setTimeoutSeconds(originalBuildConfig.getTimeoutSeconds());
this.setTheiaImage(originalBuildConfig.getTheiaImage());
this.setAllowBranching(originalBuildConfig.isAllowBranching());
Expand Down Expand Up @@ -247,14 +243,6 @@ public void filterSensitiveInformation() {
setBuildScript(null);
}

public boolean isTestwiseCoverageEnabled() {
return testwiseCoverageEnabled;
}

public void setTestwiseCoverageEnabled(boolean testwiseCoverageEnabled) {
this.testwiseCoverageEnabled = testwiseCoverageEnabled;
}

public ProgrammingExercise getProgrammingExercise() {
return programmingExercise;
}
Expand Down Expand Up @@ -296,7 +284,7 @@ public void setSolutionCheckoutPath(String solutionCheckoutPath) {
public String toString() {
return "BuildJobConfig{" + "id=" + getId() + ", sequentialTestRuns=" + sequentialTestRuns + ", branch='" + branch + '\'' + ", buildPlanConfiguration='"
+ buildPlanConfiguration + '\'' + ", buildScript='" + buildScript + '\'' + ", checkoutSolutionRepository=" + checkoutSolutionRepository + ", checkoutPath='"
+ testCheckoutPath + '\'' + ", timeoutSeconds=" + timeoutSeconds + ", dockerFlags='" + dockerFlags + '\'' + ", testwiseCoverageEnabled=" + testwiseCoverageEnabled
+ ", theiaImage='" + theiaImage + '\'' + ", allowBranching=" + allowBranching + ", branchRegex='" + branchRegex + '\'' + '}';
+ testCheckoutPath + '\'' + ", timeoutSeconds=" + timeoutSeconds + ", dockerFlags='" + dockerFlags + '\'' + ", theiaImage='" + theiaImage + '\''
+ ", allowBranching=" + allowBranching + ", branchRegex='" + branchRegex + '\'' + '}';
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.tum.cit.aet.artemis.programming.domain.hestia;
package de.tum.cit.aet.artemis.programming.domain;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
Expand Down
Loading

0 comments on commit 3256303

Please sign in to comment.