3 minutes
Opensource Citizenship: Sending fixes to a mature project: Ansible Netbox Upstream Dance
Even the title is a mouthful, but that might be how you need to write your commit messages depending on the project.
So this is a blog post I started in April… Now it’s nearly the end of September. I’ll keep it short and sweet just so I can close this out.
Contributing to mature open source projects isn’t a fast process. It requires diligence and patience on your part, and you may be surprised how much work is involved beyond the simple bug fix you actually implemented.
The important thing to remember is that what can feel like turnstiles, complexity, and unnecessary prerequisites are really there to protect the sanity of the under-compensated developers of the project. In the case of the contribution that inspired this post, it teaches you a lot about what good looks like for testing, changelogs, and managing releases.
At this point–about 18 months ago, I ran into a bug with the Ansible Netbox inventory plugin. I run my netbox server under subpath rather than at the root path. This IS a supported configuration with netbox itself, its just less supported. (even now the swagger UI for the netbox API generates the wrong urls). After an update, how the inventory plugin derived the api paths from OpenAPI broke my ability to use it. Borrowing from inspiration in one of the other modules in the collection, I was able to implement a simple fix in an evening and resume doing ansible+netbox things.
As mentioned the fix wasn’t too bad and my buddy encouraged me to upstream it. I remember seeing that open a PR was a bit involved, so I procrastinated–for about a year. Honestly I expected someone else would have probably resolved the issue already, but that wasn’t the case. I conceded, and put on my good open source citizen hat.
This was the part of the blog that was supposed to highlight in detail my colorful weekend-long journey to get my PR in the correct place, but I don’t remember it quite as well now. I’m just gonna make a simple list that might paint the picture:
- Find correct issue references
- Set up local netbox and local test environment
- Get test tools to pass in local test environment
- Hunt down issue references
- Figure out correct way to create a changelog fragment and commit
- Bang on my PR until the required tests in the pipeline passed
Each of those pieces proved to be a bit time consuming for me, but I got through it all bit by bit.
I’m happy to say my PR to the ansible-netbox inventory plugin was accepted and merged. As of this writing, there hasn’t been a new release, so you’ll have to install from the master branch.
I’m looking forward to seeing my fix listed in the next release changelog. It was a bit of a slow process, but that’s one of many things that makes open source successful. It’s great all the tooling is in place for thorough testing so we can confidently know my change doesn’t break things for others.