Skip to content

Commit

Permalink
Restructure and remove emojis
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Büchse <[email protected]>
  • Loading branch information
mbuechse committed Dec 7, 2023
1 parent 25db85a commit a6c42d2
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 23 deletions.
11 changes: 5 additions & 6 deletions populateCerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ const sidebarItems = scopes.map((scope) => {
scope.versions.forEach((version) => {
version.isStable = version.stabilized_at !== undefined && version.stabilized_at <= today
version.isObsolete = version.obsoleted_at !== undefined && version.obsoleted_at < today
version.isActive = version.isStable && !version.isObsolete
version.isEffective = version.isStable && !version.isObsolete
version.isPreview = version.stabilized_at === undefined || today < version.stabilized_at
if (!version.isActive && !version.isPreview) {
if (!version.isEffective && !version.isPreview) {
numOld += 1
if (numOld > MAX_OLD) return
console.log(numOld)
}
version.state = version.isActive ? '📜' : version.isPreview ? '✏️' : '🗑️'
version.state = version.isEffective ? 'effective' : version.isPreview ? 'preview' : 'obsolete'
if (version.standards === undefined) return
versionsShown[version.version] = version
version.standards.forEach((standard) => {
Expand Down Expand Up @@ -100,10 +99,10 @@ const sidebarItems = scopes.map((scope) => {
lines.push('') // file should end with a single newline character
fs.writeFileSync(`standards/${scope.id}.md`, lines.join('\n'), 'utf8')

const state = columns.filter((c) => versionsShown[c].isActive).length ? '📜' : '✏️'
const state = columns.filter((c) => versionsShown[c].isEffective).length ? '📜' : '✏️'
return {
type: 'doc',
label: `${state} ${scope.name}`,
label: scope.name,
id: scope.id,
}
})
Expand Down
38 changes: 22 additions & 16 deletions populateStds.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ filenames.forEach((filename) => {
}
obj.isStable = obj.stabilized_at !== undefined && obj.stabilized_at <= today
obj.isObsolete = obj.obsoleted_at !== undefined && obj.obsoleted_at <= today
obj.isActive = obj.isStable && !obj.isObsolete
obj.isEffective = obj.isStable && !obj.isObsolete
var track = obj.track
if (track === undefined) return
if (tracks[track] === undefined) tracks[track] = {}
Expand All @@ -58,13 +58,18 @@ function readPrefixLines(fn) {
return lines
}

function mkLinkList(versions) {
var links = versions.map((v) => `[${v.version}](/standards/${v.id})`)
return links.join(', ')
}

// walk down the hierarchy, building adr overview pages, track overview pages, and total overview page
// as well as the new sidebar
sidebarItems = []
var lines = readPrefixLines('standards/standards/overview.md')
if (!lines.length) lines.push(intro)
lines.push('| Standard | Track | Description | Active Versions |')
lines.push('| --------- | ------ | ------------ | ---------------- |')
lines.push('| Standard | Track | Description | Versions:<br />Preview | <br />Effective | <br /> Obsolete |')
lines.push('| --------- | ------ | ------------ | --- | --- | --- |')
Object.entries(tracks).forEach((trackEntry) => {
var track = trackEntry[0]
var trackPath = `standards/${track.toLowerCase()}`
Expand All @@ -86,21 +91,22 @@ Object.entries(tracks).forEach((trackEntry) => {
${trackIntros[track]}
`)
}
tlines.push('| Standard | Description | Active Versions |')
tlines.push('| --------- | ------------ | ---------------- |')
tlines.push('| Standard | Description | Versions:<br />Preview | <br />Effective | <br /> Obsolete |')
tlines.push('| --------- | ------------ | --- | --- | --- |')
Object.entries(trackEntry[1]).forEach((standardEntry) => {
var versions = standardEntry[1].versions
var activeVersions = versions.filter((v) => v.isActive)
var activeLinks = activeVersions.map((v) => `[${v.version}](/standards/${v.id})`)
// unfortunately, some standards are obsolete without being stable
var previewVersions = versions.filter((v) => !v.isStable && !v.isObsolete)
var effectiveVersions = versions.filter((v) => v.isEffective)
var obsoleteVersions = versions.filter((v) => v.isObsolete)
var ref = versions[versions.length - 1]
if (activeVersions.length) {
activeVersions[activeVersions.length - 1]
if (effectiveVersions.length) {
ref = effectiveVersions[effectiveVersions.length - 1]
}
var icon = activeVersions.length ? '📜' : '✏️'
var adrId = standardEntry[0]
var standardItem = {
type: 'category',
label: `${icon} scs-${adrId}`,
label: `scs-${adrId}`,
link: {
type: 'doc',
id: `${track.toLowerCase()}/scs-${adrId}`,
Expand All @@ -117,18 +123,18 @@ ${trackIntros[track]}
}
slines.push('| Version | Type | State | stabilized | obsoleted |')
slines.push('| -------- | ----- | ------- | ---------- | --------- |')
var link = `[${icon} scs-${adrId}](/standards/${track.toLowerCase()}/scs-${adrId})`
lines.push(`| ${link} | ${track} | ${ref.title} | ${activeLinks.join(', ')} |`)
tlines.push(`| ${link} | ${ref.title} | ${activeLinks.join(', ')} |`)
var link = `[scs-${adrId}](/standards/${track.toLowerCase()}/scs-${adrId})`
var versionList = `${mkLinkList(previewVersions) || '-'} | ${mkLinkList(effectiveVersions) || '-'} | ${mkLinkList(obsoleteVersions) || '-'}`
lines.push(`| ${link} | ${track} | ${ref.title} | ${versionList} |`)
tlines.push(`| ${link} | ${ref.title} | ${versionList} |`)
standardEntry[1].versions.forEach((obj) => {
var icon = obj.isActive ? '📜' : '✏️'
var versionItem = {
type: 'doc',
label: obj.version.toUpperCase(),
id: obj.id,
}
standardItem.items.push(versionItem)
slines.push(`| [${icon} scs-${adrId}-${obj.version}](/standards/${obj.id}) | ${obj.type} | ${obj.status || obj.state} | ${obj.stabilized_at || '-'} | ${obj.obsoleted_at || '-'} |`)
slines.push(`| [scs-${adrId}-${obj.version}](/standards/${obj.id}) | ${obj.type} | ${obj.status || obj.state} | ${obj.stabilized_at || '-'} | ${obj.obsoleted_at || '-'} |`)
})
slines.push('') // file should end with a single newline character
fs.writeFileSync(`${trackPath}/scs-${adrId}.md`, slines.join('\n'), 'utf8')
Expand Down
12 changes: 11 additions & 1 deletion sidebarsStandards.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ const sidebars = {
type: 'doc',
id: 'certification/overview',
},
items: require('./sidebarsCertificationItems.js'),
items: [
{
type: 'category',
label: 'Scopes and Versions',
link: {
type: 'doc',
id: 'certification/scopes-versions',
},
items: require('./sidebarsCertificationItems.js'),
},
]
},
{
type: 'category',
Expand Down
18 changes: 18 additions & 0 deletions standards/certification/scopes-versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Scopes and versions

SCS provides a certification framework consisting of six different kinds of certificates of varying scope.
These scopes can be sorted into two dimensions:

1. _certification level_, of which there are three:
- SCS-compatible
- SCS-open
- SCS-sovereign
2. _cloud layer_, of which there are two:
- infastructure as a service (IaaS)
- Kubernetes as a service (KaaS)

So, for instance, a certificate can have the scope _SCS-compatible IaaS_ or _SCS-sovereign KaaS_.

Each scope corresponds to a set of standards. As these standards progress, so do the scopes, and we keep track of this by versioning. Each version undergoes a lifecycle of Draft, Stable, and Deprecated, and we aim to keep at most one version stable at the same time, with the exception of a transition period of 4 to 6 weeks.

![Alt text](image.png)

0 comments on commit a6c42d2

Please sign in to comment.