dependabot / dependabot-core

🤖 Dependabot's core logic for creating update PRs.
https://docs.github.com/en/code-security/dependabot
MIT License
4.63k stars 993 forks source link

Support generic interface for new source control providers #6308

Open jjmanton opened 1 year ago

jjmanton commented 1 year ago

Is there an existing issue for this?

Feature description

I have a need currently to integrate Dependabot with an on-premise bitbucket server. I was able to get this working by modifying the code, but I feel there is an opportunity here to allow for a pluggable model.

I found this comment for context - https://github.com/dependabot/dependabot-core/pull/1450#issuecomment-821039074

The above seems to indicate support for a generic interface. I would be happy to help build and maintain the Bitbucket Server gem, however I would require some assistance on the dependabot side to ensure it can be consumed and conforms to an interface that works for current and future needs.

With some initial investigation, it seems the gem would need to implement roughly three files -

After making the changes, we could envision having Bitbucket Cloud, Bitbucket Server, GitLab SaaS, Azure DevOps, and CodeCommit all converted to gems to be supported by the community.

jeffwidman commented 1 year ago

👋 Personally, I have long wanted to do exactly what you suggest of having a more generic interface for clients, and then move the implementation-specific code outside of dependabot-core.

Basically tighten up the abstractions and also make it easier for community to maintain. We've had some internal discussions about different ways to do this (there's several paths forward), but mostly it's just been bottlenecked by not being high enough priority. Hopefully something we can tackle down the road here.

One follow-up question--Bitbucket Cloud vs Bitbucket Server... I'm surprised you can't just use the BitBucket cloud client, but pointed at a custom URL for your Bitbucket server instance... are there differences beyond a custom domain name that necessitate a full-blown separate client?

jjmanton commented 1 year ago

@jeffwidman That's great to hear! If you have any notes that you can share, I'd be happy to start hacking on it a bit. I am not necessarily a Ruby developer, but can probably pick it up. If you have any preference on the overall structure or how the gem might plugin (and where) I can start putting some things together.

On the Bitbucket side, unfortunately the APIs are JUST different enough to warrant separate code. It's quite frustrating!