Adapter Monorepo - RFC #231
-
Currently our hyper adapters are stored in a single repo. With the move to deno in #230, we are considering the advantages of keeping all adapter code in a monorepo and whether or not we should split them out each into their own separate repo. As a proponent of the monorepo approach I hope to provide some reasons for keeping adapters in a single repo. Firstly, a note on monorepos. JS monorepos, up until recently, has been synonymous with Node. Monorepos in Node typically necessitated more tooling due to challenges of managing dependencies via With Deno, all of these issues are moot, because dependency management is inherently different from Node. Because any file can be imported from any relative path or URL, is pulled at runtime, and with no With that out of the way, here are some monorepo benefits for maintainability and DX I propose a structure along the lines of:
ToolingScripts that enforce things like commit linting, code linting and formatting, test coverage, can all be written once, stored beside the code, instead of duplicated across repos. One repo to cloneMaintainer do not have to clone many repos and reference across repos. Contributing to hyper is simply cloning a single repo. Part of adapter development will undoubtedly be using other adapters for reference. This becomes trivial with monorepo. One repo to commitadapters that change together, something as trivial as code styling changes, or even something like an api change, can be done atomically, with a single commit to one repo. One repo to releaseDeno releases works off of git tags and hooks. By ensuring our commit messages are linted, we can use tools to automate semver bumping and tagging commits, per changed adapter, and changelog generation. Tools like |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
I believe regardless of monorepo, we may need to use tools from node ecosystem like |
Beta Was this translation helpful? Give feedback.
-
Pros to keeping adapters separateAdapters should have separate versions driven by git-tags not the same version as the coreBy separating adapters into individual repos, they can have their own semantic version and generate clear guidance to any user of the adapter by the version number major.minor.patch - this version number is specific to the adapter and informs the user of the hyper adapter what their version state is to the version state of the current adapter. hyper has no control of services it wraps adapters around and as they change, there may be multiple Small and less confusing code base will encourage many developers to contributeI think contributors have less anxiety contributing to smaller focused code bases than large confusing code bases, I think many contributors will be part of a service eco-system and will want to build an adapter for hyper to connect with their service versus a hyper contributor that wants wrap a specific service. So targeting contributors with an adapter template and maintaining adapters abstracted from core makes more sense. They simply don't need to understand all the moving parts of hyper to contribute, they just need to understand the mechanics of the adapter and the service it is wrapping. Separation of concerns
Since working with hyper for the last 4 months, many change requests revolve around specific adapter implementations and very rarely around modifications core, app or port. Having adapters in separate focused repo's will make the process to create frictionless lifecycle process around adapters will encourage focus on the quality and reliability of the adapter. The current monorepo complexity has removed that focus on quality of the adapter.
I am more inclined to work and focus on the adapter in an isolated repository that has a separate lifecycle of deployment and release management than that of hyper core. Continuous Delivery
hyper is not a runtime like Adapters in hyper are opinionated and focus on specific service, where hyper core does not care about any service, it just cares about the ports or interfaces. Visibility
Adapters as separate repositories can be much easier to find and connect the dots from searching in a standard library, navigating to the github repo. It is clear to the potential contributor or user of the adapter how to access the source code and it is not buried in a complex repository. Adapter users will be more likely to report bugs as issues on the actual adapter providing better commit history and clear communication to the user when a problem with their use of the adapter is resolved. I think the mono repo could create a lot of noise for users trying to find out if their issue is addressed or not, also will create a lot of work on the core maintainers to parse and batch releases, which goes against continuous delivery practices. Consistency
I think consistency is very important and it could be confusing for users of hyper to see adapters in separate repos and adapters embedded within hyper core. Should we aim to be consistent and either expect contributors to build adapters in core which is a clear source of confusion. or provide a clean guide and template repo for contributors to build adapters in separate repos? That is the real question in my mind, it seems from our recent interview to have an isolated template repo will encourage more contribution than the fear of breaking the mono repo or the uncerntainy around the release of the adapter because of batched releases. SummaryTo me it comes down to two choices, to we focus streamlining the process for adapter contribution and adapter usage so it is |
Beta Was this translation helpful? Give feedback.
-
Final DecisionAll in all, I default the final decison to @TillaTheHun0 and @tripott you guys should decide, you have heard my arguments, I feel the app, core and ports should be under one repo and think ports should just be a part of core, and maybe app part of core too with GQL and REST combined. And adapters should be external and community encouraged. I also think it will be easier to contract out the creation of adapters and even the support of adapters in separate repositories than in the core hyper repo. I feel the lack of contribution has not only been lack of documentation, but the fear of breaking changes, no one wants to be the guy who broke the build and the more complex the core repo becomes the more real this becomes an issue for new contributors. Maybe you guys can huddle the next two days and make a decision, I will support it either way, just know that this is a decision that we will have to look back in 2 years and know whether we made the right call or not. So think in terms of having 100s of adapters and a dozen or so ports from sms, image recon, sentiment analysis, blockchain, etc. Look at open source communities that support independent plugin contributions like rollup, babel, webpack and eco systems that have mono repo plugin contributions like pouchdb, ? mono repos are cool, but they are in eco-systems that pre-built tooling goes against the grain. Google, Facebook etc have 1000s of engineers and have the internal expertise to leverage mono-repos effectively, and do not use mono-repos for their open source pojects, mainly they have mono-repos (to my knowledge) as internal projects, it is a way of protecting IP and enabling cross team contribution and communication. I don't think we have the same issues of a Google or Facebook. Do we have any successful evidence of three person teams building open-source leveraging the pros of a mono-repo? Please give all the above consideration, try to not only see the present, but the future, and our desire to stay lean and empower the community to grow the project, instead of having a core team of 20 developers managing hundreds of adapters. Don't get me wrong it will be great to see 100s of adapters, but managed by the open source community not the hyper core team. And I think we can find a way to compensate owners of adapters by the community in a marketplace model to fund the support of the adapters which is not free. And my intentions are not to make it free, as much as to separate adapter knowledge from hyper core knowledge. Ok, end rant, you guys make the call, and I will support your decision. |
Beta Was this translation helpful? Give feedback.
-
I think adapters should be external to promote open source contribution. |
Beta Was this translation helpful? Give feedback.
-
We will split each adapter into a separate repo in the hyper org. |
Beta Was this translation helpful? Give feedback.
We will split each adapter into a separate repo in the hyper org.