Open ehakan opened 1 year ago
Scope-based versioning perhaps has the potential to gain larger user base. Can it be implemented in an abstract way? That is, the selection of commits to associate to a component is implemented as a “strategy”. Like, path-based, scope-based, etc.
Problem
As far as I understand release-please only considers paths of edited files and commit messages when determining version.
For most projects this is fine, but depending solely on paths start to break down when trying to version more complicated structures.
Conventional Commit scopes can provide significant context in these situations because they are decided by developers.
Cases such as:
A Multiplayer game where client and server code lives in the same files.
This example doesn’t do separate versioning for clients and servers, but it is desired when working on multiplayer games. With Unity multiplayer frameworks (1st party and 3rd party), shared, client specific and server specific code are usually in the same files. Say you fix something you know only effects the server, and clients can still connect to it because of backwards compatibility. You create a commit for the server portion of
Grass.cs
with the messagefix(server): null value in logs when reporting grass count
. Unfortunately what would have been a simple server side fix rollout is now also a full on client version bump + release.1.0.0-ios.3
and1.0.0-android.6
, keeping a specific structure ofmajor.minor.patch-platform.bump.anythingelse
and parsing that information when uploading to App Store / Play Store. Whether something is a fix or feat, if it’s scoped to a specific a platform and not about the app in general, you only bump the platform bump number as to not release an empty change on the not affected platform. (I'm not sure if release-please supports such a versioning scheme but that should probably be a different feature request if it does not)Proposal
Let's add a recursive "scoped-package" field to the spec, with fields inherited from package spec, and two extra fields:
scopes: [string]
include-nonscoped: bool
"Simple" Manifest Example
Assuming both client and server is at
v1.0.0
, and the game provides backwards compatibility on major version (as it should):feat(client): improve accessibility
v1.1.0
v1.0.0
feat(ui): add selection for player avatars
v1.1.0
v1.0.0
feat(server): add endpoint for manually triggering events
v1.0.0
v1.1.0
feat!: client-server udp protocol v2
orfeat(client, server)!: client-server udp protocol v2
v2.0.0
v2.0.0
feat(server)!: remove server-side day/night cycle
v1.0.0
v2.0.0
Nested Manifest Example
Server is the same but now client has "ios" and "android" subscopes.
Note that bumping strategy is just semver, not the one I mentioned in cases.
fix(client): ...
v1.1.0
v1.1.0
fix(client/ios): ...
v1.1.0
v1.0.0
fix(client/android): ...
v1.0.0
v1.1.0
Alternatives
I haven’t come across a tool that supports both monorepos and multiple languages as well as release-please.