Skip to content

Commit 134537e

Browse files
authored
GSoC 25 Week 06 Update by Nikhil (#307)
* GSoC 25 Week 06 Update by Nikhil * GSoC 25 Week 6 Update by Nikhil Bhatt * add: flow diagram of project flow
1 parent 607fcc7 commit 134537e

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed
159 KB
Loading
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
title: "GSoC '25 Week 06 Update by Nikhil Bhatt"
3+
excerpt: "Implemented commit history viewer and version loading system using Git CLI and new backend routes, enabling seamless time-travel across project states."
4+
category: "DEVELOPER NEWS"
5+
date: "2025-07-13"
6+
slug: "2025-07-13-gsoc-25-nikhilbhatt-week06"
7+
author: "@/constants/MarkdownFiles/authors/nikhil-bhatt.md"
8+
tags: "gsoc25,sugarlabs,week06,nikhilbhatt,midterm"
9+
image: "assets/Images/GSOC.png"
10+
---
11+
12+
<!-- markdownlint-disable -->
13+
14+
# Week 06 Progress Report by Nikhil Bhatt
15+
16+
**Project:** [Git backend for MusicBlocks](https://github.com/benikk/musicblocks-backend)
17+
**Mentors:** [Walter Bender](https://github.com/walterbender), [Sumit Srivastava](https://github.com/sum2it)
18+
**Reporting Period:** 2025-07-07 – 2025-07-13
19+
20+
---
21+
22+
## Progress Summary
23+
24+
The first 6 weeks of GSoC'25 have been a great learning experience. The project is progressing as planned with meaningful improvements every week. <br/>
25+
Our primary focus during this phase was the backend, with some attention to enhancing the user experience.
26+
- Repository Creation with Ownership Tracking (using a Github app) - ```Github apps``` are safer, and scalable way of dealing with github directly, students can now create repositories directly into a centralised account, with ownership using a key, note that we do not save any user related information.
27+
- Secure Editing Mechanism - even after publishing a project, students are able to edit their projects. Only those having a valid key can now edit their projects, in absence of that key, the project becomes ```read only```.
28+
- Forking with Metadata & History - Projects can be forked easily via the UI. Forked repositories retain original content and metadata,A later upgrade replaced basic copying with full Git CLI–based cloning, ensuring complete ```commit history is preserved```.
29+
- Commit History & Version Time Travel - Users can now select a commit from a UI modal and load the project state at that point. This feature introduces ```reflective-learning``` in students.
30+
- Pull Request Workflow - an interesting addition to our existing planet based system, students can now contribute back to original projects after forking. The backend logic for this is complete and tested. Frontend integration is currently underway and will allow students to ```submit PRs with minimal effort.```
31+
32+
## A flow chart about the architecture of the project
33+
![Flow chart](assets/Developers/Nikhil/project-flow.png)
34+
35+
36+
## This Week's Achievements
37+
38+
### Backend: Commit History & Version Retrieval
39+
40+
To support loading older versions of projects, I implemented two key backend routes using the Git CLI:
41+
42+
- `GET /api/github/commitHistory/?repoName`
43+
→ Returns a list of all commit SHAs and messages for a given repository.
44+
45+
- `GET /api/github/getProjectDataAtCommit?repoName=""&sha=""`
46+
→ Accepts a repo name and commit SHA, checks out the commit, and returns the `projectData.json` at that point in history.
47+
48+
Both routes use secure Git Rest API methods.
49+
50+
---
51+
52+
### 💡 Frontend: Modal Interface for Commit Viewer
53+
54+
- Added a modal component that displays when the user clicks **"Show Commits"** from the GitHub dropdown.
55+
- Each commit is rendered as a card showing the commit message, SHA, and a **"Load this version"** button.
56+
- On click, the selected commit is sent to the backend, and the returned `projectData` is loaded using:
57+
58+
---
59+
60+
## Challenges & How I Solved Them
61+
62+
- **Challenge:** GitHub API only returns the latest file in current branch
63+
**Solution:** Used GET /repos/:owner/:repo/contents/:path?ref=sha to fetch files at a specific commit.
64+
65+
- **Challenge:** Loading project data for specific commits
66+
**Solution:** Created an end point which takes the commit `sha` and returns the project data for that commit
67+
68+
---
69+
70+
## Key Learnings
71+
- How to use GitHub's REST API to interact with historical commit data.
72+
- How to extract blob data (projectData) from specific commits using SHA.
73+
- Importance of UX when introducing power-user features like history viewing.
74+
75+
---
76+
77+
## Next Week's Roadmap
78+
- Begin work on pull request functionality from forked projects.
79+
- Enable students to raise PRs with metadata describing their changes.
80+
- Explore preview diffs before PR submission.
81+
82+
---
83+
84+
## Resources & References
85+
86+
- [MusicBlocks Frontend Repo](https://github.com/sugarlabs/musicblocks)
87+
- [musicblocks-backend](https://github.com/benikk/musicblocks-backend)
88+
- [Octokit REST.js Library](https://github.com/octokit/rest.js)
89+
90+
---
91+
92+
## Acknowledgments
93+
94+
Thanks again to my mentors and the Sugar Labs community for feedback and support!
95+
Looking forward to next week’s frontend PR features.
96+

0 commit comments

Comments
 (0)