Name: Kaustubh Nair
Affiliation: International Institute of Information Technology, Bangalore
Location: Bangalore, India
In this project, my primary intention is to upgrade Mapknitter to Rails 6. Other small features are increasing test coverage and improving CI.
The following features should have been implemented at the end of GSoC
- Codeclimate set up
- Dangerbot set up
- Increased test coverage
- Redundant code removed
- Upgrade to latest stable version of Rails ( most likely 6) for MapKnitter
- Upgrade to latest Ruby version supported by Rails 6 for Mapknitter
- System tests configured for Travis and Dangerbot
We are expecting a few features to be implemented before the GSoC period starts. So in case I end up ahead of schedule, I shall perform the same upgrades on
- Test Coverage - Tests are important since they will show specific errors and guide us to what is exactly wrong and where the code is failing. If we don't have tests covering a breaking change, it will take more time to track and understand the change, thus wasting time. (Relevant issue: #304) Currently, we have some basic unit and functional tests.
The test coverage for
mapknitteris currently at around 60%. I would aim to reach around 80% coverage before starting the upgrade.
- CI improvements - I shall set up Codeclimate which is really useful for code review and integrate it with travis. I will follow the Codeclimate documentation for this. I will also fix Dangerbot for code and PR review.(Relevent PR: https://github.com/publiclab/mapknitter/pull/306). I shall follow the documentation for this as well.
- Code Cleanup - After we have considerable test coverage, I shall proceed to clean up and remove redundant sections in the code. A list of features will be found on this Github issue
- Rails upgrade workflow - The idea is to roll out upgrades in as small pull requests as possible. We should upgrade rails to the closest target version each time for minimum conflicts and errors.
The path that I will follow is,
- Rails 3.2 => Rails 4.2
- Rails 4.2 => Rails 5.0
- Rails 5.0 => Rails 5.1
- Rails 5.1 => Rails 5.2
- Ruby 2.4.4 => Ruby 2.5.0
- Rails 5.2 => Rails 6.0
We should be going to Rails 4.0 and 4.1 before jumping directly to 4.2. But while trying to upgrade
mapknitter to Rails 4, I realized that Ruby 2.4 and Rails 4 are not compatible. (Ref: https://github.com/rails/rails/issues/27670). The closest available version is Rails 4.2.8
- Upgrade Rails: First of all we should upgrade the rails gem to the closest target version.
For this we need to change the rails version in the Gemfile. For example,
gem 'rails', '~>4.2.11'
- Upgrade gems: Next, we should upgrade the gem dependencies to the latest version. Before doing this, we need to first relax versions of all the gems in the Gemfile so that their versions can be updated. Now gems can be upgraded by running,
- Update rails config: Once all the dependencies are installed and compatible with each other, we need to start updating the code. I will start by first fixing the config files. For this, we can use RailsDiff which shows the configuration changes between rails versions.
We can also use the rake update task that is provided by rails for dealing with changes in old files and creation of new files. This is done by running
Fix errors in test: Due to change in rails version, there is a possibility that the tests will encounter syntax and other kinds of errors. This needs to be fixed before running the tests.
Run tests: Tests will be my primary way of finding out breaking points in the code. I will be fixing the code until all the tests pass. Useful reference guides during this process will be the Upgrade Guidesand Release Notes., which are amazingly documented.
Fix deprecation warnings: I will try to fix all deprecation warnings before proceeding to the next upgrade since it will make things easier in the future. We can also configure the test environment to raise an exception during deprecation warnings by add the following line to
config.active_support.deprecation = :raise
This makes it easier to spot and fix deprecation warnings
Finding and fixing bugs not covered by tests: Since our tests suite might not cover everything, It is possible to encounter unexpected bugs. For this we can implement the upgrade to the
unstablebranch for testing before merging it to main. We can take help from the community for testing the upgrade. I will write tests for any such bugs found and then proceed to fix them.
Configuring system tests - It will be really useful for
mapknitterto support system tests. I will be integrating system tests with Travis and Dangerbot once
mapknitteris up to Rails 5. The implementation will be similar to what has been done in plots2
Community Bonding Period (May 6 - May 27): During this time, and prior to this,I will be performing the prerequisites for the Rails upgrade mentioned above.
- Expanding test coverage
- Setting up codeclimate and dangerbot
- Removing redundant code
Phase 1 (May 28 - June 24): Upgrade to Rails 4.2
Phase 2 (June 25 - July 22): Upgrade to Rails 5.2
Phase 3 (July 23 - August 25): Upgrade to Ruby 2.5, Rails 6, Set up system tests
Week 1: Upgrade to Rails 4.2 - Update Gems, Fix tests
Week 2: Upgrade to Rails 4.2 - Fix tests, Fix deprecation warnings and other bugs.
Week 3: Upgrade to Rails 4.2 - Fix tests, Fix deprecation warnings and other bugs.
Week 4: Buffer period ( For fixing bugs if necessary. Else move on to next milestone)
Week 5: Upgrade to Rails 5 - Update Gems, Fix tests
Week 6: Upgrade to Rails 5 - Fix tests, Fix deprecation warnings and other bugs.
Week 7: Buffer period ( For fixing bugs if necessary. Else move on to next milestone)
Week 8: Upgrade to Rails 5.1
Week 9: Upgrade to Rails 5.2
Week 10: Upgrade to Ruby 2.5
Week 11: Upgrade to Rails 6
Week 12: Set up system tests and clean up code
Week 13: Set up System tests
Comments, to show overall community involvement (like helping others):
- Empty pages on search results
- Environment variables not loading on travis for external PRs
- Code cleanup
- Setting up Coveralls
- Prevent multiple builds on Travis
- Increasing test coverage
- Switch to Yarn from Bower
- Fix map of maps
- Add image urls to map json
- Show grid of notes with thumbnails
- Add reactions to images
- Fix regex for node shared
- Fix regex for emojis in square brackets
I have been working on Ruby on Rails for around a year and a half (Check out my github repos!).
Also I have been working as a backend developer with a startup for around 9 months. Currently, most of the medical records in India are handwritten and thus decentralized. We aim to provide a platform that used technology to make healthcare in India easier. i have gathered considerable skill in the Rails, Docker, and Devops while working here.
Contribution Tracker- I made this project for Zense as a kind of scoreboard for tracking contributions. It uses the github api to track commits, prs and issues to the organization.
Twitter Clone- Twitter implemented using Django as part of my semester project with 2 other classmates.
I'm an active part of our college developers' club Zense. Zense tries to promote learning through team projects and sessions. We use software to try and fix problems in our college and society. Here's a link to our github page.
I'm really interested in Public Lab. The thing that amazes me the most about this organization is how welcoming and empowering this community is! I'd love to work with Public Lab and help the Open Source Community grow.
My project is targeted towards the entire publiclab community. Upgrading rails will ensure rolling out new features will be less time consuming and easier. Upgrading rails is a great benefit for everyone!
I understand that it is a serious commitment and I shall be spending around 5-6 hours of work daily for this project.