From 6c1ca6fa8cfb52ed7b3f21be2a9667623dd7c268 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 18 Mar 2024 16:29:55 -0700 Subject: [PATCH] output releases with explcit major/minor keys --- cmd/ingest/main.go | 5 +-- lib/release/releases.go | 4 +-- metadata.sqlite3 | Bin 77824 -> 77824 bytes products/releases.json | 63 +++++++++++++++++++++++------------ schemas/sdk_metadata.sql | 5 +-- scripts/generate-products.sh | 2 +- 6 files changed, 51 insertions(+), 28 deletions(-) diff --git a/cmd/ingest/main.go b/cmd/ingest/main.go index fc92fa5..442d6bd 100644 --- a/cmd/ingest/main.go +++ b/cmd/ingest/main.go @@ -242,13 +242,14 @@ func insertFeatures(tx *sql.Tx, id string, metadata *metadataV1) error { } func insertReleases(tx *sql.Tx, id string, release []release.WithEOL) error { - stmt, err := tx.Prepare("INSERT INTO sdk_releases (id, version, date, eol) VALUES (?, ?, ?, ?)") + stmt, err := tx.Prepare("INSERT INTO sdk_releases (id, major, minor, date, eol) VALUES (?, ?, ?, ?, ?)") if err != nil { return err } defer stmt.Close() for _, release := range release { - _, err = stmt.Exec(id, release.MajorMinor(), release.Date.Format(time.RFC3339), release.MaybeEOL()) + majorMinor := release.MajorMinor() + _, err = stmt.Exec(id, majorMinor[0], majorMinor[1], release.Date.Format(time.RFC3339), release.MaybeEOL()) if err != nil { return err } diff --git a/lib/release/releases.go b/lib/release/releases.go index 3e817f8..1609a3d 100644 --- a/lib/release/releases.go +++ b/lib/release/releases.go @@ -51,8 +51,8 @@ type releasesQuery struct { } `graphql:"repository(owner: $org, name: $repo)"` } -func (r WithEOL) MajorMinor() string { - return strings.TrimPrefix(semver.MajorMinor(r.Version), "v") +func (r WithEOL) MajorMinor() []string { + return strings.Split(strings.TrimPrefix(semver.MajorMinor(r.Version), "v"), ".") } func (r WithEOL) MaybeEOL() *string { diff --git a/metadata.sqlite3 b/metadata.sqlite3 index d975a7c9cc0cd8e6f4aca8f24c33ebaf581287b0..924e4c968b0d398c07c8ff4a5a5b17b3ff558469 100644 GIT binary patch delta 1049 zcmZ|NO;6h}7zgl})@j;7Ljn~-gEBxB2Z&@lEo%yV3E-3iQq~$&`X&YFwY*5&5O30a zn0DDW*oph3eTUtK_#RbpLR;KAN86kXb>mBDS3T{ir-2J|N}bpBLZMClGOc5F z^BJs<(O;RmoHoM`mHvk|K_qV>+rou?Tr8nt$;R%Mp{@qu%~pk4C)DS)MRu?N*3Ah2 z@qzz~bcbaYqjDU!J9I_(ufuK^!Q8f*GxUPuQ?Gn#HNDenn_`5d)`{bmQtEQhdb!>@ zs~pxnpAz=MlMR`(*+_Py`8((BFhmiu^KuVg-5sc|1wD8*ui;fKS~;S%HfCL(uoLbm zqdQm%vGeX$?Cq@krQf_0iWyxRo}J)?{TlipI;ba4|ChjZx&!%50sVQSOj=yx*^wog z8Clxq4CEI92=gc+LpD4u8_@^W8D1g>r3d(KcuF=hnSp%bU~J%@Ovr}|g!4x!iEwg^ uI+PG?%qX!F66MtlBqM0T%m!ze6bcDegy$9JW)%4V delta 1039 zcmZ|NzfQtH90%~8v{Fz}S{q|j3>xA@9 z3J%7>!NGTM)A$}n597tNSG(Qke)sLK_v_J{di17V?t_i1>OyEEGIW=mcnC+2bMf$0 zDg{oKdn@`@xI>$*N~7L;(kFY5dXBG8KlS@h9UL2D+O(O?vZ@lTVc0*P0cjsS%k;r0 zH#n&9gAPF?VqX+c_-oMU+vshQ1HUXbEvSQ*APySgF^Uu;TOm)!& z!aVX2#bv`2vXOCaUH%glAc}GPH9RI88MV}u1^fdaG1R09#QR54iEzY6T>^>jGXkBk oM44erT{3}hI!FsrtbTVbi~&Ow@*9C@$Vjj|j0lAUVnukq08%CwQUCw| diff --git a/products/releases.json b/products/releases.json index 94c4efd..a3802c1 100644 --- a/products/releases.json +++ b/products/releases.json @@ -1,117 +1,138 @@ { "akamai-base": [ { - "version": "2.1", + "major": "2", + "minor": "1", "date": "2024-03-15T18:08:33Z", "eol": null }, { - "version": "2.0", + "major": "2", + "minor": "0", "date": "2024-01-17T20:20:38Z", "eol": "2025-03-15T18:08:33Z" }, { - "version": "1.0", + "major": "1", + "minor": "0", "date": "2023-09-06T16:50:07Z", "eol": "2025-01-17T20:20:38Z" } ], "akamai-edgekv": [ { - "version": "1.1", + "major": "1", + "minor": "1", "date": "2024-03-15T18:08:34Z", "eol": null }, { - "version": "1.0", + "major": "1", + "minor": "0", "date": "2024-01-17T20:20:39Z", "eol": "2025-03-15T18:08:34Z" } ], "cloudflare": [ { - "version": "2.4", + "major": "2", + "minor": "4", "date": "2024-03-15T18:08:27Z", "eol": null }, { - "version": "2.3", + "major": "2", + "minor": "3", "date": "2024-01-17T20:20:33Z", "eol": "2025-03-15T18:08:27Z" }, { - "version": "2.2", + "major": "2", + "minor": "2", "date": "2023-11-01T21:33:19Z", "eol": "2025-01-17T20:20:33Z" }, { - "version": "2.1", + "major": "2", + "minor": "1", "date": "2023-09-06T16:50:05Z", "eol": "2024-11-01T21:33:19Z" }, { - "version": "2.0", + "major": "2", + "minor": "0", "date": "2023-08-10T20:32:51Z", "eol": "2024-09-06T16:50:05Z" } ], "node-server": [ { - "version": "9.2", + "major": "9", + "minor": "2", "date": "2024-03-15T18:08:30Z", "eol": null }, { - "version": "9.1", + "major": "9", + "minor": "1", "date": "2024-02-08T21:29:54Z", "eol": "2025-03-15T18:08:30Z" }, { - "version": "9.0", + "major": "9", + "minor": "0", "date": "2024-01-17T20:20:36Z", "eol": "2025-02-08T21:29:54Z" }, { - "version": "8.2", + "major": "8", + "minor": "2", "date": "2024-02-12T21:00:03Z", "eol": "2025-01-17T20:20:36Z" }, { - "version": "8.1", + "major": "8", + "minor": "1", "date": "2023-08-10T20:32:49Z", "eol": "2025-01-17T20:20:36Z" }, { - "version": "8.0", + "major": "8", + "minor": "0", "date": "2023-07-05T16:40:59Z", "eol": "2024-08-10T20:32:49Z" } ], "react-native": [ { - "version": "10.0", + "major": "10", + "minor": "0", "date": "2024-03-15T18:08:29Z", "eol": null } ], "vercel": [ { - "version": "1.3", + "major": "1", + "minor": "3", "date": "2024-03-15T18:08:31Z", "eol": null }, { - "version": "1.2", + "major": "1", + "minor": "2", "date": "2024-01-17T20:20:37Z", "eol": "2025-03-15T18:08:31Z" }, { - "version": "1.1", + "major": "1", + "minor": "1", "date": "2023-11-01T21:33:21Z", "eol": "2025-01-17T20:20:37Z" }, { - "version": "1.0", + "major": "1", + "minor": "0", "date": "2023-08-03T20:52:41Z", "eol": "2024-11-01T21:33:21Z" } diff --git a/schemas/sdk_metadata.sql b/schemas/sdk_metadata.sql index 1c3fa64..0c540bb 100644 --- a/schemas/sdk_metadata.sql +++ b/schemas/sdk_metadata.sql @@ -48,10 +48,11 @@ CREATE TABLE sdk_feature_info ( CREATE TABLE sdk_releases ( id TEXT NOT NULL, - version TEXT NOT NULL, + major TEXT NOT NULL, + minor TEXT NOT NULL, date TEXT NOT NULL, eol TEXT, - PRIMARY KEY(id, version) + PRIMARY KEY(id, major, minor) ); diff --git a/scripts/generate-products.sh b/scripts/generate-products.sh index 9188794..cc1e075 100755 --- a/scripts/generate-products.sh +++ b/scripts/generate-products.sh @@ -19,4 +19,4 @@ sqlite3 -json metadata.sqlite3 "SELECT * from sdk_repos;" | jq -S 'reduce .[] as $item ({}; .[$item.id] += {github: $item.github})' > products/repos.json sqlite3 -json metadata.sqlite3 "SELECT * FROM sdk_releases;" | - jq 'group_by(.id) | map({(.[0].id): map({version: .version, date: .date, eol: .eol})}) | add' > products/releases.json + jq 'group_by(.id) | map({(.[0].id): map({major: .major, minor: .minor, date: .date, eol: .eol})}) | add' > products/releases.json