-
Notifications
You must be signed in to change notification settings - Fork 301
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
: Improve git URI handling for LocalVC
#8484
Conversation
WalkthroughThe recent changes in the Artemis project focus on enhancing URI management by simplifying the constructor of Changes
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Additional Context UsedPath-based Instructions (2)
Additional comments not posted (27)
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 (
|
Integrated code lifecycle
: Improve LocalVCRepositoryUri constructor when creating it from a URLIntegrated code lifecycle
: Improve one constructor of LocalVCRepositoryUri
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
src/test/java/de/tum/in/www1/artemis/localvcci/LocalVCLocalCITestService.java
Show resolved
Hide resolved
Integrated code lifecycle
: Improve one constructor of LocalVCRepositoryUriIntegrated code lifecycle
: Improve git URI handling
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: 0
Out of diff range and nitpick comments (1)
src/main/java/de/tum/in/www1/artemis/domain/VcsRepositoryUri.java (1)
Line range hint
103-113
: Optimize folder name extraction from URI.Consider simplifying the logic for extracting folder names from URIs to improve maintainability.
- path = path.replaceAll("\\.git$", ""); - path = path.replaceAll("/$", ""); - path = path.replaceAll("^/.*scm", ""); - path = path.replaceAll("^.*?/git/", "/"); + path = path.replaceFirst("^.*?/git/", "").replaceAll("\\.git$", "").replaceAll("/$", "");
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: 2
Integrated code lifecycle
: Improve git URI handlingDevelopment
: Improve git URI handling
Development
: Improve git URI handlingDevelopment
: Improve git URI handling for LocalVC
Checklist
General
Server
Changes affecting Programming Exercises
Motivation and Context
Currently the LocalVCRepositoryUri to create it from a URL is not very well done:
Description
I removed the check and improved the code.
Added JavaDoc and tests to make sure the URI handling is correct
Steps for Testing
Prerequisites:
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
Summary by CodeRabbit
VcsRepositoryUri
class with new methods for manipulating and extracting information from VCS repository URIs.LocalVCRepositoryUri
constructor for improved URL parsing, validation, and error handling.RepositoryUriTests
for parsing and validating various types of repository URIs.