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

Integrated code lifecycle: Simplify repository handling for commit history #8546

Merged
merged 55 commits into from
May 18, 2024

Conversation

krusche
Copy link
Member

@krusche krusche commented May 5, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
  • I strictly followed the server coding and design guidelines.
  • I documented the Java code using JavaDoc style.

Client

Changes affecting Programming Exercises

  • 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).

Motivation and Context

To compare commits, the commit detail view retrieves the content of a repository. This always involved the server having to clone / checkout / pull the local repository at each commit, scanning the working copy, then rewinding. On production, this resulted in longer waiting times.

Description

  • Some endpoints were changed to allow for handling both regular student participations and the "special" repository types of a programming exercise
  • Endpoints used in the commit history view were adjusted to allow retrieving the file content from the bare (remote) repository as well if LocalVC is active. This avoids the process mentioned above.

Steps for Testing

Prerequisites:

  • Test Server with LocalVC enabled
  • 1 Instructor
  • 1 Student
  • 1 Programming exercise with
    • 1 regular participation with a few commits
    • A few commits each in the template, test, and solution repositories (you can use Edit in Editor for this)

Template, Test, and Solution repositories

  1. Log in as the instructor
  2. Navigate to course management > Your course > Exercises > Click on the title of your programming exercise
  3. Scroll down to where the template, solution, and test repositories are listed.
  4. For each of these repositories, click "Open Repository," then go to the commit history.
  5. Verify that you get no errors when viewing the history and that the commits you made are listed and correctly displayed when you click on them.

Regular participations

  1. Log in as the student
  2. Navigate to courses > your course > your exercise > Open repository
  3. Verify that you get no errors when viewing the history and that the commits you made are listed and correctly displayed when you click on them.

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked






Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Client

Class/File Line Coverage Confirmation (assert/expect)
programming-exercise-participation.service.ts 93.75%
programming-exercise.service.ts 90.62%
commit-details-view.component.ts 95.08%

Server

Note: More extensive testing of this new functionality will be done in a follow-up PR, as the repository setup of the tests currently does not allow us to test it properly.

Class/File Line Coverage Confirmation (assert/expect)
GitService.java 83%
CommitHistoryService.java 87%
ProgrammingExerciseGitDiffReportResource.java 79%
ProgrammingExerciseParticipationResource.java 60%
RepositoryProgrammingExerciseParticipationResource.java 84%
RepositoryResource.java 91%
TestRepositoryResource.java 83%

@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) labels May 5, 2024
@krusche krusche added this to the 7.0.4 milestone May 5, 2024
@krusche krusche modified the milestones: 7.0.4, 7.0.5 May 7, 2024
Copy link
Member

@BBesrour BBesrour 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:

  • Commit history for Test, Template, and Solution open with no error and display correct commits (commit view displays correct changes)
  • Same for regular participation

Copy link
Contributor

@az108 az108 left a comment

Choose a reason for hiding this comment

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

Tested on TS2 and works as expected without any errors and all commits being displayed correctly. Code LGTM

Copy link
Contributor

@florian-glombik florian-glombik left a comment

Choose a reason for hiding this comment

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

The code looks good to me 👍

Copy link
Contributor

@kaancayli kaancayli left a comment

Choose a reason for hiding this comment

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

Tested on TS2. Works as expected. Code lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) ready to merge server Pull requests that update Java code. (Added Automatically!) tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants