-
Notifications
You must be signed in to change notification settings - Fork 12
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
Automatic Versioning in Package Managers #22
Comments
@mafintosh your bot idea reminded me of this. |
@jbenet the bot could run some sort of heuristic on the code and suggest major/minor/patch |
Not sure what the bot idea is, but any assistance in semver would be tremendously beneficial. For npm, hooking a check into a |
You can't automate semver all the way because semantic changes to the code also break compatibility, and cannot be mechanically detected in general. A function may change its behavior but not its type signature, a struct can change they way it is used but the fields remain the same. An automated tool won't catch this. So, you can write a tool that detect lots of situations and say "hey, you must increment the major version here!" but you can't write a tool that is able to look at code and say "this can be a tiny version increase, no API behaviors have changed." Yes, you can use test suites as a proxy for detecting semantic changes in API behaviors beyond type signatures and data structures and that would improve things — you'd be able to detect more "you must increment major" situations. But it can also only go so far, because in practice one can't test for every possible input/output combination so you still can't be 100% sure; the tool wouldn't be able to ensure a release is really "tiny-safe". |
Reading http://crates.io/manifest.html it mentions a section on following semver:
Wait, why can't we just automatically version code based on this? It's hard for other languages, but Rust compiler is probably able to generate semver for us. It would certainly make less code break if semver was definitely followed.
The one downside is less flexibility for the authors. But when doing semver, you don't really have that flexibility anyway-- versioning is spec-ed out for you.
The text was updated successfully, but these errors were encountered: