Skip to content

Commit

Permalink
rename argument
Browse files Browse the repository at this point in the history
  • Loading branch information
reschandreas committed Oct 14, 2023
1 parent 92edb84 commit ddd97b0
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ public ProgrammingExerciseService(ProgrammingExerciseRepository programmingExerc
* </ol>
*
* @param programmingExercise The programmingExercise that should be setup
* @param imported defines if the programming exercise is imported
* @param isImportedFromFile defines if the programming exercise is imported from a file
* @return The new setup exercise
* @throws GitAPIException If something during the communication with the remote Git repository went wrong
* @throws IOException If the template files couldn't be read
*/
@Transactional // TODO: apply the transaction on a smaller scope
// ok because we create many objects in a rather complex way and need a rollback in case of exceptions
public ProgrammingExercise createProgrammingExercise(ProgrammingExercise programmingExercise, boolean imported) throws GitAPIException, IOException {
public ProgrammingExercise createProgrammingExercise(ProgrammingExercise programmingExercise, boolean isImportedFromFile) throws GitAPIException, IOException {
programmingExercise.generateAndSetProjectKey();
final User exerciseCreator = userRepository.getUser();

Expand All @@ -223,7 +223,7 @@ public ProgrammingExercise createProgrammingExercise(ProgrammingExercise program

channelService.createExerciseChannel(savedProgrammingExercise, Optional.ofNullable(programmingExercise.getChannelName()));

setupBuildPlansForNewExercise(savedProgrammingExercise, imported);
setupBuildPlansForNewExercise(savedProgrammingExercise, isImportedFromFile);
// save to get the id required for the webhook
savedProgrammingExercise = programmingExerciseRepository.saveAndFlush(savedProgrammingExercise);

Expand Down Expand Up @@ -346,10 +346,10 @@ public void validateStaticCodeAnalysisSettings(ProgrammingExercise programmingEx
*
* @param programmingExercise Programming exercise for the build plans should be generated. The programming
* exercise should contain a fully initialized template and solution participation.
* @param isImported defines if the programming exercise is imported from a source exercise, if the
* @param isImportedFromFile defines if the programming exercise is imported from a file, if the
* exercise is imported, the build plans will not be triggered to prevent erroneous builds
*/
public void setupBuildPlansForNewExercise(ProgrammingExercise programmingExercise, boolean isImported) {
public void setupBuildPlansForNewExercise(ProgrammingExercise programmingExercise, boolean isImportedFromFile) {
String projectKey = programmingExercise.getProjectKey();
// Get URLs for repos
var exerciseRepoUrl = programmingExercise.getVcsTemplateRepositoryUrl();
Expand All @@ -370,7 +370,7 @@ public void setupBuildPlansForNewExercise(ProgrammingExercise programmingExercis

// if the exercise is imported from a file, the changes fixing the project name will trigger a first build anyway, so
// we do not trigger them here
if (!isImported) {
if (!isImportedFromFile) {
// trigger BASE and SOLUTION build plans once here
continuousIntegrationTriggerService.orElseThrow().triggerBuild(programmingExercise.getTemplateParticipation());
continuousIntegrationTriggerService.orElseThrow().triggerBuild(programmingExercise.getSolutionParticipation());
Expand Down

0 comments on commit ddd97b0

Please sign in to comment.