Skip to content

Commit b85e891

Browse files
Merge pull request openshift#489 from grokspawn/semver-template-y-streams
OCPBUGS-13789: downstream y-streams-for-all semver template changes.
2 parents 969aa60 + 6fac044 commit b85e891

File tree

13 files changed

+612
-723
lines changed

13 files changed

+612
-723
lines changed

staging/operator-registry/alpha/declcfg/write.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (writer *MermaidWriter) WriteChannels(cfg DeclarativeConfig, out io.Writer)
9595

9696
// build increasing-version-ordered bundle names, so we can meaningfully iterate over a range
9797
orderedBundles := []string{}
98-
for n, _ := range versionMap {
98+
for n := range versionMap {
9999
orderedBundles = append(orderedBundles, n)
100100
}
101101
sort.Slice(orderedBundles, func(i, j int) bool {
@@ -153,7 +153,7 @@ func (writer *MermaidWriter) WriteChannels(cfg DeclarativeConfig, out io.Writer)
153153

154154
out.Write([]byte("graph LR\n"))
155155
pkgNames := []string{}
156-
for pname, _ := range pkgs {
156+
for pname := range pkgs {
157157
pkgNames = append(pkgNames, pname)
158158
}
159159
sort.Slice(pkgNames, func(i, j int) bool {

staging/operator-registry/alpha/template/semver/README.md

Lines changed: 64 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Since a `catalog template` is identified as an input schema which may be processed to generate a valid FBC, we can define a `semver template` as a schema which uses channel conventions to facilitate the auto-generation of channels along `semver` delimiters.
44

5-
[**DISCLAIMER:** since version build metadata [MUST be ignored when determining version precedence](https://semver.org) when using semver, it cannot be used in any bundle included in the `semver template` and will result in a fatal error.]
5+
[**DISCLAIMER:** since version build metadata [MUST be ignored when determining version precedence](https://semver.org) when using semver, rendering the template will result in an error if two bundles differ only by the build metadata.]
66

77
### Schema Goals
88
The `semver template` must have:
@@ -85,67 +85,81 @@ Note that if the command is called without a file argument and nothing passed in
8585
the command will hang indefinitely. Either a file argument or file information passed
8686
in on standard input is required by the command.
8787
88-
With the template attribute `GenerateMajorChannels: true` resulting major channels from the command are (skipping the rendered bundle image output):
88+
With the template attribute `GenerateMajorChannels: true` resulting major channels from the command are (filtering out `olm.bundle` content):
8989
```yaml
9090
---
9191
defaultChannel: stable-v1
9292
name: testoperator
9393
schema: olm.package
9494
---
9595
entries:
96-
- name: testoperator.v0.1.0
97-
- name: testoperator.v0.1.1
98-
- name: testoperator.v0.1.2
99-
- name: testoperator.v0.1.3
100-
skips:
101-
- testoperator.v0.1.0
102-
- testoperator.v0.1.1
103-
- testoperator.v0.1.2
104-
- name: testoperator.v0.2.0
105-
- name: testoperator.v0.2.1
106-
- name: testoperator.v0.2.2
107-
replaces: testoperator.v0.1.3
108-
skips:
109-
- testoperator.v0.2.0
110-
- testoperator.v0.2.1
111-
- name: testoperator.v0.3.0
112-
replaces: testoperator.v0.2.2
96+
- name: testoperator.v0.1.0
97+
- name: testoperator.v0.1.1
98+
- name: testoperator.v0.1.2
99+
- name: testoperator.v0.1.3
100+
skips:
101+
- testoperator.v0.1.0
102+
- testoperator.v0.1.1
103+
- testoperator.v0.1.2
104+
- name: testoperator.v0.2.0
105+
- name: testoperator.v0.2.1
106+
- name: testoperator.v0.2.2
107+
replaces: testoperator.v0.1.3
108+
skips:
109+
- testoperator.v0.1.0
110+
- testoperator.v0.1.1
111+
- testoperator.v0.1.2
112+
- testoperator.v0.2.0
113+
- testoperator.v0.2.1
114+
- name: testoperator.v0.3.0
115+
replaces: testoperator.v0.2.2
116+
skips:
117+
- testoperator.v0.1.0
118+
- testoperator.v0.1.1
119+
- testoperator.v0.1.2
120+
- testoperator.v0.1.3
121+
- testoperator.v0.2.0
122+
- testoperator.v0.2.1
113123
name: candidate-v0
114124
package: testoperator
115125
schema: olm.channel
116126
---
117127
entries:
118-
- name: testoperator.v1.0.0
119-
- name: testoperator.v1.0.1
120-
skips:
121-
- testoperator.v1.0.0
122-
- name: testoperator.v1.1.0
123-
replaces: testoperator.v1.0.1
128+
- name: testoperator.v1.0.0
129+
- name: testoperator.v1.0.1
130+
skips:
131+
- testoperator.v1.0.0
132+
- name: testoperator.v1.1.0
133+
replaces: testoperator.v1.0.1
134+
skips:
135+
- testoperator.v1.0.0
124136
name: candidate-v1
125137
package: testoperator
126138
schema: olm.channel
127139
---
128140
entries:
129-
- name: testoperator.v0.2.1
130-
- name: testoperator.v0.2.2
131-
skips:
132-
- testoperator.v0.2.1
133-
- name: testoperator.v0.3.0
134-
replaces: testoperator.v0.2.2
141+
- name: testoperator.v0.2.1
142+
- name: testoperator.v0.2.2
143+
skips:
144+
- testoperator.v0.2.1
145+
- name: testoperator.v0.3.0
146+
replaces: testoperator.v0.2.2
147+
skips:
148+
- testoperator.v0.2.1
135149
name: fast-v0
136150
package: testoperator
137151
schema: olm.channel
138152
---
139153
entries:
140-
- name: testoperator.v1.0.1
141-
- name: testoperator.v1.1.0
142-
replaces: testoperator.v1.0.1
154+
- name: testoperator.v1.0.1
155+
- name: testoperator.v1.1.0
156+
replaces: testoperator.v1.0.1
143157
name: fast-v1
144158
package: testoperator
145159
schema: olm.channel
146160
---
147161
entries:
148-
- name: testoperator.v1.0.1
162+
- name: testoperator.v1.0.1
149163
name: stable-v1
150164
package: testoperator
151165
schema: olm.channel
@@ -180,6 +194,9 @@ entries:
180194
- name: testoperator.v0.2.2
181195
replaces: testoperator.v0.1.3
182196
skips:
197+
- testoperator.v0.1.0
198+
- testoperator.v0.1.1
199+
- testoperator.v0.1.2
183200
- testoperator.v0.2.0
184201
- testoperator.v0.2.1
185202
name: candidate-v0.2
@@ -189,6 +206,13 @@ schema: olm.channel
189206
entries:
190207
- name: testoperator.v0.3.0
191208
replaces: testoperator.v0.2.2
209+
skips:
210+
- testoperator.v0.1.0
211+
- testoperator.v0.1.1
212+
- testoperator.v0.1.2
213+
- testoperator.v0.1.3
214+
- testoperator.v0.2.0
215+
- testoperator.v0.2.1
192216
name: candidate-v0.3
193217
package: testoperator
194218
schema: olm.channel
@@ -205,6 +229,8 @@ schema: olm.channel
205229
entries:
206230
- name: testoperator.v1.1.0
207231
replaces: testoperator.v1.0.1
232+
skips:
233+
- testoperator.v1.0.0
208234
name: candidate-v1.1
209235
package: testoperator
210236
schema: olm.channel
@@ -221,6 +247,8 @@ schema: olm.channel
221247
entries:
222248
- name: testoperator.v0.3.0
223249
replaces: testoperator.v0.2.2
250+
skips:
251+
- testoperator.v0.2.1
224252
name: fast-v0.3
225253
package: testoperator
226254
schema: olm.channel
@@ -243,9 +271,8 @@ entries:
243271
name: stable-v1.0
244272
package: testoperator
245273
schema: olm.channel
246-
247274
```
248-
Here, a channel is generated for each template channel which differs by minor version, and each channel has a `replaces` edge from the predecessor channel to the next-lesser minor bundle version. Please note that at no time do we transgress across major-version boundaries with the channels, to be consistent with [the semver convention](https://semver.org/) for major versions, where the purpose is to make incompatible API changes.
275+
Here, a channel is generated for each template channel which differs by minor version, each channel has a `replaces` edge from the highest version entry in the predecessor channel, and the highest version entry in each channel also has a skips list composed of all lower version entries within the same minor (Y). Please note that at no time do we transgress across major-version boundaries with the channels, to be consistent with [the semver convention](https://semver.org/) for major versions, where the purpose is to make incompatible API changes.
249276

250277

251278
### DEMOS
Loading
Loading

0 commit comments

Comments
 (0)