User:Novem Linguae/Essays/Gadget learning curve
Appearance
Interested in writing patches for or becoming more involved with enwiki gadgets? Here's some of my observations about the process.
Difficulty levels
[edit]- Bug fixing is easy. Reproduce it, add your
debugger
statement, then step debug until you figure out what's going on. Then submit a one-line or couple line patch. - Small features are medium. You might have to write your own API call, or figure out some of that gadget's utility functions.
- Big features are hard. You'll definitely have to master that gadget's utility functions and way of doing things.
Skills and permissions needed
[edit]Writing patches
[edit]- coding
- Front-end languages
- jQuery
- MediaWiki Action API & Special:ApiSandbox
- MediaWiki utility functions - mw.config.get, mw.util, mw.Title, etc.
- that gadget's custom utility functions and way of doing things (e.g. Twinkle's Morebits)
- other
Becoming a maintainer
[edit]- merging pull requests
- collaborator access to GitHub
- making sure controversial patches have consensus by double checking on talk page
- deploying
- bug wrangling (making sure everything gets into the issue tracker)
- translating talk page requests into GitHub Issue tickets
- tagging frequently requested tickets with "frequently requested"
- tagging easy tickets with "easy"
Things to watch out for
[edit]- Old gadgets are often written in JavaScript version ES5, which is the version from 2009–2014. This style has zero classes, tons of old jQuery (things like $.Deferred, $.each), and tons of promises. MediaWiki only recently started allowing gadgets written in ES6, and the years of disallowing ES6 have contributed a lot to technical debt.
- Gadgets usually have few or no automated tests, making refactoring dangerous.
- Program code is just fragile in general. Even with manual testing, touching anything is likely to create bugs.
- No maintainer means you may work on a repo and not get code reviews and patches merged for weeks, months, years, or ever. You may have to become a maintainer and self-merge your patches.
One strategy
[edit]One strategy that's working for me (when I have the free time) is I'll pick a repo, then spend about 2–3 weeks working on it. I'll knock out these 3 things, then move on to the next repo:
- writing patches for all tickets with the "easy" tag
- writing patches for all tickets with the "frequently requested" tag
- clearing the pull request queue by providing reviews for other people's patches (usually just making the changes for them then merging, because it'd be ridiculous to expect someone to come back and modify their patch after waiting for months or years)
Conclusion
[edit]That's a lot of different skills to master. It's no wonder there aren't more volunteer devs. And it's no wonder that even popular gadgets often become unmaintained. It took me years to cross off all the items on this list.