@adamski suggested we take the discussion about Pull Request policy out of the PACE Purchases JUCE thread and start a new one. So here it is!
I think it would be nice, if when submitting a pull request / feature request either via GitHub or the forum (I understand forum is prefered and GitHub isnât really used since GitHub is just a mirror of the actual private JUCE git repository) the JUCE team could respond with âPerfectâ, âGood idea, but the code needs some workâ, âOk idea, but low priorityâ, or âBad idea, we wonât do thatâ.
We have a fork of JUCE where we have our changes. It would be nice to keep this fork as close to possible the same as the official JUCE if not identical. They what 3rd party JUCE code will work with our JUCE fork, any issues I report Iâll be confident they are actually in JUCE and not something I introduced.
So if you if you have no plans to accept a change, it would be nice to know that so I can plan how to go forward. Either, I can copy / paste the class out of JUCE and make changes and have two similar classes going forward. Or, I can make the change to my JUCE fork and maintain the differences going forward.
Iâd like to share SRâs perspective as folks who reported and suggested many fixes over the years.
Context
Some fixes weâve contributed:
- Countless build problems for various platforms (RTAS, AAX, AUv3, older OS versions, newer OS versions, C++ versions, PowerPC) and Xcode work-arounds (use the more reliable âlegacy build systemâ)
- AAX bug fixes and features like MIDI
- VST3-VST2 and AAX-RTAS compatibility (i.e one format can load sessions saved with the other)
ScopedNoDenormalsAudioProcessor::processBlockBypassed- Gain-reduction output for plugins
- Audio Units support for running in âsand-boxâ (for GarageBand)
- Various DAW-specific fixes and work-arounds
- OpenGL related crashes, deadlocks, bugs, and performance issues
- One crash was very hard to reproduce, and only triggered on Windows laptops which had Nvidia GPUs in addition to integrated Intel GPUs. We ended up buying a machine with the specific specs to finally succeed in nailing that specific bug down
- OpenGL using
CVDisplayLinkon macOS - Lots of SVG fixes and missing features
- Bugs with Drawables and Grid
- Performance improvements
- More things that Iâve missed. Consider the above a partial list
Weâve always done an effort to get all the necessary info for a fix, like bisecting exactly which JUCE change broke things, sharing all the relevant details on how to reproduce etc along with suggested code changes to fix it.
Weâve also coded some more significant efforts which JUCE could had benefitted from:
- Side-chain support for plugins - an extensive effort by @danradix! ROLI did end up adding their own side-chain implementation, which took several iterations until it became stable. IIUC ROLIâs implementation is indeed more complete and allows for multiple side-chain busses, multiple output busses, etc, but we could had also increased the scope of our effort if we had feedback and cooperation for it
- AAX random-access AudioSuites plugin-side by @ttg (not adopted by JUCE currently)
- ARA plugin-side together with Celemony (not adopted by JUCE currently)
How a contribution policy affects us
The faster that JUCE incorporates a fix, the less conflict resolution and testing busywork we have to do when merging the branches. Luckily I learned how to use git-mediate which made conflict resolution more effective but itâs still non-negligible work.
To avoid spurious merge conflicts we were already coding our changes according to the JUCE style and doing our best effort to write code how we speculate that Jules would, so often it doesnât require much more to be worthy for inclusion in JUCE.
Conclusion
Imho it would be really great if JUCE set up any necessary contribution agreements and allow themselves to more effectively get assistance from the community in the form of PRs.
- Everyone would get to enjoy the communityâs fixes faster and less duplication of work will be done.
- We wonât have to do extensive testing when using our own fix and then again later when using JUCEâs variant (sometimes in several iterations because the first fix doesnât always work)
- Less fragmentation will better use the communityâs resources and help in testing and reporting any issues with the changes. We still occasionally received some help and reports on our branch but less than if it was in the main JUCE branch
PR policies inherently mean more administration overhead. But one way of tackling this might be to integrate the CLA into the juce website, and/or as part of the registration process to the forums? Here is Facebookâs CLA for an idea: https://github.com/facebook/.github/blob/master/CONTRIBUTING.md
To me, all of this seems overkill considering the code will be rewritten to be up to snuff, and that there is no public CI to go through the same motions as the JUCE devs do behind closed doors. Without the overall picture drawn for requirements to know what could make it in for a PR, like following the coding style and say hitting all the marks in CI, posting a PR is more or less futile and the situation wonât change compared to what we have today.
I expected opinions like the ones you shared, and this is why I tried to âfortifyâ my comment with the long âcontextâ section.
This is simply incorrect.
There are countless examples but letâs go into a recent one:
- This JUCE commit adds
CVDisplayLinkusage in macOS OpenGL - The is the respective commit in SRâs branch to remove our implementation of this feature before merging in the latest updates to JUCE, which finally after 3 years since its addition to SRâs branch, also has it.
When looking at the two commits youâll notice that itâs exactly the same changes in both. That is - the change incorporated into JUCE are SRâs changes verbatim.
If itâs the exact same code, how could it not be up to snuff at SRâs branch but up to it when in ROLIâs?
I never called you out, please donât take my message personally. Iâm simply reiterating the JUCE devsâ thoughts, and I do agree with them: consistency with the aesthetic is a good cause.
Not everybody gives the same exact care and consideration so you canât look at it through only your lens.
In our experience, thatâs very unusual - even most of the one-liners we get will need tweaking in some way, whether itâs poor naming or just careless spacing. We really only get a handful of people who 100% nail it (and those are generally people like Dave Rowland, Timur, etc)
And sure, itâd be great if we could publish some sort of huge comprehensive document about exactly how to write code that meets our standards, and if everyone who made a PR read it and diligently followed those rules. Brilliant, thatâd save us a lot of effort.
But in reality, the majority of PRs we see, even the one-liners, are wrong in some way.
We could spend a long time on each one giving constructive feedback and code-reviewing, and getting the contributor to gradually re-write all the aspects of it that are wrong, until it meets our standard, and then get them to sign a CLA, and then accept the PR.
But thatâs an absolute pain, and takes too long, and many people arenât even motivated to write code that meets our standard, or wonât understand our feedback. And some people wonât want a public record of their coding being criticised.
So weâve always taken the route of telling everyone âthanks very much, weâll review this and add it in our own wayâ. Weâre really good at tidying code up quickly, this sidesteps any copyright problems, and if the original contributor is interested in learning from our changes, they can diff it and ask us to explain if necessary.
I totally understand where youâre coming from, but there are also plenty of open-source success stories especially in dev-tools, from languages like Python, Rust, D, and Haskell, to frameworks, libraries, and applications. Iâve personally contributed PRs to several open source projects, like the Haskell lens library (1.6k github stars) and code linting tool hlint (1k github stars) (JUCE wins at the github stars count 2k. Not a perfect measure but anyhow I just want to demonstrate that these are not super esoteric projects).
Open-source projects help deal with the problems you mentioned with tooling such as continuous integration running a test-suite, which includes verifying the codeâs style using formatting tools like clang-format and linting tools configured with custom rules for the projectâs style. Ultimately one finds out that employing such tools improves your personal workflows even when not accounting for their value for external PRs.
While JUCE does stand out from these projects in that it is not âcharity basedâ, but rather thereâs a company build around it (similar to QT), I donât think that this should impede JUCEâs openness to contribution in any way apart from the legalese. Btw I recommend requiring folks to agree to the agreements as a pre-condition before you even start spending resources reviewing their PRs. This is what Google does with its open source projects.
I believe that if you set it up correctly youâll find that the contribution of the community will be a time saver and well worth the hassle!
Iâd like to add another positive note here: You would also be helping contributors to become better programmers and better contributors by following such processes. Sure, it would likely be more work (at least in the beginning) than keeping everything within a small team, but IMO would benefit the community and in the long run may lead to gaining some top notch contributors and maintainers.
Yeah, we totally get it, we do understand open-source ![]()
But I think thereâs an element of luck in finding the right bunch of contributors who happen to click together and find a system which works out well. That hasnât really happened for juce (yet).
Weâre not against the idea of having a community of people doing our work for us! If we did see a stream of great PRs pouring in, or if we had an army of reviewers whoâd spend their time reviewing PRs for free, to a standard that satisfies us then that would be a great situation. But engineering that is difficult, and our current system has been working really well for us so far. Maybe in the future things will evolve, who knows.
(And itâs not all happy community fun: I remember speaking to the owner of another well-known open-source, non-commercial project who does rely on user PRs to keep it running, and off-the-record he had a good moan about the group politics that he had to deal with. Sometimes he said he had to accept changes that he knew were crap, and then go back and re-write them sneakily himself to avoid offending the committer.)
âThe perfect is the enemy of the good.â
Your obsession with minor code style is holding JUCE back. You rather ignore good, constructive code or bug-fixes, because somebody dared not using enough or too many spaces, than swallow your pride or use a tool that does the right formatting for you.
We (reFX) contributed a bug fix that was a major show stopper for ANY semi complex product compiled with JUCE on Windows and our bugfix worked perfectly. It was tested and verified by three developers, but for some unknown reason that wasnât good enough and had to be rewritten by your team. At least it was taken seriously enough that it ended up in the development branch in a relatively short time frame. So thanks for that.
There are simple documentation issues, off-by-1 errors etc. that could be fixed by a anyone quite easily, but your policies discourage that completely.
Indeed. Thatâs why I opened Fix some typos in juce_core by McMartin · Pull Request #653 · juce-framework/JUCE · GitHub and Fix some typos by McMartin · Pull Request #654 · juce-framework/JUCE · GitHub, which both got âmergedâ into JUCE by the JUCE team. I never was discouraged.
Coding style consistency is important. Iâm on Julesâ side in this matter.
My obsession with minor (and major) code style is one of the main reasons JUCE has been successful. Consistency is incredibly important for users to navigate and understand the codebase.
Contrast with libraries like ffmpeg which are seething pits of random clashing contributions, where different people re-implement the same thing in different ways and thereâs no overall control of the architecture. Lots of people use ffmpeg because they have to, but not because they enjoy it.
Well, maybe ask, and whoever did it can explain why they changed it.
The JUCE team approach is to look at any change and say âOK, assuming this works, could it be done any better?â If not, then nice job, and weâll probably put it in unchanged.
But if thereâs any way we can improve on a bit of code, then of course we will do so. We never take an attitude of saying âOK, this works, and although we can see ways it could be improved, weâre happy to push this mediocre implementationâ. If we did that, the overall library quality would slowly decay over time.
Canât this be accomplished with a tool like clang-format though? Or are you talking about variable naming, class design, and control flow?
Some aspects of naming (like camelCase, Classes starting with capital letters etc) can also be assisted by tools. Probably also for other aspects that Jules desires like applying a british spell-checker etc
Few key-points (imho):
-
The JUCE team are humans. there have been some times where a commit done by JUCE team broke things, introduced bugs, had inconsistent naming convention, etcâŠ
-
The discussion/thread is about the policy rather than whoâs actually pushing the change to the repo.
What feels that can be improved is the ability to have transparent and organized workflow.
In many cases, PRs on GitHub and forum posts simply decays over time. even one-liners.
To sum it up, It would be nice to have a transparent organized workflow agreed on JUCE with prioritization of topics.
Iâve submitted patches to clang-format to get it to approximate the JUCE style, but even the patched version doesnât get it completely right some (most?) of the time. As an example, I donât think that any formatter currently exists that would pass the âalign = characters in consecutive assignment statements which are semantically similar, but donât if theyâre differentâ test.
Right, and I agree 100% that we should do a better job of replying to each PR and letting the owner know what we think of it, rather than just letting them feel ignored.
Thank you Jules for acknowledging that; that was the crux of my comments from the previous thread (JUCE Announces Acquisition by PACE)
Iâve already noticed some very positive improvement in the responsiveness to issues posted here on the forum, with links to the commits that address the various issues.
It would be great to spread this into GitHub PRâs, with a range from âThanks but we donât feel this appropriateâ to âHereâs the commit we made based on your suggestionâ.
