The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Remove release channel CI infra (#72292)
Ryan Lauriee2ab95955441
diff --git a/.github/workflows/release-log.yml b/.github/workflows/release-log.ymlindex 8963c23bf82..da3ac02f60d 100644--- a/.github/workflows/release-log.yml+++ b/.github/workflows/release-log.yml@@ -73,21 +73,14 @@ jobs:env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}run: cd release && tsx ./src/release-log-run.ts $VERSION > v$VERSION.html- - name: generate release channel log- run: cd release && tsx ./src/release-channel-log.ts > channels.html- name: upload release log to the webrun: |aws s3 cp \release/v$VERSION.html \s3://${{ vars.AWS_S3_STATIC_BUCKET }}/release-log/v$VERSION.html- - name: upload release channel log to the web- run: |- aws s3 cp \- release/channels.html \- s3://${{ vars.AWS_S3_STATIC_BUCKET }}/release-log/channels.html- name: Create cloudfront invalidationrun: |aws cloudfront create-invalidation \--distribution-id ${{ vars.AWS_CLOUDFRONT_STATIC_ID }} \- --paths "/release-log/v$VERSION.html" "/release-log/channels.html"+ --paths "/release-log/v$VERSION.html"diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 61a7ec171de..6927a1af5c0 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -11,14 +11,6 @@ on:commit:description: 'A full-length commit SHA-1 hash'required: true- release-channel:- description: 'The release channel to publish to (optional)'- type: choice- options:- - none- - latest- required: true- default: 'none'auto:description: 'auto-patch release DO NOT SET MANUALLY'type: boolean@@ -33,14 +25,6 @@ on:description: 'A full-length commit SHA-1 hash'type: stringrequired: true- release-channel:- description: 'The release channel to publish to (optional)'- type: string- # options:- # - none- # - latest- required: true- default: 'none'auto:description: 'auto-patch release DO NOT SET MANUALLY'type: boolean@@ -581,20 +565,9 @@ jobs:--distribution-id ${{ vars.AWS_CLOUDFRONT_STATIC_ID }} \--paths "/version-info.json" "/version-info-ee.json"- set-release-channel:- needs: publish-version-info- uses: ./.github/workflows/release-tag.yml- secrets: inherit- with:- version: ${{ inputs.version }}- tag_name: ${{ inputs.release-channel }}- tag_rollout: 100- tag_ee: true- tag_oss: true-publish-complete-message:runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}- needs: [set-release-channel, add-extra-tags]+ needs: [add-extra-tags]timeout-minutes: 5steps:- uses: actions/checkout@v4diff --git a/.github/workflows/tag-for-release.yml b/.github/workflows/tag-for-release.ymlindex e5aba83ddd8..b295c80a7ea 100644--- a/.github/workflows/tag-for-release.yml+++ b/.github/workflows/tag-for-release.yml@@ -255,6 +255,3 @@ jobs:version: ${{ inputs.version }}commit: ${{ inputs.commit }}auto: ${{ inputs.auto }}- # for now don't auto-set release channel because we don't want to have- # multiple nightlies due to race conditions- release-channel: nonediff --git a/release/.gitignore b/release/.gitignoreindex 360219759ab..5efaf1a6bd6 100644--- a/release/.gitignore+++ b/release/.gitignore@@ -6,4 +6,3 @@ dist/version.propertiesversion-info.jsonv*.html-channels.html\ No newline at end of filediff --git a/release/src/release-channel-log.ts b/release/src/release-channel-log.tsdeleted file mode 100644index d0b36042e2b..00000000000--- a/release/src/release-channel-log.ts+++ /dev/null@@ -1,101 +0,0 @@-import fs from 'fs';--import { $ } from 'zx';--const releaseChannels = [- "nightly",- "beta",- "latest",-] as const;--const editions = ["oss", "ee"] as const;--type CommitInfo = {- version: string,- message: string,- hash: string,- date: string,-}--type ReleaseChannel = typeof releaseChannels[number];-type Edition = typeof editions[number];-type ChannelInfo = Record<Edition, CommitInfo & { edition: Edition, channel: ReleaseChannel }>;-type TagInfo = Record<ReleaseChannel, ChannelInfo>;--const tablePageTemplate = fs.readFileSync('./src/releaseChannelPageTemplate.html', 'utf8');-const format = "--pretty='format:%(decorate:prefix=,suffix=)||%s||%H||%ah'";--export async function gitLog(channel: ReleaseChannel, edition: Edition): Promise<CommitInfo> {- const { stdout } = await $`git log -1 ${format} refs/tags/${channel}-${edition}`.catch(() => ({ stdout: '' }));- const commitInfo = processCommit(stdout.trim());-- return commitInfo;-}--function processCommit(commitLine: string): CommitInfo {- const [refs, message, hash, date] = commitLine.split('||');-- // match version strings that don't have an x in them- // https://regexr.com/8a5kb- const version = refs?.match(/(v(0|1)\.[\d\.\-(RC|beta|alpha)]+)(?!.*x)/i)?.[1] ?? '';-- return { version, message, hash, date};-}--const commitLink = (hash: string) => `https://github.com/metabase/metabase/commit/${hash}`;--function linkifyCommit(commit: CommitInfo) {- return `<a href="${commitLink(commit.hash)}" target="_blank">${commit.version}</a>`;-}--function tableRow(channelInfo: ChannelInfo) {- return `<tr>- <td><strong>${channelInfo.ee.channel}</strong></td>- <td>${linkifyCommit(channelInfo.oss)}</td>- <td>${linkifyCommit(channelInfo.ee)}</td>- </tr>`;-}--function buildTable(tagInfo: TagInfo) {- const rows = Object.values(tagInfo).map(tableRow).join('\n');- const currentTime = new Date().toLocaleString();- const tableHtml = `- <table>- <thead>- <tr>- <th>Channel</th>- <th>OSS</th>- <th>EE</th>- </tr>- </thead>- <tbody>- ${rows}- </tbody>- </table>`;-- return tablePageTemplate- .replace(/{{release-table}}/, tableHtml)- .replace(/{{current-time}}/, currentTime);-}--export async function releaseChannelLog() {- // @ts-expect-error - TS is too stupid to infer from Object.fromEntries- const tagInfo: TagInfo = Object.fromEntries(releaseChannels.map((- channel: ReleaseChannel) => [channel, { ee: {}, oss: {} }]- ));-- for (const edition of editions) {- for (const channel of releaseChannels) {- const commitInfo = await gitLog(channel, edition);- tagInfo[channel][edition] = {- channel,- edition,- ...commitInfo,- };- }- }-- return buildTable(tagInfo);-}--console.log(await releaseChannelLog());diff --git a/release/src/types.ts b/release/src/types.tsindex 04f828fbe72..d7eca8815f5 100644--- a/release/src/types.ts+++ b/release/src/types.ts@@ -40,8 +40,6 @@ export interface VersionInfoFile {older: VersionInfo[];}-export type ReleaseChannel = "latest" | "beta" | "nightly";-export type Issue = {number: number;node_id: string;diff --git a/release/src/version-info.ts b/release/src/version-info.tsindex 4c026fe40fc..9c8d9c1bf9a 100644--- a/release/src/version-info.ts+++ b/release/src/version-info.ts@@ -2,7 +2,6 @@ import fetch from "node-fetch";import { getChangelogUrl } from "./release-notes";import type {- ReleaseChannel,ReleaseProps,VersionInfo,VersionInfoFile,@@ -127,60 +126,3 @@ export async function getVersionInfo({return newVersionJson;}--// for updating the version in version info for a specific channel-export const updateVersionInfoChannel = async ({- channel,- newVersion,- rollout = 100,-}: {- channel: ReleaseChannel;- newVersion: string;- rollout?: number;-}) => {- const url = getVersionInfoUrl(newVersion);- const existingFile = (await fetch(url).then(r =>- r.json(),- )) as VersionInfoFile;-- const newVersionJson = updateVersionInfoChannelJson({- channel,- version: newVersion,- existingVersionInfo: existingFile,- rollout,- });-- return newVersionJson;-};--export function updateVersionInfoChannelJson({- existingVersionInfo,- channel,- version,- rollout = 100,-}: {- existingVersionInfo: VersionInfoFile;- channel: ReleaseChannel;- version: string;- rollout?: number;-}): VersionInfoFile {- if (channel === "latest") {- // tagging latest requires moving the current latest to the "older" array- return updateVersionInfoLatestJson({- newLatestVersion: version,- existingVersionInfo,- rollout,- });- }-- // everything else is just setting the correct key in the version info- return {- ...existingVersionInfo,- [channel]: {- version,- released: new Date().toISOString().slice(0, 10),- rollout,- highlights: [],- },- };-}diff --git a/release/src/version-info.unit.spec.ts b/release/src/version-info.unit.spec.tsindex 93d0432bb5e..0b3ff2a77c6 100644--- a/release/src/version-info.unit.spec.ts+++ b/release/src/version-info.unit.spec.ts@@ -1,5 +1,5 @@import type { VersionInfoFile } from "./types";-import { generateVersionInfoJson, getVersionInfoUrl, updateVersionInfoChannelJson, updateVersionInfoLatestJson } from "./version-info";+import { generateVersionInfoJson, getVersionInfoUrl, updateVersionInfoLatestJson } from "./version-info";describe("version-info", () => {describe("generateVersionInfoJson", () => {@@ -235,114 +235,6 @@ describe("version-info", () => {});});- describe("updateVersionInfoChannelJson", () => {- const oldJson = {- latest: {- version: "v0.2.4",- released: "2022-01-01",- patch: true,- highlights: ["Old Issue 1", "Old Issue 2"],- },- nightly: {- version: "v0.2.4.1",- released: "2022-01-03",- patch: true,- highlights: [],- },- beta: {- version: "v0.2.6",- released: "2022-01-02",- patch: true,- highlights: [],- },- older: [- {- version: "v0.2.5",- released: "2023-01-01",- patch: true,- highlights: ["New Issue 31", "New Issue 41"],- },- {- version: "v0.2.3",- released: "2021-01-01",- patch: true,- highlights: ["Old Issue 3", "Old Issue 4"],- },- {- version: "v0.2.2",- released: "2020-01-01",- patch: true,- highlights: ["Old Issue 5", "Old Issue 6"],- },- ],- } as VersionInfoFile;-- it("should update nightly version", () => {- const updatedJson = updateVersionInfoChannelJson({- version: "v0.2.4.2",- existingVersionInfo: oldJson,- channel: "nightly",- rollout: 51,- });-- expect(updatedJson.nightly).toEqual({- version: "v0.2.4.2",- released: expect.any(String),- rollout: 51,- highlights: [],- });-- expect(updatedJson.beta).toEqual(oldJson.beta);- expect(updatedJson.latest).toEqual(oldJson.latest);- });-- it("should update beta version", () => {- const updatedJson = updateVersionInfoChannelJson({- version: "v0.2.7",- existingVersionInfo: oldJson,- channel: "beta",- rollout: 51,- });-- expect(updatedJson.beta).toEqual({- version: "v0.2.7",- released: expect.any(String),- rollout: 51,- highlights: [],- });-- expect(updatedJson.latest).toEqual(oldJson.latest);- expect(updatedJson.nightly).toEqual(oldJson.nightly);- });-- it("should update latest version", () => {- const updatedJson = updateVersionInfoChannelJson({- version: "v0.2.5", // must be in the older array- existingVersionInfo: oldJson,- channel: "latest",- rollout: 51,- });-- expect(updatedJson.latest).toEqual({- version: "v0.2.5",- released: expect.any(String),- rollout: 51,- patch: true,- highlights: ["New Issue 31", "New Issue 41"],- });-- expect(updatedJson.older).toContainEqual({- version: "v0.2.4",- released: "2022-01-01",- patch: true,- highlights: ["Old Issue 1", "Old Issue 2"],- });-- expect(updatedJson.beta).toEqual(oldJson.beta);- expect(updatedJson.nightly).toEqual(oldJson.nightly);- });- });-describe("getVersionInfoUrl", () => {beforeEach(() => {jest.resetModules();