modular-development-model
What is it
Create a separate Rails project for reasonably complicated pieces of functionality.
Use a simple script to copy it into the main repo (this could also be soft-links).
When to use
- only makes sense for more complicated features
- how separable is the logic?
Advantages
- ensures a clean interface and separation (part of reason why tests run quickly is the lack of prerequisites)
- limits the code under consideration
- everything is much faster (tests, finding stuff)
- some things are possible that aren't really in Instacart (mutation testing)
- separately sharable, easier sub-project for others to grok
- can eventually cut cord and just have it be code in Instacart
Data model flexibility
- especially early on when it has not been integrated with Instacart yet, you can simply update migrations in-place
- with minor editor tweaks, you can cause a migration reset right from the editor
Speed
Specs as documentation
- needs to be even easier than running rspec docs
Integration
- blacklist files which shouldn't be integrated
- automate the integration with simple scripts
Revisiting
- gives you a nice place to return to when bugs crop up. Quick to get context back.
Even after integration
- keep a concept of the module within Instacart's codebase using symlinks
Downsides
- not great at round-tripping... if someone else changes the code associated with the feature, you have to be able to pull it back into the separate project
Referring Pages