Add API for GitManager features#54
Merged
reddevilmidzy merged 4 commits into40-revisionfrom Nov 2, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds API endpoints for Git-based revision management features to enable version control for problem files. The implementation exposes existing GitManager functionality through REST APIs.
Key Changes:
- Added three new API endpoints for Git operations: problem initialization, commit management, and status tracking
- Refactored GitManager to support stateless operation by accepting problem_id as a parameter
- Updated tests to reflect API path changes from singular (
/solution) to plural (/solutions)
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib.rs | Added new router configurations for /problems/init and /changes endpoints with GitManager state |
| src/file_manager/handlers.rs | Implemented handler functions for create_problem, commit_changes, get_log, and get_status endpoints |
| src/file_manager/git.rs | Refactored GitManager from stateful (storing problem_id) to stateless design, made structs/methods public, added Serialize traits |
| src/file_manager/models.rs | Added CommitRequest model for commit message payload |
| src/file_manager/mod.rs | Exposed git module contents via pub(crate) use |
| tests/file_manager/handlers.rs | Updated all test cases to use new API paths and added integration tests for new Git endpoints |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Member
Author
|
POST |
w8385
approved these changes
Oct 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
기존에 구현하였던 리비전 기능에 API를 추가하였습니다.
API
/problems/init/{problem_id}: 문제 생성 API/changes/{problem_id}/commitbody: {"message": "..."}: 스테이지에 올라온 변경사항을 커밋한다./changes/{problem_id}/log: 커밋 로그를 가져온다.Details
[ { "message": "create message", "paths": [ { "path": "tests/e.py", "status": "ADDED" }, { "path": "tests/tmp.py", "status": "ADDED" } ], "time": 1760694085, "user": "admin" }, { "message": "create message", "paths": [ { "path": "solutions/c.py", "status": "ADDED" } ], "time": 1760693623, "user": "admin" } ]/changes/{problem_id}/status: 커밋되지 않은 변경사항(스테이징 영역)을 가져온다.Details
[ { "status": "ADDED", "path": "solutions/e.py" } ]