Hi,<p>My company are using an open source software project heavily. We’re a large org and we’ve had to hack the code base to fix up bugs, extend functionality and add new features.<p>Our internal fork breaks down into three categories:<p>1. The base software.<p>2. Generic improvements to the software that could be used by other people.<p>3. Specific extensions to the software that are only value to our own organisation (e.g integration with our legacy systems, our change management systems)<p>I’m encouraging our team to contribute the generic improvements (item 2) back to the upstream to minimise any maintenance overhead, and this is working well.<p>However for Item 3, I’m finding it particularly difficult to confidently pull in upstream changes where we have heavily modified the original implementation. Ideally I’d like to be able to pull in upstream changes quickly, easily and safely.<p>Does anyone have any suggestions, references or patterns to consider for this type of software project?<p>The software is primarily Python, with some Java for good measure.
I'm not sure that any of these ideas will be news to you, but a few suggestions:<p>- Add test coverage for your customizations, so that after you pull upstream changes, you can confirm that your software still works (or at least runs)<p>- Relocate and/or rewrite the custom code within your repository so that you are less likely to encounter merge conflicts when retrieving upstream changes<p>- If possible, fetch upstream changes on a regular basis so that you detect upcoming conflicts early<p>- If possible, petition the upstream project to add support for plugin modules, so that you could develop your own customizations in isolation (albeit still with some API-level dependencies on upstream)<p>Are your customizations definitely specific to your own company? (a gold standard could be to publish your own software as FOSS and attempt to build a supportive community)
Keeping private fork requires non-trivial design skills. In the ideal case, you'd add hooks as part of public improvements (item 2), and use only those hooks in your private changes. If you add appropriate tests to public project, this will increase the chances of your hooks staying unbroken.