Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programming exercises: Display checkout directories in build plan preview #8597

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
d9a0870
Adding endpoint that returns the checkout directories for all program…
florian-glombik May 12, 2024
cc6ca33
Adjusting endpoint to only return the checkout directories for the di…
florian-glombik May 12, 2024
807a197
Reuse translation
florian-glombik May 12, 2024
d45148e
Adding hardcoded preview
florian-glombik May 12, 2024
f91639c
Call server endpoint from service
florian-glombik May 13, 2024
f450b1f
Merge branch 'refs/heads/develop' into feature/programming-exercises/…
florian-glombik May 14, 2024
825c8ea
Fixing change detection and exchanging translations
florian-glombik May 14, 2024
4a73256
Reducing code duplication and unsubscribe on destroy
florian-glombik May 14, 2024
1136361
Only display the checkout directories once they have been loaded
florian-glombik May 14, 2024
000f3e5
Displaying checkout directories of auxiliary repositories
florian-glombik May 14, 2024
19e8b39
Fixing console errors
florian-glombik May 14, 2024
1a7ae44
Fixing console error due to regex and define re-used regex as constant
florian-glombik May 14, 2024
71dc62d
Adhere to naming conventions
florian-glombik May 14, 2024
92acf34
Fixing console error
florian-glombik May 14, 2024
4b9ca36
Adding leading slash if not present
florian-glombik May 14, 2024
a5510fd
Simplify html
florian-glombik May 14, 2024
8bc8473
Defining checkout directories for solution repository within enum
florian-glombik May 15, 2024
08cf7a8
Simplify endpoint for retrieval of checkout repository
florian-glombik May 15, 2024
268246d
Moving code for checkout directory retrieval to interface
florian-glombik May 15, 2024
c09a878
Adding javadoc
florian-glombik May 15, 2024
8db9017
Add tests for checkout directory retrieval
florian-glombik May 15, 2024
53400b2
Remove unused method
florian-glombik May 15, 2024
dc79451
Adding tests
florian-glombik May 15, 2024
a7b1c16
Adding client tests
florian-glombik May 15, 2024
99a416e
Adding useful client tests
florian-glombik May 15, 2024
b603037
Adding test that only necessary calls to the server are made
florian-glombik May 15, 2024
b00f7f4
Adding tests for the amount of rest calls
florian-glombik May 15, 2024
fdd626b
Adding test for auxiliary repositories
florian-glombik May 15, 2024
aac7d18
Fixing client tests
florian-glombik May 15, 2024
c014260
Improving code quality by not calling method in html
florian-glombik May 15, 2024
02fbef7
Make undefined check inline
florian-glombik May 15, 2024
443fbdb
Adding test to increase coverage
florian-glombik May 15, 2024
a8b9069
Adding another test for the coverage
florian-glombik May 15, 2024
ed8ba16
Another test just to raise the coverage...
florian-glombik May 15, 2024
57ee81c
Changing order of current and previous value
florian-glombik May 15, 2024
95fb137
Merge branch 'refs/heads/develop' into feature/programming-exercises/…
florian-glombik May 16, 2024
31f0dbc
Display auxRepo checkout path as code, similar to the edit mode
florian-glombik May 16, 2024
29e8dec
RootDirectory vs RootDirectoryPath
florian-glombik May 16, 2024
17e7f99
Display checkout directories in overview
florian-glombik May 16, 2024
1751f3c
Moving the root directory logic to the services to simplify usage in …
florian-glombik May 16, 2024
a39d4de
Simplify usage of service
florian-glombik May 16, 2024
086da39
Loading checkout directories on details page
florian-glombik May 16, 2024
c9f94c7
Using translations instead of hardcoded strings
florian-glombik May 16, 2024
ff259d0
Fixing client test
florian-glombik May 16, 2024
0498061
Unsubscribing on destroy
florian-glombik May 16, 2024
72312db
Fixing previous code, unsubscribing from subscriptions on destroy
florian-glombik May 16, 2024
bd8aa4d
Merge branch 'refs/heads/develop' into feature/programming-exercises/…
florian-glombik May 16, 2024
4a90c75
Merge branch 'refs/heads/develop' into feature/programming-exercises/…
florian-glombik May 19, 2024
ee33c46
Adjusting translations
florian-glombik May 19, 2024
42b38e0
Adjusting tooltip for LocalVC
florian-glombik May 19, 2024
3006f4a
build execution vs. Build Execution
florian-glombik May 19, 2024
3780d14
Make client style happy
florian-glombik May 19, 2024
4abbed4
Lower the restriction to tutors instead of editors
florian-glombik May 19, 2024
a630d6c
Fixing unintentional typo
florian-glombik May 19, 2024
e49a2da
Fixing test
florian-glombik May 19, 2024
019b69b
Returning null vs UnsupportedOperationException
florian-glombik May 19, 2024
b623620
Use RegEx instead of custom check
florian-glombik May 19, 2024
c0000f7
Moving dto to entities folder
florian-glombik May 19, 2024
be15491
Merge branch 'refs/heads/develop' into feature/programming-exercises/…
florian-glombik May 19, 2024
b484f47
Adhere to server guidelines #6
florian-glombik May 19, 2024
946a169
Adjusting error message and adding javadoc to enum for template & sub…
florian-glombik May 20, 2024
d16ca1e
Adjusting endpoint to only returning the template & submission build …
florian-glombik May 20, 2024
9ec3615
Adjusting javadoc
florian-glombik May 20, 2024
6549a4d
Simplify null checks
florian-glombik May 20, 2024
0d7b7a3
Build Execution vs. build execution
florian-glombik May 20, 2024
a2c21da
Simplify null check
florian-glombik May 20, 2024
37316d0
Build Execution vs build execution
florian-glombik May 20, 2024
6580917
Do not add leading slash for loaded checkout directories from server
florian-glombik May 20, 2024
b7431d4
Do not display a checkout directory if the solution is not checked out
florian-glombik May 20, 2024
72f1816
Adding tooltip and hiding solution
florian-glombik May 20, 2024
415bd64
Don't display the checkout directories for tutors
florian-glombik May 20, 2024
bcf94bc
Access right from TA to EDITOR, adjust test
florian-glombik May 20, 2024
5aaa353
Catch specific Exception and handle null
florian-glombik May 20, 2024
faa3795
Catching actual error message
florian-glombik May 20, 2024
67757fb
Using translation
florian-glombik May 20, 2024
07dce47
Using translation
florian-glombik May 21, 2024
a228628
Adjusting endpoint to return checkout directories for exercise and so…
florian-glombik May 22, 2024
313ca54
Returning null if solution repository is not checked out
florian-glombik May 22, 2024
9f7fb9f
Adjusting Tests to returning checkout directories
florian-glombik May 22, 2024
cc7443f
Adjusting Tests to returning checkout directories
florian-glombik May 22, 2024
2d56df2
Adding checks for solution checkout directory repositories to integra…
florian-glombik May 23, 2024
047302e
Adjust types for new endpoint, introducing new component to preview c…
florian-glombik May 24, 2024
f91ebb5
Displaying solution directories properly
florian-glombik May 24, 2024
a372b74
Fixing tests
florian-glombik May 24, 2024
afbb86c
Adding test for comma separation
florian-glombik May 24, 2024
ca2792b
Make test for solution repository comma separation more robust
florian-glombik May 24, 2024
eb5b82a
Shortening translations
florian-glombik May 24, 2024
c0a2fb1
Introducing preview as shared component
florian-glombik May 24, 2024
3cf3906
Fixing change detection for auxiliary repositories
florian-glombik May 24, 2024
34c8507
Introduce new component for displaying the build plan checkout direct…
florian-glombik May 24, 2024
65742c0
Rename main component
florian-glombik May 24, 2024
7a7f634
Display checkout directories on details page
florian-glombik May 24, 2024
162df53
Fixing headline
florian-glombik May 24, 2024
ef67e65
Display checkout directory for aux repo only once in overview
florian-glombik May 24, 2024
1d409f0
Merge branch 'refs/heads/develop' into feature/programming-exercises/…
florian-glombik May 24, 2024
1e84a77
Fixing imports for client tests
florian-glombik May 24, 2024
789babd
Adjust translation
florian-glombik May 24, 2024
2ceb331
Fixing whitespaces in repository names
florian-glombik May 24, 2024
cedcc65
Apply suggestion, import with "type" for type only imports
florian-glombik May 24, 2024
25f1c74
Apply Self-review
florian-glombik May 24, 2024
2375062
Merge branch 'develop' into feature/programming-exercises/display-che…
florian-glombik May 24, 2024
4dfc532
Address review comments from Patrik
florian-glombik May 24, 2024
5405f48
Make Coderabbit happy
florian-glombik May 24, 2024
273d09c
Address review comments
florian-glombik May 24, 2024
1713c5c
Merge branch 'refs/heads/develop' into feature/programming-exercises/…
florian-glombik May 24, 2024
c72db60
Clarify translations
florian-glombik May 24, 2024
2293a75
Addressing review feedback
florian-glombik May 25, 2024
516cb00
Fixing typo in ocaml build script
florian-glombik May 26, 2024
f240279
Fixing typo in ocaml build script
florian-glombik May 26, 2024
e1d6c0a
Use template more often
florian-glombik May 27, 2024
0e1e3fd
Considering checkmark for checkoutSolutionRepository
florian-glombik May 28, 2024
e7c5bb2
Fixing reactivity of option not to checkout the solution repository
florian-glombik May 28, 2024
5fc3340
Adding javadoc
florian-glombik May 28, 2024
d2c3382
Merge branch 'refs/heads/develop' into feature/programming-exercises/…
florian-glombik May 28, 2024
2064f0e
Adjust checkout directory dto, only one possible checkout for solution
florian-glombik May 28, 2024
e9f3670
Convert component to standalone component
florian-glombik May 28, 2024
8a433a6
Use template for build plans aswell
florian-glombik May 28, 2024
ba91d61
Undo change for local testing
florian-glombik May 28, 2024
1693cc3
Refator reused template method
florian-glombik May 28, 2024
bea607c
Simplify usage of template
florian-glombik May 28, 2024
9387f8d
Make coderabbit happy
florian-glombik May 28, 2024
dd43e5e
Remove margin left
florian-glombik May 28, 2024
f7613ce
Address Patrik's review
florian-glombik May 29, 2024
cb580d0
Address Patrik's review
florian-glombik May 29, 2024
63aaf60
Address Patrik's review
florian-glombik May 29, 2024
6861683
Merge branch 'refs/heads/develop' into feature/programming-exercises/…
florian-glombik May 29, 2024
ba3a635
Adress feedback from Aniruddh
florian-glombik May 29, 2024
b3987c5
Merge branch 'develop' into feature/programming-exercises/display-che…
florian-glombik May 30, 2024
5c5fba9
Merge branch 'develop' into feature/programming-exercises/display-che…
florian-glombik May 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/de/tum/in/www1/artemis/security/Role.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
public enum Role {

// NOTE: we will soon rename "USER" to "STUDENT" in the database and add a new role "EDITOR"
// NOTE: we will soon rename "USER" to "STUDENT" in the database
florian-glombik marked this conversation as resolved.
Show resolved Hide resolved
ADMIN("ADMIN"), INSTRUCTOR("INSTRUCTOR"), EDITOR("EDITOR"), TEACHING_ASSISTANT("TA"), STUDENT("USER"), ANONYMOUS("ANONYMOUS");

public static final String ROLE_PREFIX = "ROLE_";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseParticipation;
import de.tum.in.www1.artemis.exception.ContinuousIntegrationException;
import de.tum.in.www1.artemis.service.connectors.ConnectorHealth;
import de.tum.in.www1.artemis.web.rest.dto.CheckoutDirectoriesDTO;

/**
* Abstract service for managing entities related to continuous integration.
Expand All @@ -41,7 +42,7 @@ enum BuildStatus {
* @param planKey the key of the plan
* @param repositoryUri the URI of the assignment repository (used to separate between exercise and solution)
* @param testRepositoryUri the URI of the test repository
* @param solutionRepositoryUri the URI of the solution repository. Only used for HASKELL exercises with checkoutSolutionRepository=true. Otherwise ignored.
* @param solutionRepositoryUri the URI of the solution repository. Only used for HASKELL exercises with checkoutSolutionRepository=true. Otherwise, ignored.
*/
void createBuildPlanForExercise(ProgrammingExercise exercise, String planKey, VcsRepositoryUri repositoryUri, VcsRepositoryUri testRepositoryUri,
VcsRepositoryUri solutionRepositoryUri);
Expand Down Expand Up @@ -124,7 +125,7 @@ String copyBuildPlan(ProgrammingExercise sourceExercise, String sourcePlanName,
* Get the build artifact (JAR/WAR), if any, of the latest build
*
* @param participation participation for which to get the build artifact
* @return the binary build artifact. Typically a JAR/WAR ResponseEntity.
* @return the binary build artifact. Typically, a JAR/WAR ResponseEntity.
*/
ResponseEntity<byte[]> retrieveLatestArtifact(ProgrammingExerciseParticipation participation);

Expand Down Expand Up @@ -238,7 +239,7 @@ public String forProgrammingLanguage(ProgrammingLanguage language) {
public String forProgrammingLanguage(ProgrammingLanguage language) {
return switch (language) {
case HASKELL, OCAML -> "solution";
default -> throw new IllegalArgumentException("Repository checkout path for solution repo has not yet been defined for " + language);
default -> throw new IllegalArgumentException("The solution repository is not checked out during the template/submission build plan for " + language);
};
}
}
Expand All @@ -255,4 +256,14 @@ interface CustomizableCheckoutPath {
*/
String forProgrammingLanguage(ProgrammingLanguage language);
}

/**
* Get the checkout directories for the template and submission build plan for a given programming language.
*
* @param programmingLanguage for which the checkout directories should be retrieved
* @param checkoutSolution whether the checkout solution repository shall be checked out during the template and submission build plan
* @return the paths of the checkout directories for the default repositories (exercise, solution, tests) for the
* template and submission build plan
*/
CheckoutDirectoriesDTO getCheckoutDirectories(ProgrammingLanguage programmingLanguage, boolean checkoutSolution);
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import de.tum.in.www1.artemis.domain.ProgrammingExercise;
import de.tum.in.www1.artemis.domain.ProgrammingSubmission;
import de.tum.in.www1.artemis.domain.VcsRepositoryUri;
import de.tum.in.www1.artemis.domain.enumeration.ProgrammingLanguage;
import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseParticipation;
import de.tum.in.www1.artemis.exception.ContinuousIntegrationException;
import de.tum.in.www1.artemis.exception.GitLabCIException;
Expand All @@ -37,6 +38,7 @@
import de.tum.in.www1.artemis.service.connectors.ci.AbstractContinuousIntegrationService;
import de.tum.in.www1.artemis.service.connectors.ci.CIPermission;
import de.tum.in.www1.artemis.service.connectors.ci.notification.dto.TestResultsDTO;
import de.tum.in.www1.artemis.web.rest.dto.CheckoutDirectoriesDTO;

@Profile("gitlabci")
@Service
Expand Down Expand Up @@ -322,4 +324,9 @@ public Optional<String> getWebHookUrl(String projectKey, String buildPlanId) {
log.error("Unsupported action: GitLabCIService.getWebHookUrl()");
return Optional.empty();
}

@Override
public CheckoutDirectoriesDTO getCheckoutDirectories(ProgrammingLanguage programmingLanguage, boolean checkoutSolution) {
throw new UnsupportedOperationException("Method not implemented, consult the build plans in GitLab for more information on the checkout directories.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import de.tum.in.www1.artemis.domain.ProgrammingExercise;
import de.tum.in.www1.artemis.domain.VcsRepositoryUri;
import de.tum.in.www1.artemis.domain.enumeration.BuildPlanType;
import de.tum.in.www1.artemis.domain.enumeration.ProgrammingLanguage;
import de.tum.in.www1.artemis.domain.enumeration.RepositoryType;
import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseParticipation;
import de.tum.in.www1.artemis.exception.ContinuousIntegrationException;
Expand All @@ -36,6 +37,7 @@
import de.tum.in.www1.artemis.service.connectors.ci.notification.dto.TestResultsDTO;
import de.tum.in.www1.artemis.service.connectors.jenkins.build_plan.JenkinsBuildPlanService;
import de.tum.in.www1.artemis.service.connectors.jenkins.jobs.JenkinsJobService;
import de.tum.in.www1.artemis.web.rest.dto.CheckoutDirectoriesDTO;

@Profile("jenkins")
@Service
Expand Down Expand Up @@ -252,4 +254,9 @@ public void createProjectForExercise(ProgrammingExercise programmingExercise) th
throw new JenkinsException("Error creating folder for exercise " + programmingExercise, e);
}
}

@Override
public CheckoutDirectoriesDTO getCheckoutDirectories(ProgrammingLanguage programmingLanguage, boolean checkoutSolution) {
throw new UnsupportedOperationException("Method not implemented, consult the build plans in Jenkins for more information on the checkout directories.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import de.tum.in.www1.artemis.domain.ProgrammingExercise;
import de.tum.in.www1.artemis.domain.VcsRepositoryUri;
import de.tum.in.www1.artemis.domain.enumeration.ProgrammingLanguage;
import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseParticipation;
import de.tum.in.www1.artemis.exception.LocalCIException;
import de.tum.in.www1.artemis.repository.ProgrammingExerciseRepository;
Expand All @@ -27,6 +28,9 @@
import de.tum.in.www1.artemis.service.connectors.aeolus.Windfile;
import de.tum.in.www1.artemis.service.connectors.ci.AbstractContinuousIntegrationService;
import de.tum.in.www1.artemis.service.connectors.ci.CIPermission;
import de.tum.in.www1.artemis.service.connectors.ci.ContinuousIntegrationService;
import de.tum.in.www1.artemis.web.rest.dto.BuildPlanCheckoutDirectoriesDTO;
import de.tum.in.www1.artemis.web.rest.dto.CheckoutDirectoriesDTO;

/**
* Implementation of ContinuousIntegrationService for local CI. Contains methods for communication with the local CI system.
Expand Down Expand Up @@ -219,4 +223,50 @@ public boolean checkIfBuildPlanExists(String projectKey, String buildPlanId) {
private String getCleanPlanName(String name) {
return name.toUpperCase().replaceAll("[^A-Z0-9]", "");
}

@Override
public CheckoutDirectoriesDTO getCheckoutDirectories(ProgrammingLanguage programmingLanguage, boolean checkoutSolution) {
BuildPlanCheckoutDirectoriesDTO submissionBuildPlanCheckoutDirectories = getSubmissionBuildPlanCheckoutDirectories(programmingLanguage, checkoutSolution);
BuildPlanCheckoutDirectoriesDTO solutionBuildPlanCheckoutDirectories = getSolutionBuildPlanCheckoutDirectories(submissionBuildPlanCheckoutDirectories);

return new CheckoutDirectoriesDTO(submissionBuildPlanCheckoutDirectories, solutionBuildPlanCheckoutDirectories);
}
florian-glombik marked this conversation as resolved.
Show resolved Hide resolved

private BuildPlanCheckoutDirectoriesDTO getSubmissionBuildPlanCheckoutDirectories(ProgrammingLanguage programmingLanguage, boolean checkoutSolution) {
String exerciseCheckoutDirectory = ContinuousIntegrationService.RepositoryCheckoutPath.ASSIGNMENT.forProgrammingLanguage(programmingLanguage);
String testCheckoutDirectory = ContinuousIntegrationService.RepositoryCheckoutPath.TEST.forProgrammingLanguage(programmingLanguage);

exerciseCheckoutDirectory = startPathWithRootDirectory(exerciseCheckoutDirectory);
testCheckoutDirectory = startPathWithRootDirectory(testCheckoutDirectory);

String solutionCheckoutDirectory = null;

if (checkoutSolution) {
try {
String solutionCheckoutDirectoryPath = ContinuousIntegrationService.RepositoryCheckoutPath.SOLUTION.forProgrammingLanguage(programmingLanguage);
solutionCheckoutDirectory = startPathWithRootDirectory(solutionCheckoutDirectoryPath);
}
catch (IllegalArgumentException exception) {
// not checked out during template & submission build
}
}

return new BuildPlanCheckoutDirectoriesDTO(exerciseCheckoutDirectory, solutionCheckoutDirectory, testCheckoutDirectory);
}

private String startPathWithRootDirectory(String checkoutDirectoryPath) {
final String ROOT_DIRECTORY = "/";
if (checkoutDirectoryPath == null || checkoutDirectoryPath.isEmpty()) {
return ROOT_DIRECTORY;
}

return checkoutDirectoryPath.startsWith(ROOT_DIRECTORY) ? checkoutDirectoryPath : ROOT_DIRECTORY + checkoutDirectoryPath;
}
florian-glombik marked this conversation as resolved.
Show resolved Hide resolved

private BuildPlanCheckoutDirectoriesDTO getSolutionBuildPlanCheckoutDirectories(BuildPlanCheckoutDirectoriesDTO submissionBuildPlanCheckoutDirectories) {
String solutionCheckoutDirectory = submissionBuildPlanCheckoutDirectories.exerciseCheckoutDirectory();
String testCheckoutDirectory = submissionBuildPlanCheckoutDirectories.testCheckoutDirectory();

return new BuildPlanCheckoutDirectoriesDTO(null, solutionCheckoutDirectory, testCheckoutDirectory);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package de.tum.in.www1.artemis.web.rest.dto;

import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
public record BuildPlanCheckoutDirectoriesDTO(String exerciseCheckoutDirectory, String solutionCheckoutDirectory, String testCheckoutDirectory) {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package de.tum.in.www1.artemis.web.rest.dto;

import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
public record CheckoutDirectoriesDTO(BuildPlanCheckoutDirectoriesDTO submissionBuildPlanCheckoutDirectories, BuildPlanCheckoutDirectoriesDTO solutionBuildPlanCheckoutDirectories) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
import de.tum.in.www1.artemis.service.programming.ProgrammingExerciseService;
import de.tum.in.www1.artemis.service.programming.ProgrammingExerciseTestCaseService;
import de.tum.in.www1.artemis.web.rest.dto.BuildLogStatisticsDTO;
import de.tum.in.www1.artemis.web.rest.dto.CheckoutDirectoriesDTO;
import de.tum.in.www1.artemis.web.rest.dto.ProgrammingExerciseResetOptionsDTO;
import de.tum.in.www1.artemis.web.rest.dto.SearchResultPageDTO;
import de.tum.in.www1.artemis.web.rest.dto.pageablesearch.SearchTermPageableSearchDTO;
Expand Down Expand Up @@ -878,4 +879,23 @@ public ResponseEntity<BuildLogStatisticsDTO> getBuildLogStatistics(@PathVariable
return ResponseEntity.ok(buildLogStatistics);
}

/**
* GET programming-exercises/repository-checkout-directories
*
* @param programmingLanguage for which the checkout directories should be retrieved
* @param checkoutSolution whether the checkout solution repository shall be checked out during the template and submission build plan,
* if not supplied set to true as default
* @return a DTO containing the checkout directories for the exercise, solution, and tests repository
* for the requested programming language for the submission and solution build.
*/
@GetMapping("programming-exercises/repository-checkout-directories")
@EnforceAtLeastEditor
@FeatureToggle(Feature.ProgrammingExercises)
public ResponseEntity<CheckoutDirectoriesDTO> getRepositoryCheckoutDirectories(@RequestParam(value = "programmingLanguage") ProgrammingLanguage programmingLanguage,
@RequestParam(value = "checkoutSolution", defaultValue = "true") boolean checkoutSolution) {
log.debug("REST request to get checkout directories for programming language: {}", programmingLanguage);

CheckoutDirectoriesDTO repositoriesCheckoutDirectoryDTO = continuousIntegrationService.orElseThrow().getCheckoutDirectories(programmingLanguage, checkoutSolution);
return ResponseEntity.ok(repositoriesCheckoutDirectoryDTO);
}
}
6 changes: 3 additions & 3 deletions src/main/resources/templates/ocaml/test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ cp_code solution
echo 'include Assignment' > solution/solution.ml
cp_code assignment

# select if tests are run by generated source code as studen toplevel code may run before the tests and be able to spoof a runtime signal
# select if tests are run by generated source code as student toplevel code may run before the tests and be able to spoof a runtime signal
echo "let runHidden = $RUN_HIDDEN" > test/runHidden.ml

# shellcheck disable=SC2046
Expand All @@ -69,8 +69,8 @@ if ! timeout -s SIGTERM $BUILD_TIMEOUT checker/checker.exe; then
echo "Unable to build submission, please ensure that your code builds and matches the provided interface" >&2
exit 0
fi
# build the sudent submission
# don't reference the tests or solution, so that we can show the build output to the sudent and not leak test / solution code
# build the student submission
# don't reference the tests or solution, so that we can show the build output to the student and not leak test / solution code
if ! timeout -s SIGTERM $BUILD_TIMEOUT dune build --force assignment; then
echo "Unable to build submission, please ensure that your code builds and matches the provided interface" >&2
exit 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ <h3 class="section-headline" [id]="headlinesRecord[section.headline]">{{ section
</a>
}
<div class="auxiliaryRepositoryDescription">
@if (auxiliaryRepository.checkoutDirectory) {
florian-glombik marked this conversation as resolved.
Show resolved Hide resolved
<span>Checkout Directory: {{ auxiliaryRepository.checkoutDirectory }} </span>
} @else {
@if (!auxiliaryRepository.checkoutDirectory) {
<fa-icon [icon]="faExclamationTriangle" class="text-warning me-1" [ngbTooltip]="noCheckoutDirectorySetTooltip" />
<span jhiTranslate="artemisApp.programmingExercise.noCheckoutDirectorySet"></span>
}
Expand Down Expand Up @@ -285,6 +283,16 @@ <h3 class="section-headline" [id]="headlinesRecord[section.headline]">{{ section
}
</dd>
}
@case (DetailType.ProgrammingCheckoutDirectories) {
<dd id="detail-value-{{ detail.title }}">
<jhi-programming-exercise-repository-and-build-plan-details
[programmingExercise]="detail.data.exercise"
[programmingLanguage]="detail.data.programmingLanguage"
[isLocal]="detail.data.isLocal"
[checkoutSolutionRepository]="detail.data.exercise.checkoutSolutionRepository"
/>
</dd>
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export enum DetailType {
ProgrammingProblemStatement = 'detail-problem-statement',
ProgrammingTimeline = 'detail-timeline',
ProgrammingBuildStatistics = 'detail-build-statistics',
ProgrammingCheckoutDirectories = 'detail-checkout-directories',
}

@Component({
Expand Down
16 changes: 13 additions & 3 deletions src/main/webapp/app/detail-overview-list/detail.model.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { GradingCriterion } from 'app/exercises/shared/structured-grading-criterion/grading-criterion.model';
import { ProgrammingExercise } from 'app/entities/programming-exercise.model';
import type { ProgrammingExercise, ProgrammingLanguage } from 'app/entities/programming-exercise.model';
import { TemplateProgrammingExerciseParticipation } from 'app/entities/participation/template-programming-exercise-participation.model';
import { SolutionProgrammingExerciseParticipation } from 'app/entities/participation/solution-programming-exercise-participation.model';
import { ProgrammingExerciseInstructorRepositoryType } from 'app/exercises/programming/manage/services/programming-exercise.service';
import { AuxiliaryRepository } from 'app/entities/programming-exercise-auxiliary-repository-model';
import { ProgrammingExerciseParticipationType } from 'app/entities/programming-exercise-participation.model';
import { ProgrammingExerciseGitDiffReport } from 'app/entities/hestia/programming-exercise-git-diff-report.model';
import { BuildLogStatisticsDTO } from 'app/exercises/programming/manage/build-log-statistics-dto';
import { BuildLogStatisticsDTO } from 'app/entities/build-log-statistics-dto';
import { DetailType } from 'app/detail-overview-list/detail-overview-list.component';
import { SafeHtml } from '@angular/platform-browser';
import { UMLDiagramType, UMLModel } from '@ls1intum/apollon';
Expand All @@ -33,7 +33,8 @@ type ShownDetail =
| ProgrammingDiffReportDetail
| ProgrammingProblemStatementDetail
| ProgrammingTimelineDetail
| ProgrammingBuildStatisticsDetail;
| ProgrammingBuildStatisticsDetail
| ProgrammingCheckoutDirectoriesDetail;

interface DetailBase {
type: DetailType;
Expand Down Expand Up @@ -129,3 +130,12 @@ interface ProgrammingBuildStatisticsDetail extends DetailBase {
buildLogStatistics: BuildLogStatisticsDTO;
};
}

interface ProgrammingCheckoutDirectoriesDetail extends DetailBase {
type: DetailType.ProgrammingCheckoutDirectories;
data: {
exercise: ProgrammingExercise;
programmingLanguage?: ProgrammingLanguage;
isLocal: boolean;
};
}
4 changes: 4 additions & 0 deletions src/main/webapp/app/detail-overview-list/detail.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { ArtemisProgrammingExerciseLifecycleModule } from 'app/exercises/program
import { AssessmentInstructionsModule } from 'app/assessment/assessment-instructions/assessment-instructions.module';
import { IrisModule } from 'app/iris/iris.module';
import { ArtemisModelingEditorModule } from 'app/exercises/modeling/shared/modeling-editor.module';
import { ProgrammingExerciseBuildPlanCheckoutDirectoriesComponent } from 'app/exercises/programming/shared/build-details/programming-exercise-build-plan-checkout-directories.component';
import { ProgrammingExerciseRepositoryAndBuildPlanDetailsComponent } from 'app/exercises/programming/shared/build-details/programming-exercise-repository-and-build-plan-details.component';

@NgModule({
imports: [
Expand All @@ -27,6 +29,8 @@ import { ArtemisModelingEditorModule } from 'app/exercises/modeling/shared/model
AssessmentInstructionsModule,
IrisModule,
ArtemisModelingEditorModule,
ProgrammingExerciseBuildPlanCheckoutDirectoriesComponent,
ProgrammingExerciseRepositoryAndBuildPlanDetailsComponent,
],
declarations: [DetailOverviewListComponent],
exports: [DetailOverviewListComponent],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export class BuildPlanCheckoutDirectoriesDTO {
exerciseCheckoutDirectory?: string;
solutionCheckoutDirectory?: string;
testCheckoutDirectory: string;
}
Loading
Loading