-
Notifications
You must be signed in to change notification settings - Fork 293
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
: Insert repository content consistently when preparing for building
#9521
Integrated code lifecycle
: Insert repository content consistently when preparing for building
#9521
Conversation
…x/fix-auxiliary-repository-build-insertion
…plicity-auxiliary-repo-tool-tip
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
Integrated Code Lifecycle
: Replace content when injecting auxiliary repositoriesIntegrated code lifecycle
: Replace content when injecting auxiliary repositories
Integrated code lifecycle
: Replace content when injecting auxiliary repositoriesIntegrated code lifecycle
: Replace content when inserting repositories to build plan
Integrated code lifecycle
: Replace content when inserting repositories to build planIntegrated code lifecycle
: Add repository content consistently when preparing for building
Integrated code lifecycle
: Add repository content consistently when preparing for buildingIntegrated code lifecycle
: Insert repository content consistently when preparing for building
…city-auxiliary-repo-tool-tip' into bugfix/fix-auxiliary-repository-build-insertion
WalkthroughThe pull request introduces significant changes to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
src/main/webapp/i18n/en/programmingExercise.json (1)
538-538
: LGTM! Consider adding a note about the overwrite behavior.The updated description accurately reflects the new standardized behavior of auxiliary repository content insertion. It clearly explains the timing, impact, and mitigation steps.
Consider adding a warning symbol (
⚠️ ) or making "overwrites everything" bold to emphasize the destructive nature of this operation:- "usageDescription": "You can use auxiliary repositories to provide additional code that students cannot see or modify. The additional code is inserted into the specified checkout directory before the submission is built. The inserted code overwrites everything which lies at the location specified by the checkout directory. If you only need to overwrite student files partially, you need to adapt the build script.", + "usageDescription": "You can use auxiliary repositories to provide additional code that students cannot see or modify. The additional code is inserted into the specified checkout directory before the submission is built. ⚠️ The inserted code **overwrites everything** which lies at the location specified by the checkout directory. If you only need to overwrite student files partially, you need to adapt the build script.",
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (4)
- src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobContainerService.java (2 hunks)
- src/main/webapp/app/exercises/programming/manage/update/update-components/programming-exercise-information.component.scss (1 hunks)
- src/main/webapp/i18n/de/programmingExercise.json (1 hunks)
- src/main/webapp/i18n/en/programmingExercise.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobContainerService.java (1)
Pattern
src/main/java/**/*.java
: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_importssrc/main/webapp/i18n/de/programmingExercise.json (1)
Pattern
src/main/webapp/i18n/de/**/*.json
: German language translations should be informal (dutzen) and should never be formal (sietzen). So the user should always be addressed with "du/dein" and never with "sie/ihr".
🪛 GitHub Check: Codacy Static Code Analysis
src/main/webapp/app/exercises/programming/manage/update/update-components/programming-exercise-information.component.scss
[warning] 5-5: src/main/webapp/app/exercises/programming/manage/update/update-components/programming-exercise-information.component.scss#L5
Unexpected unknown pseudo-element selector "::ng-deep" (selector-pseudo-element-no-unknown)
🔇 Additional comments (3)
src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobContainerService.java (2)
303-313
: LGTM: Consistent directory content replacement implementation.The changes standardize the behavior of repository content insertion by using
addAndPrepareDirectoryAndReplaceContent
consistently across all repository types (test, assignment, solution, and auxiliary repositories).
324-329
: Consider potential race conditions in directory operations.While the implementation is logically correct, concurrent container operations might lead to race conditions between directory removal and rename operations. Consider implementing atomic operations or adding synchronization mechanisms to ensure thread safety.
Run this script to check for concurrent container operations:
src/main/webapp/i18n/de/programmingExercise.json (1)
538-538
: LGTM! The translation accurately describes the new behavior.The German translation:
- Uses the correct informal language style ("du/dein")
- Clearly explains that auxiliary repository content overwrites existing files
- Properly warns users about the need to adjust build scripts for partial overwrites
- Aligns with the PR objective of standardizing repository content insertion behavior
src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobContainerService.java
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.
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 👍
Checklist
General
Server
Changes affecting Programming Exercises
Motivation and Context
The current behaviour of repository injection before the build is the following:
During build preparation, the repositories contents are copied to the locations specified by the checkout directories.
Since the
mv
command is used, the behaviour is different, depending on whether the folder already exists or not.Example:
Let's assume an exercise, with the following folder and file structure:
We add an auxiliary repository like this:
Now, when the build preparation runs, and the auxiliary repository is copied to the build files, the folder structure looks like this (assuming the auxiliary repository also just contains a "AuxFile.java"):
In case the "filesThatShouldBeReplaced" folder does not exist in the template, the auxiliary repositories files are directly inserted, without the aux repos name, as the directory itself can be renamed (that's how mv works).
This is also the way we want it to work, when the folder does already exist. The auxiliary repository should overwrite existing files.
In our example, this is what we would like to have after the auxiliary repository insertion:
Description
We want a consistent insertion behaviour across all the repositories of an exercise, nonetheless whether the directory specified in the checkout path already exists or not.
To enable this consistent insertion behaviour, before moving the repository content into the build folders, we need to remove the existing files and folder first.
TL:DR now instead of
we do:
We want this to be the standard behaviour, as it is consistent, and does not depend on whether the $checkoutDirectory exists or not.
Steps for Testing
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.
Review Progress
Performance Review
Code Review
Manual Tests
Exam Mode Test
Test Coverage
Screenshots
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
These updates aim to improve user experience and ensure more reliable build processes.