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: Fix missing branch configuration #7189

Merged
merged 6 commits into from
Sep 14, 2023

Conversation

krusche
Copy link
Member

@krusche krusche commented Sep 13, 2023

Checklist

General

Motivation and Context

The branch attribute was missing in the client. Therefore, whenever an instructor edits a programming exercise, the branch was set to null in the database which is problematic, because the branch information might be needed in follow-up operations.

Description

Since the user should not even be able to change the branch name after creation, we override it in the update endpoint before saving the entity.

Steps for Testing

Prerequisites:

  • 1 Instructor
  1. Create a new programming exercise
  2. Open the edit screen: verify in the chrome console (or database) that the branch is available
  3. Save the programming exercise and open the edit page again: verify in the chrome console (or database) that the branch is available

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) labels Sep 13, 2023
@krusche krusche added this to the 6.5.0 milestone Sep 13, 2023
@krusche krusche marked this pull request as ready for review September 13, 2023 06:26
@krusche krusche requested a review from a team as a code owner September 13, 2023 06:26
jakubriegel
jakubriegel previously approved these changes Sep 13, 2023
Copy link
Contributor

@jakubriegel jakubriegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM 👍🏻

@krusche
Copy link
Member Author

krusche commented Sep 13, 2023

Seems that the change is not yet working. Probably some JsonIgnore prevents this

@github-actions github-actions bot removed the client Pull requests that update TypeScript code. (Added Automatically!) label Sep 13, 2023
Copy link
Contributor

@reschandreas reschandreas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested locally, sets branch as expected.

@@ -266,6 +266,9 @@ public ResponseEntity<ProgrammingExercise> updateProgrammingExercise(@RequestBod
// Forbid conversion between normal course exercise and exam exercise
exerciseService.checkForConversionBetweenExamAndCourseExercise(updatedProgrammingExercise, programmingExerciseBeforeUpdate, ENTITY_NAME);

// Ignore changes to the default branch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still a temporal solution or will is stay here for good?

@krusche krusche merged commit 61a9490 into develop Sep 14, 2023
@krusche krusche deleted the bugfix/programming-exercises/missing-branch branch September 14, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix component:Programming ready for review server Pull requests that update Java code. (Added Automatically!) small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants