-
Notifications
You must be signed in to change notification settings - Fork 120
GSoC 25 Week 06 Update by Nikhil #307
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 96 additions & 0 deletions
96
src/constants/MarkdownFiles/posts/2025-07-13-gsoc-25-Nikhil-Bhatt-week06.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| --- | ||
| title: "GSoC '25 Week 06 Update by Nikhil Bhatt" | ||
| excerpt: "Implemented commit history viewer and version loading system using Git CLI and new backend routes, enabling seamless time-travel across project states." | ||
| category: "DEVELOPER NEWS" | ||
| date: "2025-07-13" | ||
| slug: "2025-07-13-gsoc-25-nikhilbhatt-week06" | ||
| author: "@/constants/MarkdownFiles/authors/nikhil-bhatt.md" | ||
| tags: "gsoc25,sugarlabs,week06,nikhilbhatt,midterm" | ||
| image: "assets/Images/GSOC.png" | ||
| --- | ||
|
|
||
| <!-- markdownlint-disable --> | ||
|
|
||
| # Week 06 Progress Report by Nikhil Bhatt | ||
|
|
||
| **Project:** [Git backend for MusicBlocks](https://github.com/benikk/musicblocks-backend) | ||
| **Mentors:** [Walter Bender](https://github.com/walterbender), [Sumit Srivastava](https://github.com/sum2it) | ||
| **Reporting Period:** 2025-07-07 – 2025-07-13 | ||
|
|
||
| --- | ||
|
|
||
| ## Progress Summary | ||
|
|
||
| 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/> | ||
| Our primary focus during this phase was the backend, with some attention to enhancing the user experience. | ||
| - 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. | ||
| - 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```. | ||
| - 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```. | ||
| - 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. | ||
| - 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.``` | ||
|
|
||
| ## A flow chart about the architecture of the project | ||
|  | ||
|
|
||
|
|
||
| ## This Week's Achievements | ||
|
|
||
| ### Backend: Commit History & Version Retrieval | ||
|
|
||
| To support loading older versions of projects, I implemented two key backend routes using the Git CLI: | ||
|
|
||
| - `GET /api/github/commitHistory/?repoName` | ||
| → Returns a list of all commit SHAs and messages for a given repository. | ||
|
|
||
| - `GET /api/github/getProjectDataAtCommit?repoName=""&sha=""` | ||
| → Accepts a repo name and commit SHA, checks out the commit, and returns the `projectData.json` at that point in history. | ||
|
|
||
| Both routes use secure Git Rest API methods. | ||
|
|
||
| --- | ||
|
|
||
| ### 💡 Frontend: Modal Interface for Commit Viewer | ||
|
|
||
| - Added a modal component that displays when the user clicks **"Show Commits"** from the GitHub dropdown. | ||
| - Each commit is rendered as a card showing the commit message, SHA, and a **"Load this version"** button. | ||
| - On click, the selected commit is sent to the backend, and the returned `projectData` is loaded using: | ||
|
|
||
| --- | ||
|
|
||
| ## Challenges & How I Solved Them | ||
|
|
||
| - **Challenge:** GitHub API only returns the latest file in current branch | ||
| **Solution:** Used GET /repos/:owner/:repo/contents/:path?ref=sha to fetch files at a specific commit. | ||
|
|
||
| - **Challenge:** Loading project data for specific commits | ||
| **Solution:** Created an end point which takes the commit `sha` and returns the project data for that commit | ||
|
|
||
| --- | ||
|
|
||
| ## Key Learnings | ||
| - How to use GitHub's REST API to interact with historical commit data. | ||
| - How to extract blob data (projectData) from specific commits using SHA. | ||
| - Importance of UX when introducing power-user features like history viewing. | ||
|
|
||
| --- | ||
|
|
||
| ## Next Week's Roadmap | ||
| - Begin work on pull request functionality from forked projects. | ||
| - Enable students to raise PRs with metadata describing their changes. | ||
| - Explore preview diffs before PR submission. | ||
|
|
||
| --- | ||
|
|
||
| ## Resources & References | ||
|
|
||
| - [MusicBlocks Frontend Repo](https://github.com/sugarlabs/musicblocks) | ||
| - [musicblocks-backend](https://github.com/benikk/musicblocks-backend) | ||
| - [Octokit REST.js Library](https://github.com/octokit/rest.js) | ||
|
|
||
| --- | ||
|
|
||
| ## Acknowledgments | ||
|
|
||
| Thanks again to my mentors and the Sugar Labs community for feedback and support! | ||
| Looking forward to next week’s frontend PR features. | ||
|
|
||
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.
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.
Would you mind to make an infographic of how this works, so that someone can imagine the flow of this (somewhat unusual) design?
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.
Sure, I will add a flow diagram