This repository was archived by the owner on Aug 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
431 lines (420 loc) · 23.4 KB
/
index.html
File metadata and controls
431 lines (420 loc) · 23.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>CSemVer - Constrained Semantic Versioning 1.0.0-rc.1</title>
<meta name="author" content="Invenietis">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/bootstrap-light.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
</head>
<body>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-304133-4', 'auto');
ga('send', 'pageview');
</script>
<ol class="nav lang">
<li><a href="#">english</a> [en]</li>
<li><a lang="fr" rel="alternate" hreflang="fr" href="lang/fr/index.html">français</a> [fr]</li>
<li>
previous versions: <a href="index-v1-0-0-rc.html">v1.0.0-rc</a>, <a href="index-v1-0-0-beta-1.html">v1.0.0-beta.1</a>, <a href="index-v1-0-0-beta.html">v1.0.0-beta</a>, <a href="index-v1-0-0-alpha.html">v1.0.0-alpha</a>
</li>
</ol>
<h1>Constrained Semantic Versioning v1.0.0-rc.1</h1>
<div id="playground-advert">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">CSemVer Playground</h3>
</div>
<div class="panel-body">
<div>
CSemVer in action: browse the versions, test your mind!
</div>
<br />
<a href="playground/site/" class="btn btn-primary btn-block">Explore</a>
</div>
</div>
</div>
<h2>Summary</h2>
<p>
<b>CSemVer</b> is an operational subset of Semantic Versioning 2.0.0 (<a href="http://semver.org">http://semver.org</a>) that is defined around one strong idea:
CSemVer versions are totally ordered, each version corresponds to a unique 64 bits signed integer ranging
from 1 (v0.0.0-alpha) to 4000050000000000000 (v99999.49999.9999).
</p>
<p class="no-space-after">
<b>CSemVer-CI</b> is an extension that supports CI builds. Its versions follow SemVer 2.0.0, but are not CSemVer compliant. CSemVer-CI defines 2 kind of CI versions:
</p>
<dl>
<dt>ZeroBased</dt>
<dd>Versions are based on the 0.0.0 very first version and are smaller than it. Any version of this kind has always a lower precedence than any version of actual releases.</dd>
<dt>LastReleasedBased</dt>
<dd>Versions are based on a previous release. They are greater than their base version but always lower than any successor of their base.</dd>
</dl>
<p>
<b>CSemVer</b> and <b>CSemVer-CI</b> both offer long and short version forms.
The short form is compatible with NuGet V2 version handling and are often considered more readable.
</p>
<p class="no-space-after">
<input id="vlong" type="radio" checked name="f" title="Long form" /><label for="vlong">Long form</label>
<input id="vshort" type="radio" name="f" title="Short form" /><label for="vshort">Short form</label>
<img src="CSemVerLong.png" id="ilong" style="width:100%" />
<img src="CSemVerShort.png" id="ishort" style="width:100%" />
</p>
<h2>Clarification about SemVer 2.0.0 case sensitivity</h2>
SemVer does not clearly states whether versions should be considered case sensitive or case insensitive.
Current implementations differ: NuGet (Windows ecosystem) uses case insensitive versions and npm (Linux) uses case sensitivity.
Case sensitivity leads to surprising version precedence (1.0.0-RC < 1.0.0-alpha) and since Windows must be supported, we, as NuGet does,
consider that SemVer versions MUST be considered case insensitive.
<h2>Rationales & examples</h2>
<p>
<b>1</b> - CSemVer defines a <a href="https://en.wikipedia.org/wiki/Total_order">totally ordered</a> set of versions.
This is used to generate and/or control versions that guaranty a correct application of precedence rules and
coherency of the emitted artifacts. Each CSemVer version is associated to a unique integer that fits
into <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa381058(v=vs.85).aspx">Windows binary version number</a>.
</p>
<div class="sample">
<table>
<thead><tr><th>CSemVer</th><th>Short form<sup>(1)</sup></th><th>Ordered Version</th><th>Description</th></tr></thead>
<tbody>
<tr>
<td class="version">v0.0.0-alpha</td>
<td class="version">0.0.0-a</td>
<td class="num">1</td>
<td>
The very first possible version is the 0.0.0 alpha (this is a MainPrerelease).
There are 27 possible first versions (it can be 0.0.0, 0.1.0 and 1.0.0 with their 8 prereleases).
</td>
</tr>
<tr>
<td class="version">v0.0.0-alpha.1</td>
<td class="version">0.0.0-a01</td>
<td class="num">101</td>
<td rowspan="2">
These are NumberedPreReleases. There can be 99 NumberedPreReleases for each MainPreRelease.
</td>
</tr>
<tr>
<td class="version">v0.0.0-alpha.2</td>
<td class="version">0.0.0-a02</td>
<td class="num">201</td>
</tr>
<tr>
<td class="version">v0.0.0-alpha.0.1</td>
<td class="version">0.0.0-a00-01</td>
<td class="num">2</td>
<td>
Oops! There was a bug in the very first alpha and someone, for any reason, needs a fix.
This is a PatchPreRelease.
</td>
</tr>
<tr>
<td class="version">v1.0.0</td>
<td class="version">1.0.0</td>
<td class="num">40000500080001</td>
<td>
The first Stable Release is a MajorRelease.
</td>
</tr>
<tr>
<td class="version">v1.0.1</td>
<td class="version">1.0.1</td>
<td class="num">40000500160002</td>
<td>
A fix to the first Stable version: as a PatchRelease, it should contain only bug fixes, no breaking changes. (This is a Stable Release.)
</td>
</tr>
<tr>
<td class="version">v1.1.0</td>
<td class="version">1.1.0</td>
<td class="num">40001300090001</td>
<td>
Introduction of new features but no breaking changes: welcome to the MinorRelease. (This is a Stable Release.)
</td>
</tr>
<tr>
<td class="version">v2.0.0-rc</td>
<td class="version">2.0.0-r</td>
<td>80001000070001</td>
<td>
A MainPreRelease that prepares the next MajorRelease.
</td>
</tr>
</tbody>
</table>
<p>
<sup>(1)</sup> The origin of this Short form is that <a href="http://nuget.org">NuGet</a> packaging system in
its V2 version (2015) did not follow Semantic Versioning (the 'special name' - the prerelease part - was simply ordered lexically in ASCII sort order).
Moreover this 'special name' could not exceed 20 characters.
The latter is the reason why the Short form uses only the initial of the prerelease name (in order to support CSemVer-CI <em>LastReleasedBased</em> versionning).
</p>
</div>
<p>
<b>2</b> - CSemVer makes possible to really control the versions that are published. The valid successors (according to Semantic Versioning rules) of
any version can be computed (there can be up to 28 successors to a version) and, respectively, one can decide whether a version is a valid predecessor
of any other version.
</p>
<div class="sample">
<table>
<thead><tr><th>Version</th><th>Successors</th></tr></thead>
<tbody>
<tr>
<td class="version">v1.2.3<br /><em>27 successors</em></td>
<td>
v1.2.4-alpha, v1.2.4-beta, v1.2.4-delta, v1.2.4-epsilon, v1.2.4-gamma, v1.2.4-kappa, v1.2.4-prerelease, v1.2.4-rc, <b>v1.2.4</b>,
v1.3.0-alpha ⇒<sup>(2)</sup> v1.3.0-rc, <b>v1.3.0</b>,
v2.0.0-alpha ⇒ v2.0.0-rc, <b>v2.0.0</b>
</td>
</tr>
<tr>
<td class="version">v1.2.3-alpha<br /><em>28 successors</em></td>
<td>
<b>v1.2.3-alpha.0.1</b>,
<b>v1.2.3-alpha.1</b>, v1.2.3-beta ⇒ v1.2.3-rc, <b>v1.2.3</b>,
v1.3.0-alpha ⇒ v1.3.0-rc, <b>v1.3.0</b>,
v2.0.0-alpha ⇒ v2.0.0-rc, <b>v2.0.0</b>
</td>
</tr>
<tr>
<td class="version">v1.2.3-delta.5<br /><em>26 successors</em></td>
<td>
<b>v1.2.3-delta.5.1</b>,
<b>v1.2.3-delta.6</b>, v1.2.3-epsilon ⇒ v1.2.3-rc, <b>v1.2.3</b>,
v1.3.0-alpha ⇒ v1.3.0-rc, <b>v1.3.0</b>,
v2.0.0-alpha ⇒ v2.0.0-rc, <b>v2.0.0</b>
</td>
</tr>
<tr>
<td class="version">v1.2.3-prerelease.2.3<br /><em>22 successors</em></td>
<td>
<b>v1.2.3-prerelease.2.4</b>, <b>v1.2.3-prerelease.3</b>,
<b>v1.2.3-rc</b>, <b>v1.2.3</b>,
v1.3.0-alpha ⇒ v1.3.0-rc, <b>v1.3.0</b>,
v2.0.0-alpha ⇒ v2.0.0-rc, <b>v2.0.0</b>
</td>
</tr>
<tr>
<td class="version">v1.2.3-rc<br /><em>21 successors</em></td>
<td>
<b>v1.2.3-rc.0.1</b>,<b> v1.2.3-rc.1</b>, <b>v1.2.3</b>,
v1.3.0-alpha ⇒ v1.3.0-rc, <b>v1.3.0</b>,
v2.0.0-alpha ⇒ v2.0.0-rc, <b>v2.0.0</b>
</td>
</tr>
</tbody>
</table>
<p>
<sup>(2)</sup> The ⇒ replaces the list of the prerelease names from <em>alpha</em>, <em>beta</em>, <em>delta</em>, <em>epsilon</em>, <em>gamma</em>, <em>kappa</em>, <em>prerelease</em> up to <em>rc</em>.
</p>
</div>
<p>
<b>3</b> - CI builds correspond to productions that are not actual releases: the version has to be automatically created since no real version exist for them.
A CI build is defined by: a BuildIndex that is a number or an identifier that gets bigger for each new build (it is usually a simple integer that is provided by the CI process or a timestamp)
and a CIBuildName that identifies the source, the nature, or any other constant key of the build (this is usually the name of the 'branch' in a SCM) .
</p>
<p class="no-space-after">
CSemVer-CI enables the support of CI buils into CSemVer versions with the guaranty of a valid precedence order (in order to secure deployments).
The two kind of versions offers two different guaranties:
</p>
<dl>
<dt>ZeroBased</dt>
<dd>
A ZeroBased version has a lower than precedence than any released package, even the very first possible one (v0.0.0-alpha).
Risk that a product issued from the CI pollutes any production is highly improbable.
One example is enough to understand it: 0.0.0--ci.15-develop (where BuildIndex is 15 and CIBuildName is 'develop').
The double dash (that is perfectly valid in Semantic Versioning 2.0.0) makes this version lower than any other CSemVer versions.
</dd>
<dt>LastReleasedBased</dt>
<dd>
As its name states, this versioning mode relies on the last release (be it Official or PreRelease).
Such semantic versions have higher precedence than their base but lowest precedence than any successor of this base.
Risk that a product issued from the CI pollutes any production is highly mitigated.
<br/>
<b>This implements a "post release" feature</b> (see <a href="https://github.com/mojombo/semver/issues/200">this issue on
github</a>) in Semantic Versionning 2.0.0 that, apparently, supports only a "pre release" feature: there is
no 'magic', only a careful use of the precedence order rules (with the help of the double dash trick).
</dd>
</dl>
<p></p>
<div class="sample">
<p>
The table below helps understand how CSemVer-CI <em>LastReleasedBased</em> works.
</p>
<table>
<caption>CSemVer-CI <em>LastReleasedBased</em> samples where CIBuildName is 'develop' and BuldIndex is 15</caption>
<thead><tr><th>Base Version</th><th>CI Version (PostRelease)</th><th>Immediate successor</th><th>Description</th></tr></thead>
<tbody>
<tr>
<td class="version">
v0.4.1-rc.2.1
</td>
<td class="version">
0.4.1-rc.2.1.ci.15.develop
</td>
<td class="version">
v0.4.1-rc.2.2
</td>
<td>
<p class="center no-space-after">PatchPreRelease</p>
This is the simplest one: by appending a dotted part, the CI version has a greater precedence than its base.
<br />
"Base Version" < "CI Version" < "Immediate successor" is guaranteed here and for the 3 other cases below.
</td>
</tr>
<tr>
<td class="version">
v3.2.1-rc.1
</td>
<td class="version">
3.2.1-rc.1.0.ci.15.develop
</td>
<td class="version">
v3.2.1-rc.1.1
</td>
<td>
<p class="center no-space-after">NumberedPreRelease</p>
It is the "padding" with the .0 here that does the job.
</td>
</tr>
<tr>
<td class="version">
v3.2.1-beta
</td>
<td class="version">
3.2.1-beta.0.0.ci.15.develop
</td>
<td class="version">
v3.2.1-beta.0.1
</td>
<td>
<p class="center no-space-after">MainPreRelease</p>
The double 0 padding is required for pre release.
</td>
</tr>
<tr>
<td class="version">
v1.2.3
</td>
<td class="version">
1.2.4--ci.15.develop
</td>
<td class="version">
1.2.4-alpha
</td>
<td>
<p class="center no-space-after">Stable Release<br />(applies to Major, Minor and PatchRelease)</p>
This uses the double dash trick of the <em>ZeroBased</em> kind, plus another one: the <span class="verpart">Patch</span> is incremented by one.
</td>
</tr>
</tbody>
</table>
</div>
<h2>Specifications</h2>
<p>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
interpreted as described in <a href="http://tools.ietf.org/html/rfc2119">RFC 2119</a>.
</p>
<h3>CSemVer</h3>
<ol>
<li>
<p>CSemVer versions follow Semantic Versioning 2.0.0 rules but adds some constraints to them.</p>
</li>
<li>
<p>Syntax of a CSemVer MUST be:</p>
<p>[v|V]<span class="verpart">Major</span>.<span class="verpart">Minor</span>.<span class="verpart">Patch</span>[-<span class="verpart">PreReleaseName</span>[.<span class="verpart">PreReleaseNumber</span>[.<span class="verpart">PreReleaseFix</span>]]][+<span class="verpart">BuildMetaData</span>]</p>
</li>
<li><p>CSemVer versions MAY be prefixed with a 'v' or 'V' (GitHub convention). This is the only extension that is not supported by SemVer.</p></li>
<li><p>The <span class="verpart">Major</span> part MUST be defined between 0 and 99999.</p></li>
<li><p>The <span class="verpart">Minor</span> part MUST be defined between 0 and 49999.</p></li>
<li><p>The <span class="verpart">Patch</span> part MUST be defined between 0 and 9999.</p></li>
<li>
<p>
The <span class="verpart">PrereleaseName</span> MAY be denoted by appending a hyphen and a name that MUST be one of the 8 values of the following list (ordered from 0 to 7):
alpha, beta, delta, epsilon, gamma, kappa, pre (or prerelease), rc.
</p>
<p>
The <span class="verpart">PrereleaseName</span>'s intial MAY be used as a short form: a, b, d, e, g, k, p, r.
</p>
<p>Any other name not listed in this set MUST be considered syntactically invalid.<p>
</li>
<li><p>The <span class="verpart">PrereleaseNumber</span> MAY be denoted by appending a dot and a number that MUST be defined between 0 and 99.</p></li>
<li><p>The <span class="verpart">PrereleaseFix</span> MAY be denoted by appending a dot and a number that MUST be defined between 1 and 99.</p></li>
<li><p>The <span class="verpart">PrereleaseNumber</span> 0 MUST appear only when a <span class="verpart">PrereleaseFix</span> is specified to denote a fix of a first prerelease (v4.3.2-rc.0.2 is the second fix of v4.3.2-rc).</p></li>
</ol>
<h3>CSemVer-CI</h3>
<ol>
<li>
<p>CSemVer-CI versions follow Semantic Version 2.0.0 rules.</p>
</li>
<li>
<p>Syntax of a CSemVer-CI ZeroTimed MUST be:</p>
<p><span class="verpart">0</span>.<span class="verpart">0</span>.<span class="verpart">0</span>--ci.<span class="verpart">BuildIndex</span>.<span class="verpart">CIBuildName</span>[+<span class="verpart">BuildMetaData</span>]
where the <span class="verpart">BuildMetaData</span> SHOULD be the base version.</p>
</li>
<li>
<p>The <span class="verpart">BuildIndex</span> MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-] and MUST NOT be empty. It can be purely numeric.</p>
</li>
<li>
<p>The <span class="verpart">CIBuildName</span> MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-] and MUST NOT be empty.</p>
</li>
<li>
<p>
<span class="verpart">BuildIndex</span> MUST increase between builds based on the same base version. It MAY be time based with a fixed format (ie. YYYYMMDD-HHMMSS), be an incremented number provided by
the CI process or any other numeric or alphanumeric value as long as it is increasing (either numerically or lexically in ASCII sort order) for each build.
</p>
<p><i>In DSCM like Git or Mercurial this CAN be the maximum number of commits from the commit point up to the parent commit that defines the base version.</i>
</p>
</li>
<li>
<p>
Syntax of a CSemVer-CI LastReleasedBased MUST be:
</p>
<ul>
<li>
<p>
Applied to a v<span class="verpart">Major</span>.<span class="verpart">Minor</span>.<span class="verpart">Patch</span> version:
<br />
<span class="verpart">Major</span>.<span class="verpart">Minor</span>.<span class="verpart">Patch+1</span>--ci.<span class="verpart">BuildIndex</span>.<span class="verpart">CIBuildName</span>
</p>
</li>
<li>
<p>
Applied to a v<span class="verpart">Major</span>.<span class="verpart">Minor</span>.<span class="verpart">Patch</span>-<span class="verpart">PreReleaseName</span> version:
<br />
<span class="verpart">Major</span>.<span class="verpart">Minor</span>.<span class="verpart">Patch+1</span>-<span class="verpart">PreReleaseName</span>.0.0.ci.<span class="verpart">BuildIndex</span>.<span class="verpart">CIBuildName</span>
</p>
</li>
<li>
<p>
Applied to a v<span class="verpart">Major</span>.<span class="verpart">Minor</span>.<span class="verpart">Patch</span>-<span class="verpart">PreReleaseName</span>.<span class="verpart">PreReleaseNumber</span> version:
<br />
<span class="verpart">Major</span>.<span class="verpart">Minor</span>.<span class="verpart">Patch+1</span>-<span class="verpart">PreReleaseName</span>.<span class="verpart">PreReleaseNumber</span>.0.ci.<span class="verpart">BuildIndex</span>.<span class="verpart">CIBuildName</span>
</p>
</li>
<li>
<p>
Applied to a v<span class="verpart">Major</span>.<span class="verpart">Minor</span>.<span class="verpart">Patch</span>-<span class="verpart">PreReleaseName</span>.<span class="verpart">PreReleaseNumber</span>.<span class="verpart">PreReleaseFix</span> version:
<br />
<span class="verpart">Major</span>.<span class="verpart">Minor</span>.<span class="verpart">Patch+1</span>-<span class="verpart">PreReleaseName</span>.<span class="verpart">PreReleaseNumber</span>.<span class="verpart">PreReleaseFix</span>.ci.<span class="verpart">BuildIndex</span>.<span class="verpart">CIBuildName</span>
</p>
</li>
</ul>
</li>
</ol>
<h2>About</h2>
<p>
The Constrained Semantic Versioning specification is authored by <a href="https://signature-code.com">Signature Code</a>.
</p>
<p>
If you'd like to leave feedback, please <a href="https://github.com/SimpleGitVersion/SimpleGitVersion.github.io/issues">open an issue on GitHub</a>.
</p>
<h2>License</h2>
<p>
<a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons - CC BY 3.0</a>
</p>
</body>
</html>