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 repository and participation unlock for due date change in programming exercise #8182

Merged
merged 3 commits into from
Mar 17, 2024

Conversation

mateusmm01
Copy link
Contributor

@mateusmm01 mateusmm01 commented Mar 12, 2024

Checklist

General

  • This is a small issue that I tested locally and was confirmed by another developer on a test server.

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

Currently, when changing the due date from the past to the future, participations kept on being locked. This fixes #8176

Description

Two methods were switched.

Steps for Testing

Deploy on ts3, ts6 and localci-staging

Prerequisites:

  • 1 Instructor
  • 1 Programming Exercise
  1. Log in to Artemis
  2. Create a Programming Exercise with the due date in the past.
  3. Change the due date to the future
  4. Check that you can access the repositories by pushing code or opening the code editor.
  5. Now change the due date again to the past and check that everything is locked
  6. Try once again to change the due date to the future and check that everything works as expected

Testserver States

Note

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







Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Test Coverage

Screenshots

Summary by CodeRabbit

Summary by CodeRabbit

  • Refactor
    • Improved the management of student repositories and participations in programming exercises for enhanced reliability and performance.

@github-actions github-actions bot added the server Pull requests that update Java code. (Added Automatically!) label Mar 12, 2024
@artemis-bot artemis-bot added this to In progress in Artemis Development Mar 12, 2024
@mateusmm01 mateusmm01 marked this pull request as ready for review March 12, 2024 12:57
@mateusmm01 mateusmm01 requested a review from a team as a code owner March 12, 2024 12:57
Copy link

coderabbitai bot commented Mar 12, 2024

Walkthrough

The recent update primarily involves modifications in how student repositories and participations are unlocked in relation to programming exercises within a specific timeframe. The adjustments ensure that the unlocking process aligns more accurately with the updated deadlines, thereby addressing issues related to repository access post-deadline extensions. This change aims to enhance the flexibility and usability for students working on programming exercises, ensuring deadlines are dynamically applied and access issues are minimized.

Changes

File Change Summary
.../scheduled/ProgrammingExerciseScheduleService.java - unlockAllStudentRepositoriesAndParticipationsWithEarlierStartDateAndLaterDueDate now invokes unlockStudentRepositoryAndParticipation.
- unlockAllStudentRepositoriesWithEarlierStartDateAndLaterDueDate now utilizes unlockStudentRepository.
.../exercise/programmingexercise/ProgrammingExerciseRepositoryServiceTest.java - Added imports for ProgrammingExerciseStudentParticipation, ParticipationUtilService, and UserUtilService.
- Added a constant TEST_PREFIX.
- Added initialization for ParticipationUtilService, UserUtilService, and ProgrammingExerciseStudentParticipation.
- Added a constant TIMEOUT_MS.
- Added method calls for locking and unlocking student repositories and participations.
- Updated test methods for handling repository access rights based on changes in ProgrammingExercise attributes.

Assessment against linked issues

Objective Addressed Explanation
Identify why the extended deadline for a programming exercise was not applied to student repositories. (#8176)
Determine if the issue is related to the transfer to the new integrated code lifecycle or a general problem. (#8176) The summary does not specify if this aspect was directly addressed, suggesting further investigation might be needed.
Reproduce the issue by creating a programming exercise with a deadline, extending the deadline, and encountering errors when accessing student repositories post-deadline. (#8176) The summary focuses on the solution rather than detailing the reproduction steps or the investigation process.
Ensure that students can continue working on exercises before and after the original deadline without encountering errors like "Repository locked" or Error 500. (#8176) The change in methods for unlocking repositories and participations directly addresses this concern by potentially fixing the issue where students encountered access errors post-deadline.
Investigate the impact of the Artemis version 6.9.1 and the Chrome browser on the issue. (#8176) The summary does not mention any investigation related to specific Artemis versions or browser compatibility issues.

The table highlights that while the primary concern of ensuring students can access and work on programming exercises post-deadline extension seems to be addressed, other detailed investigations into the cause and specific scenarios like browser impact were not explicitly covered in the summary provided.

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?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@Strohgelaender
Copy link
Contributor

Can you add server tests for this?

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.

demonstrated in testing session, code also lgtm!

Copy link
Contributor

@laurenzfb laurenzfb 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. Tested in testing session on TS6. Thanks for fixing this :)

Copy link
Contributor

@pzdr7 pzdr7 left a comment

Choose a reason for hiding this comment

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

Code looks good 👍

@krusche krusche changed the title Development: Fix repository and participation unlock for due date change in programming exercise Programming exercises: Fix repository and participation unlock for due date change in programming exercise Mar 17, 2024
@krusche krusche added this to the 6.9.3 milestone Mar 17, 2024
@krusche krusche merged commit 8feb84c into develop Mar 17, 2024
51 of 55 checks passed
@krusche krusche deleted the bugfix/fix-repository-unlock-for-due-date-change branch March 17, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix ready for review ready to merge server Pull requests that update Java code. (Added Automatically!) small tests
Projects
Archived in project
Artemis Development
  
Ready for review
Development

Successfully merging this pull request may close these issues.

Changed programming exercise deadline not applied to repositories
7 participants