-
Notifications
You must be signed in to change notification settings - Fork 276
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
Development
: Refactor RepositoryAccessService and plagiarism access check
#8209
Development
: Refactor RepositoryAccessService and plagiarism access check
#8209
Conversation
WalkthroughThis update introduces significant improvements to repository access control, file retrieval, and plagiarism functionality within the system. It simplifies the constructor of the Changes
Related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
.../in/www1/artemis/web/rest/repository/RepositoryProgrammingExerciseParticipationResource.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/in/www1/artemis/web/rest/repository/RepositoryResource.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job in general, I have a few remarks
src/main/java/de/tum/in/www1/artemis/service/RepositoryAccessService.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/in/www1/artemis/service/RepositoryAccessService.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/in/www1/artemis/service/RepositoryAccessService.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/in/www1/artemis/service/RepositoryAccessService.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/in/www1/artemis/service/RepositoryAccessService.java
Outdated
Show resolved
Hide resolved
.../in/www1/artemis/web/rest/repository/RepositoryProgrammingExerciseParticipationResource.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/in/www1/artemis/web/rest/repository/RepositoryResource.java
Outdated
Show resolved
Hide resolved
…ervice.java Co-authored-by: Julian Christl <julian.christl@tum.de>
…ervice.java Co-authored-by: Julian Christl <julian.christl@tum.de>
…ervice.java Co-authored-by: Julian Christl <julian.christl@tum.de>
…ervice.java Co-authored-by: Julian Christl <julian.christl@tum.de>
src/main/java/de/tum/in/www1/artemis/service/RepositoryAccessService.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/in/www1/artemis/service/RepositoryAccessService.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/in/www1/artemis/service/RepositoryAccessService.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/in/www1/artemis/service/RepositoryAccessService.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/in/www1/artemis/service/RepositoryAccessService.java
Show resolved
Hide resolved
src/main/java/de/tum/in/www1/artemis/service/RepositoryAccessService.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/in/www1/artemis/service/RepositoryAccessService.java
Outdated
Show resolved
Hide resolved
…access-service' into development/refactor-repository-access-service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's also a nice way of doing it. Good job with the changes! Code looks good now!
src/main/java/de/tum/in/www1/artemis/service/RepositoryAccessService.java
Show resolved
Hide resolved
…velopment/refactor-repository-access-service
src/main/java/de/tum/in/www1/artemis/web/rest/TextSubmissionResource.java
Outdated
Show resolved
Hide resolved
…source.java Co-authored-by: Lucas Welscher <ga53foy@mytum.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good to me.
Tested locally, students are able to see the other student's code (in case of a plagriarism accousation) only after the deadline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
demonstrated in testing session. lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapprove code, changes look good
10 e2e tests consistently fail. Please double check what is happening there |
Checklist
General
Server
Client
Changes affecting Programming Exercises
Motivation and Context
Currently, the
RepositoryAccessService
isn't very well written or easily readable. It plays a vital role in the security of Artemis programming exercises. Therefore, it should be refactored following these rules:https://docs.artemis.cit.tum.de/admin/accessRights.html#programming-exercises-repository-access
Description
RepositoryAccessService
was refactored. We also fetch the files for the plagiarism check separately with their own endpoints. These check the plagiarism access instead of the general repository access.Steps for Testing
Prerequisites:
1 Admin
1 Instructor
1 Tutor
1 Student
1 Programming Exercises
Create different Programming Exercises with different rules and check that you can only access the repositories in the expected way (https://docs.artemis.cit.tum.de/admin/accessRights.html#programming-exercises-repository-access)
Also check that instructors and students can still view the plagiarism views as expected
Exam Mode Testing
Prerequisites:
1 Admin
1 Instructor
1 Tutor
1 Student
1 Exam with Programming Exercises
Create an Exam with different Programming Exercises with different rules and check that you can only access the repositories in the expected way (https://docs.artemis.cit.tum.de/admin/accessRights.html#programming-exercises-repository-access)
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Review Progress
Performance Review
Code Review
Manual Tests
Exam Mode Test
Test Coverage
Screenshots
Summary by CodeRabbit
RepositoryAccessService
.RepositoryAccessService
to handle user roles and actions more effectively.RepositoryService
andRepositoryResource
for better readability and maintainability.