Update Flux/InfluxDB version modal (#5668)

* fix flux influxdb version modal

* removed commented code

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>

---------

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
pull/5676/head
Scott Anderson 2024-11-12 08:20:54 -07:00 committed by GitHub
parent 357e0f94b9
commit 1dd5181e84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 103 additions and 35 deletions

View File

@ -0,0 +1,24 @@
# This is a list of all InfluxDB minor versions that support Flux.
# It is used by flux-build-scripts/update-flux-versions.js to generate the
# "Supported Versions" section of the Flux page.
# When new versions of InfluxDB are released that support Flux, this list should
# be updated.
influxdb:
- '2.7'
- '2.6'
- '2.5'
- '2.4'
- '2.3'
- '2.2'
- '2.1'
- '2.0'
- '1.11'
- '1.8'
- '1.7'
enterprise:
- '1.11'
- '1.10'
- '1.9'
- '1.8'
- '1.7'

View File

@ -5,11 +5,11 @@
# build/deploy process.
flux:
latest: 0.194.4
latest: 0.195.2
cloud:
current: 0.194.3
oss:
'2.7': 0.194.4
'2.7': 0.195.2
'2.6': 0.191.0
'2.5': 0.188.1
'2.4': 0.179.0
@ -17,12 +17,13 @@ oss:
'2.2': 0.162.0
'2.1': 0.139.0
'2.0': 0.131.0
'1.11': 0.194.5
'1.8': 0.65.1
'1.7': 0.50.2
nightly: 0.194.4
nightly: 0.195.2
enterprise:
'1.11': 0.194.3
'1.10': 0.188.0
'1.11': 0.194.5
'1.10': 0.194.5
'1.9': 0.161.0
'1.8': 0.65.1
'1.7': 0.50.2

View File

@ -8,17 +8,6 @@ influxdb:
versions:
- v2
- v1
minor_versions:
- v2.7
- v2.6
- v2.5
- v2.4
- v2.3
- v2.2
- v2.1
- v2.0
- v1.8
- v1.7
latest: v2.7
latest_patches:
v2: 2.7.10
@ -105,12 +94,6 @@ enterprise_influxdb:
menu_category: self-managed
list_order: 5
versions: [v1]
minor_versions:
- v1.11
- v1.10
- v1.9
- v1.8
- v1.7
latest: v1.11
latest_patches:
v1: 1.11.7

View File

@ -85,12 +85,11 @@ function isSemanticNewer(semverX, semverY) {
}
// Load product data from the product data file
const productData = yaml.load(fs.readFileSync(path.resolve(__dirname,'../data/products.yml'), 'utf8'))
const influxdbMinorVersions = yaml.load(fs.readFileSync(path.resolve(__dirname,'../data/flux_influxdb_minor_versions.yml'), 'utf8'))
// Update InfluxDB version arrays by removing 'v' from each version
// Filter out InfluxDB Enterprise versions that don't have a Flux dependency in their go.mod
const ossVersionArr = productData.influxdb.minor_versions.map((element) => {return element.replace('v', '')});
const enterpriseVersionArr = productData.enterprise_influxdb.minor_versions.map((element) => {return element.replace('v', '')}).filter(version => isSemanticNewer(version, '1.9'));
const ossVersionArr = influxdbMinorVersions.influxdb;
const enterpriseVersionArr = influxdbMinorVersions.enterprise.filter(version => isSemanticNewer(version, '1.9'));
// Instantiate base Flux version variables
var ossVersions = {};
@ -104,7 +103,6 @@ var fluxVersions = {};
// Manually add versions that aren't included in the original versions arrays
await addVersion(ossVersions, 'nightly', await getFluxVersion('main-2.x'));
await addVersion(enterpriseVersions, '1.11', await getFluxVersion('1.11'));
await addVersion(enterpriseVersions, '1.8', await getFluxVersion('1.8'));
await addVersion(enterpriseVersions, '1.7', await getFluxVersion('1.7'));

View File

@ -41,12 +41,14 @@
<h4>InfluxDB Open Source (OSS)</h4>
<div class="version-list">
<!-- Loop that only loops over only v1 versions with 1-digit minor version -->
{{ range $key, $value := $oss }}
{{ $versionSemVer := split $value "." }}
{{ $supported := cond (ge (index $versionSemVer 0) (index $introducedSemVer 0)) (cond (ge (index $versionSemVer 1) (index $introducedSemVer 1)) (cond (ge (index $versionSemVer 2) (index $introducedSemVer 2)) true false) false) false }}
{{ $deprecated := and (isset $.Page.Params "deprecated") (cond (ge (index $versionSemVer 0) (index $deprecatedSemVer 0)) (cond (ge (index $versionSemVer 1) (index $deprecatedSemVer 1)) (cond (ge (index $versionSemVer 2) (index $deprecatedSemVer 2)) true false) false) false) }}
{{ $nightlyExcluded := and (eq $key "nightly") $.Page.Params.exclude_from.nightly }}
{{ $excluded := or (gt (len (findRE (string $excludePatternOSS) $key)) 0) $nightlyExcluded }}
{{ if and (in $key "1.") (eq (len $key) 3) }}
<div class="version-row">
<div class="version-col"><p>InfluxDB {{ $key }}</p></div>
<div class="version-col"><p>
@ -57,6 +59,66 @@
</div>
</div>
{{ end }}
{{ end }}
<!-- Loop over only v1 versions with 2+-digit minor version -->
{{ range $key, $value := $oss }}
{{ $versionSemVer := split $value "." }}
{{ $supported := cond (ge (index $versionSemVer 0) (index $introducedSemVer 0)) (cond (ge (index $versionSemVer 1) (index $introducedSemVer 1)) (cond (ge (index $versionSemVer 2) (index $introducedSemVer 2)) true false) false) false }}
{{ $deprecated := and (isset $.Page.Params "deprecated") (cond (ge (index $versionSemVer 0) (index $deprecatedSemVer 0)) (cond (ge (index $versionSemVer 1) (index $deprecatedSemVer 1)) (cond (ge (index $versionSemVer 2) (index $deprecatedSemVer 2)) true false) false) false) }}
{{ $excluded := gt (len (findRE (string $excludePatternOSS) $key)) 0 }}
{{ if and (in $key "1.") (gt (len $key) 3) }}
<div class="version-row">
<div class="version-col"><p>InfluxDB {{ $key }}</p></div>
<div class="version-col"><p>
{{ if $excluded }}
{{ else if $deprecated }}<span class="deprecated"></span>
{{ else if $supported }}<span class="cf-icon Checkmark_New{{ if $sameAsLatest }} pending{{ end }} supported"></span>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}
<!-- Loop over only v2 versions with 1-digit minor version -->
{{ range $key, $value := $oss }}
{{ $versionSemVer := split $value "." }}
{{ $supported := cond (ge (index $versionSemVer 0) (index $introducedSemVer 0)) (cond (ge (index $versionSemVer 1) (index $introducedSemVer 1)) (cond (ge (index $versionSemVer 2) (index $introducedSemVer 2)) true false) false) false }}
{{ $deprecated := and (isset $.Page.Params "deprecated") (cond (ge (index $versionSemVer 0) (index $deprecatedSemVer 0)) (cond (ge (index $versionSemVer 1) (index $deprecatedSemVer 1)) (cond (ge (index $versionSemVer 2) (index $deprecatedSemVer 2)) true false) false) false) }}
{{ $nightlyExcluded := and (eq $key "nightly") $.Page.Params.exclude_from.nightly }}
{{ $excluded := or (gt (len (findRE (string $excludePatternOSS) $key)) 0) $nightlyExcluded }}
{{ if and (in $key "2.") (eq (len $key) 3) }}
<div class="version-row">
<div class="version-col"><p>InfluxDB {{ $key }}</p></div>
<div class="version-col"><p>
{{ if $excluded }}
{{ else if $deprecated }}<span class="deprecated"></span>
{{ else if $supported }}<span class="cf-icon Checkmark_New{{ if $sameAsLatest }} pending{{ end }} supported"></span>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}
<!-- Loop over only v2 versions with 2+-digit minor version -->
{{ range $key, $value := $oss }}
{{ $versionSemVer := split $value "." }}
{{ $supported := cond (ge (index $versionSemVer 0) (index $introducedSemVer 0)) (cond (ge (index $versionSemVer 1) (index $introducedSemVer 1)) (cond (ge (index $versionSemVer 2) (index $introducedSemVer 2)) true false) false) false }}
{{ $deprecated := and (isset $.Page.Params "deprecated") (cond (ge (index $versionSemVer 0) (index $deprecatedSemVer 0)) (cond (ge (index $versionSemVer 1) (index $deprecatedSemVer 1)) (cond (ge (index $versionSemVer 2) (index $deprecatedSemVer 2)) true false) false) false) }}
{{ $nightlyExcluded := and (eq $key "nightly") $.Page.Params.exclude_from.nightly }}
{{ $excluded := or (gt (len (findRE (string $excludePatternOSS) $key)) 0) $nightlyExcluded }}
{{ if and (in $key "2.") (gt (len $key) 3) }}
<div class="version-row">
<div class="version-col"><p>InfluxDB {{ $key }}</p></div>
<div class="version-col"><p>
{{ if $excluded }}
{{ else if $deprecated }}<span class="deprecated"></span>
{{ else if $supported }}<span class="cf-icon Checkmark_New{{ if $sameAsLatest }} pending{{ end }} supported"></span>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}
</div>
<h4>InfluxDB Enterprise</h4>