How to Submit Patches to the Open Source Community
There are likely millions of open source projects to choose from, but the process of submitting patches is fairly similar across the projects. We'll look at two in this article:
OpenSUSE is a linux based operating system. It’s main focuses are:
To install the command, use
It will ask for a username and password, create those and then you’re all set to start using osc. So you can use commands like
Add, commit, branch, checkout just like you would with Git!
In comparison to the OpenSUSE bugs, this bug:
- openSUSE
- Android
OpenSUSE
License : LGPL-2.1OpenSUSE is a linux based operating system. It’s main focuses are:
- Providing developers with reusable open source components and tools
- Being a feature-rich server
- Having a well designed user interface
How to work with openSUSE’s existing Code Base
They accept code patches by following these steps:- Pull the current code from OpenSUSE
- Work on the branch locally
- Build it locally
- Commit the changes
- Make sure it builds again
- Check to see if the differences between your branch and the original were what you intended and talk to other developers working on the code for advice
- Debug your code using three files left over by your osc build: .build.log, .build.command, .build.packages
- Submit changes to be merged
Getting OSC
Most of these steps involve using a command osc. OSC is openSUSE’s Version Control System (like git).To install the command, use
It will ask for a username and password, create those and then you’re all set to start using osc. So you can use commands like
Add, commit, branch, checkout just like you would with Git!
For the exact osc commands and command flow:
Build Service CollaborationHow are Patches Submitted
Bugzilla: Mozilla’s bug tracker where the OpenSUSE community reports bugs. Each bug follows a lifecycle:- Bug is reported and given an id
- The bug is given a status: (This step happens throughout the lifecycle)
- Open Bugs:
- Unconfirmed
- New
- Assigned
- Reopened
- Closed Bugs:
- Verified
- Resolved
- Open Bugs:
- A Patch is submitted for the bug
- The Patch code has been reviewed and tested by authorized developers
Two Example Bugs and Patches
The two bugs evaluated had the following similarities in the way they accepted the code patches. Both:- Had a 3 week resolution time
- 2-3 Reviewers and Developers, and or Committers involved
- Commenters on the Double.MaxValue Bug simply stated the issue, submitted the code for the patch, and the patch was accepted. On the Konqueror Bug, they were much more active. Commenters:
- Stated output given a particular test input value
- Suggested a valgrind be done (a debugging and profiling tool)
- Determined that the bug doesn’t have to do with openSUSE but K Desktop Environment itself, bug was then pushed there
- On the KDE’s bug reporting system - bugs.kde.org - a resolving comment says, “null pointer check fixes gmail crash”
Android
License : Apache Software License, Version 2.0How to work with Android’s existing Code Base
Instead of using OSC, Android uses:- Git, another popular version control system.
- Repo, a tool that sits between you and Git, automating commands more specifically tailored to the needs of Android Open Source.
- Use Git:
- When possible, make your components replaceable and usable in applications other than Android
- Use Repo:
- A repository management tool that we built on top of Git
- It uploads automatically to Git
- Some Git and Repo commands you can use:
- >> repo start to start a new branch
- >> repo status . to verify your branch was created by getting the status
- >> repo sync
- If it’s the first time: does a git clone (sync files with all existing projects inside Android)
- If sync has been done before: Does
- git remote update
- Does git rebase origin/[BRANCH]
- >> repo diff Does a git diff (Shows difference in code between the commit and working tree)
- >> git add
- >> git commit
- >> repo upload Do this instead of Git push, Repo will update Git for you
- Use Gerrit:
- Is an Online code reviewing system
- Works with Git
- Allows inline commenting
- Allows user to submit code once they're authorized
- Code that passes the review will be auto merged
- Android Studio: Android IDE
Roles in the Android Community
Contributor
Those who contribute to the Android Open source code, whether a Google employee or an developer outside of Google. Both follow the same submission process.Developer
Engineers who:- develop the Android application and
- use the platform (like customers do, and unlike contributors)
Verifier
Those who:- test change requests
- Are appointed by Project Leads once they’ve submitted enough high quality code
Approver
Those who:- Accept code into the project
- Are appointed by Project Leads
Project Leads
Android is made up of a bunch of sub-project. Each sub-project has a Project Lead who:- Leads the project roadmap, versioning & release cycles, and ensuring QA is done in time
- Is the public face for the sub-project
An Example Bug and Patch
Let’s examine the following bug: Bluetooth: configure VTS to run HAL gtest.In comparison to the OpenSUSE bugs, this bug:
- Had 6 commenters, reviewers and developers (1 / 6 was a bot - a reviewer)
- The whole review took only 1 week
- There were a lot of suggestions given for improvement and results of testing. As for the general flow of the conversation, users were:
- Asking if the project has the needed tools included for the auto-tests.
- Asking for mostly 1 line code changes
- Labelling each set of changes as a new patch set
- Reading results of the tests that the treehugger bot ran
- Leaving friendly pings for reviewers to come in and continue the process
- Reviewing the code 2 more times
Comments
Post a Comment