Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Create a third-party folder for company specific code/implementations #17707

Open
corbantek opened this issue Feb 5, 2025 · 0 comments
Assignees
Labels
Component: General Changes throughout the code base Type: Feature

Comments

@corbantek
Copy link
Contributor

corbantek commented Feb 5, 2025

Feature Description

Due to the nature of how golang has to build in a monolith (at least for each cobra exec) we need a way to allow third-party features, implementations, and add-ons to be run with Vitess.

This idea was discussed last fall here.

For the implementation of using third-party code, I want to specifically NOT use native go "plugins", go-plugin, or pluginprc which all rely on some form of RPC communication with the parent process. I think for keeping performance at a maximum, we would not like to add the extra layer of communication to the runtime.

The general idea is:

  • Create folder in go called "thirdparty"
  • Inside this folder is a go file called thirdparty.go that has a public initialize function that is empty for base vitess (no-op when called)
  • This folder by default is gitignored
  • Third parties would copy their implementations/features into this thirdparty folder for their respective build systems
  • Any required initializations would be added to the public initialize function in thirdparty.go (this is maintained by the thirdparty, not upstreamed to vitess)
  • Vitess base would/could add calls this public initialize function from an init() inside the respective cobra impls (IE vtgate, vt, ...)

This feature has a base implementation in Add the concept of thirdparty impls to Vitess

Use Case(s)

HubSpot has traditionally forked Vitess for each release and then applied a large amount cherry-picks and code changes to augments Vitess for HubSpot usage and infrastructure.

This task is not lightweight and requires weeks of cherry-picking, merging, and testing on top of keeping track of what are Vitess changes vs HubSpot changes. This makes upgrades extremely difficult and upstreaming fixes harder because we cannot test on different branches (only the current branch we have deployed).

We'd like to let our code move between releases without having to cherry-pick hundreds of commits each time. Having all our code in a separate repo that is copied into the thirdparty would have several advantages

  • Know exactly what is HubSpot vs Vitess changes
  • Ability to switch between current releases and main
  • Continuous integration and testing on interested branches and main
  • Ability to provide and test upstream fixes on both current branch and main branch

PRs

Add the concept of thirdparty impls to Vitess

@corbantek corbantek added the Needs Triage This issue needs to be correctly labelled and triaged label Feb 5, 2025
@corbantek corbantek changed the title Feature Request: Create a thirdparty folder for company specific code/implentations Feature Request: Create a third-party folder for company specific code/implementations Feb 5, 2025
@mattlord mattlord added Type: Feature Component: General Changes throughout the code base and removed Needs Triage This issue needs to be correctly labelled and triaged labels Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: General Changes throughout the code base Type: Feature
Projects
None yet
Development

No branches or pull requests

2 participants