TLDR:
- Currently, breaking changes to the registry’s module schema, like removing an existing property, results in breaking changes for the registry consumers.
- To prevent that, we need to introduce a versioning solution to the registry, so that consumers will be able to rely on their consumed version for not introducing such breaking changes.
- The proposed solution for now is to maintain major versions, each in a separate GitHub branch.
Background
The Hats Modules Registry is a curated modules database. Tools, apps, and platforms in the Hats ecosystem — including the Modules SDK — use it as the source of truth for safe, high quality modules they can serve to users and other developers.
It is currently hosted in GitHub, on this repository, on the main branch. For each module, there’s a JSON file that contains the module’s metadata. It enables consumers to automatically create new instances of the module, interact with these instances and in addition contains useful information for their users. These files have a predefined structure, specified by the module schema.
The Problem
Currently, consumers of the registry always fetch its current state. The consequence is that changes to the schema may introduce breaking changes to consumers (e.g. removing certain properties from the registry).
Ideally, consumers will be able to have certainty about the anticipated structure of the modules schema.
Proposed Solution
Maintain major versions of the registry. For each new breaking change in the schema, there will be a new version, while keeping all previous versions still available for usage. We chose to use a separate GitHub branch for each version:
- The default branch will be called submissions - will be the target branch for new PRs
- Production branches, v-[version number] for each major version
Once a PR is merged to submissions, it will be automatically merged to the relevant production branch.
Considerations / Tradeoffs
The vision for the registry is to serve as a schelling point which connects between module builders and their users. Ideally, the registry will be hosted via decentralized infrastructure and governed by a broad community.
At this point, using GitHub as the registry’s host is optimizing for simplicity, allowing for the registry to evolve with less friction. In parallel, our goal is that the current architecture will enable the transition to a decentralized infrastructure and governance to be as smooth as possible for all users of the registry.
With these considerations in mind, we find GitHub hosting to be a good middle ground, essentially serving as one place for both the DB itself, the Devops to automate/manage certain operation on it and the governance/source control over it.
Please feel free to provide any feedback, ideas or general thoughts!