This blog is dedicated to describe the work we have done and the goals we have accomplished in Improve the development experience project as a part of GSoC'23 at CircuitVerse
CircuitVerse is a Digital Logic Simulator on web. It is an educational tool for students interested in electronics to simulate and make circuits on their browser.
This project focuses on making the process of working and developing with CircuitVerse easier and more efficient. The main goal is to simplify setting up the development environment and working with the code. Additionally, Our aim to enhance the test cases and improve the continuous integration (CI) workflow, which will ultimately reduce the time required for code review by maintainers.
Throughout this period, we have focused on improving the development experience of CircuitVerse. The main goals of this project are:
This integration enhances the debugging experience for developers by providing a visual debugging capability directly from their integrated development environment (IDE). It allows anyone to conveniently set breakpoints and debug the application from their IDE. This integration also support docker based environment. By changing configuration in IDE , it can easily connect to TCP based debugger and debug the application easily. The documentation has been updated accordingly.
Debugger Preview
Solargraph is a Language Server Protocol (LSP) server that enhances autocompletion for Ruby codebases by providing YARD documentation. To further enhance support for Rails codebases, the solargraph-rails gem has been installed and configured. YARD documentation has been generated for the entire codebase to ensure seamless autocompletion.
This integration also supports Docker-based environment, allowing the application to be run in a Docker container while connecting the IDE/Editor’s solargraph extension to the Solargraph server via a TCP socket. Initially, there was a significant challenge in this setup. The extension was used to send the current directory to the LSP server, but the LSP server had a different path inside the Docker container. However, this issue was successfully resolved by creating a symlink inside the container.
For more detailed information, please refer to the blog post available at https://tanmoy.online/week-1-2-circuitversegsoc23
Currently, documentation and support has been added for
Visual Studio Code
Sublime Editor
Neovim
Previously in the project, all javascript compiled in a single one via esbuild and served by sprocket asset pipeline in development and production [mostly same]. As a result, during development on each change, esbuild need to build multiple JS files againg which increase friction during development.
That’s why vite rails is integrated, and simulator assets moved to vite. After this integration, if there are many changes in the javascript, only the specific portion will be updated in the website and hot reload will be performed (if possible), otherwise entire page will reload. Also, instead of packing and serving javascript files, it will load all dependency of javascript files asynchronously in browser.
In production, vite can pack all the javascript files together and serve static javascript files to make it faster.
Vite Rails Hot Reload
RBS [Ruby static typing] enabled static typing mechanism which enables to maintain consistency in codebase and reduce the bugs in code.
We used rbs
gem for rbs annotation files. We used steep
gem to verify type signatures.
We have also included steep check
in our CI to verify the changes in code or rbs annotation before finalizing any PR.
RBS has beend added for
models
only. We will add RBS for other files in the future.
Undercover is a tool that analyzes the report generated by simplecov and generates a code coverage report based on it. The primary objective of this integration is to examine pull requests created by contributors and identify any new functions without code coverage.
To facilitate this process, we have incorporated the undercover_easy gem along with the reviewdog GitHub Actions bot. This enables us to provide feedback on any issues directly within the pull request by posting comments.
The codebase currently has a code coverage of approximately 86%. However, some recently added functions were lacking unit test coverage. As part of this task, We have addressed this gap by writing unit tests specifically for those functions.
To optimize the integration testing process in CircuitVerse, Capybara has been utilized for comprehensive automated testing. During the analysis, it was identified that certain workflows, including Profile management, Group management, Assignment management, and Project management, lacked integration testing. As part of this task, integration tests for these missing workflows have been incorporated to ensure their proper functioning and improve the overall quality of the application.
Gitpod is a cloud-based development environment that allows you to create a fully functional development environment in your browser. After various changes in development environment, it was required to update gitpod configuration. After update, it now supports solargraph LSP and debugger.
Preview
GitHub Codespaces is a similiar platform like Gitpod but more integrated with GitHub. We have added support for GitHub Codespaces in our project, so that anyone can set up the project in GitHub Codespaces in single click and start contributing to the project. It supports all the features like solargraph LSP, debugger, etc. and comes with pre-installed extensions in web based VS Code.
Preview
The docker based development setup has been improved to make it more efficient and easy to use. The following changes have been made to the setup:
The setup documentation has been updated to reflect the changes made to the development environment. The following changes have been made to the documentation:
I’ve had a wonderful time working with CircuitVerse. Through this experience, I’ve learned about various tools and concepts, giving me a fresh outlook on open source projects. I’ve gained knowledge in areas such as Solargraph LSP, Debugger, Vite, Rollup, GitHub Actions CI, Remote Development Platform, and Docker-based development setup. This newfound knowledge will definitely benefit me in the future. The mentors and organization admin were incredibly supportive and helpful, and I’m truly grateful for their guidance and assistance.
The 12-week duration of this project was productive, allowing us to achieve nearly all our goals. I want to express my gratitude to my mentors, Vedant Jain and Smriti Garg, as well as the organization admin, Aboobacker, for their support and guidance.
I would definitely keep working on CircuitVerse post GSoC & helping new contributors to contribute to this project.
Thanks for reading this blog.