-
Subtasks:
- • Backend: GET /api/projects/{id}/repo/files → List files
- • Backend: GET /api/projects/{id}/repo/file?path=README.md → File contents
- • Frontend: Add repo tab or inline section in ProjectDetails
- • Render README contents in a Markdown viewer (if present)
- • Fallback message if repo is empty
-
Repo Browser (JGit-based): Detailed Work Estimate
Release: 1.9
Feature: Project-level Git repository browser (read-only)
Backend: JGit
UI: Minimal, project-scoped browser
Total Estimate: 8 hours
Scope Reminder (Baseline)
- Default branch only
- Snapshot at
HEAD - Read-only
- Directory listing + raw text file view
- No syntax highlighting
- No diffs, history, blame, or branch switching
This estimate assumes the current JGit-based controller implementation as the starting point.
Detailed Work Breakdown
1. Backend Hardening & Refinement (2.0 hours)
Objective: Make the existing JGit controller production-safe for 1.9.
- Normalize branch resolution logic
- Handle
refs/heads/*vs symbolic refs - Clear error semantics when branch not found
- Handle
- Guardrails
- File size limits for
/contents/raw - Binary file detection (fail fast)
- File size limits for
- Path handling
- Prevent path traversal edge cases
- Clean handling of root vs subdirectory paths
- Logging & error mapping
- Map JGit exceptions → HTTP responses
- Add minimal structured logs
Estimate: 2.0h
2. JGit Backend Unit Tests (3.0 hours)
Objective: Add focused unit tests validating Git traversal logic.
- Test setup
- Create temporary Git repositories in tests
- Programmatically commit files and directories using JGit
- Test cases
- List root directory contents
- Navigate into subdirectories
- Fetch raw file content
- Missing file / missing path
- Invalid branch
- Infrastructure
- Temp directory cleanup
- Isolate test repositories per test
Notes:
- Tests target Git logic, not HTTP wiring
- Use lightweight JUnit + JGit, no Spring context where avoidable
Estimate: 3.0h
3. REST API Wiring & Validation (1.0 hour)
Objective: Ensure controller behavior is predictable and stable.
- Validate request parameters (
path,branch) - Confirm default-branch fallback logic
- Ensure correct HTTP status codes:
- 200 OK
- 404 Not Found
- 400 Bad Request (where applicable)
- Add minimal controller-level tests if needed
Estimate: 1.0h
4. Frontend: Minimal Repo Browser UI (1.5 hours)
Objective: Provide a clean, usable repo browser without UI excess.
- Add “Repository” tab / button in Project view
- Directory listing view
- Files vs directories
- Click to navigate
- File viewer
- Monospace text
- Scrollable container
- Basic error display
Estimate: 1.5h
5. Integration, Manual Testing & Polish (0.5 hours)
Objective: Validate end-to-end flow and remove rough edges.
- Manual testing on a real project repo
- Verify branch defaults
- Check large file and error behavior
- Minor UI polish (spacing, labels)
Estimate: 0.5h
Summary
Area Time Backend hardening 2.0h JGit unit tests 3.0h REST validation 1.0h Frontend minimal UI 1.5h Integration & polish 0.5h Total 8h
Rationale for 8h Estimate
- Core JGit logic already exists
- Risk profile is low
- Unit tests are the main remaining “real work”
- UI is intentionally minimal
This estimate reflects implementation, not exploration.
-
rksuma@Ramakrishnans-MacBook-Pro sztab % git checkout wolnosc Switched to branch 'wolnosc' Your branch is up to date with 'origin/wolnosc'. rksuma@Ramakrishnans-MacBook-Pro sztab % git pull --rebase Already up to date. rksuma@Ramakrishnans-MacBook-Pro sztab % git checkout -b feature/repo-browser-jgit Switched to a new branch 'feature/repo-browser-jgit' rksuma@Ramakrishnans-MacBook-Pro sztab % -
Pull request: https://tigase.dev/sztab/~pulls/11
| Type |
New Feature
|
| Priority |
Normal
|
| Assignee | |
| Version |
none
|
| Sprints |
n/a
|
| Customer |
n/a
|
Issue Votes (0)
Description: Expose a simple Git file browser for each project, allowing the user to:
This will:
Acceptance Criteria: