Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

No more upcoming release reminders (#74033)

Ryan Laurie86d6e3a9ba67
diff --git a/.github/workflows/release-status.yml b/.github/workflows/release-status.yml
index 88e675a6958..28605adee4d 100644
--- a/.github/workflows/release-status.yml
+++ b/.github/workflows/release-status.yml
@@ -6,43 +6,6 @@ on:
- cron: '0 7 * * 1-5' # every weekday at 8am/9am Central European Time
jobs:
- check-release-status:
- # don't run this workflow on a cron for forks
- if: ${{ github.event_name != 'schedule' || github.repository == 'metabase/metabase' }}
- runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
- timeout-minutes: 10
- steps:
- - uses: actions/checkout@v4
- with:
- sparse-checkout: |
- release
- .github
- - name: Prepare release scripts
- uses: ./.github/actions/prepare-release-scripts
- - name: Check release status and post to Slack
- uses: actions/github-script@v7
- env:
- SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- SLACK_RELEASE_CHANNEL: ${{ vars.SLACK_RELEASE_CHANNEL }}
- with:
- script: | # js
- const { checkReleaseStatus } = require('${{ github.workspace }}/release/dist/index.cjs');
-
- if (!process.env.SLACK_BOT_TOKEN) {
- throw new Error('SLACK_BOT_TOKEN is required');
- }
-
- if (!process.env.SLACK_RELEASE_CHANNEL) {
- throw new Error('SLACK_RELEASE_CHANNEL is required');
- }
-
- const ossReleased = await checkReleaseStatus({
- github,
- owner: context.repo.owner,
- repo: context.repo.repo,
- channelName: process.env.SLACK_RELEASE_CHANNEL,
- });
-
open-backport-reminder:
runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
timeout-minutes: 10
diff --git a/release/src/index.ts b/release/src/index.ts
index 2365fa4f1d6..2375b4745b3 100644
--- a/release/src/index.ts
+++ b/release/src/index.ts
@@ -3,7 +3,6 @@ export * from "./github";
export * from "./linked-issues";
export * from "./milestones";
export * from "./release-notes";
-export * from "./release-status";
export * from "./slack";
export * from "./version-helpers";
export * from "./version-info";
diff --git a/release/src/release-status.ts b/release/src/release-status.ts
deleted file mode 100644
index 9d46eb03f93..00000000000
--- a/release/src/release-status.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-/* eslint-disable no-console */
-import type { Octokit } from "@octokit/rest";
-import dayjs from "dayjs";
-
-import { findMilestone, getMilestoneIssues } from "./github";
-import { getChannelTopic, sendPreReleaseStatus } from "./slack";
-
-
-const DATE_FORMAT = "ddd, MMM DD";
-// if we're more than x days out from a release, don't spam slack
-const MIN_DAYS_TO_RELEASE = 1;
-
-async function getReleaseInfo({
- channelName
-}: {
- channelName: string;
-}) {
- const topic = await getChannelTopic(channelName);
-
- if (!topic) {
- throw new Error(`No channel topic found for ${channelName}`);
- }
- const matches = Array.from(topic.matchAll(/Next Release\:\s(.+)\son\s(.+)\b/ig));
-
- if (!matches?.length) {
- throw new Error("No release date found in channel topic");
- }
-
- return matches.map(([, version, date]) => ({
- version,
- date: dayjs(date).format(DATE_FORMAT),
- dateDiff: dayjs(date).diff(dayjs(), 'day')
- }));
-}
-
-export async function checkReleaseStatus({
- channelName,
- github,
- owner,
- repo,
-} : {
- channelName: string,
- github: Octokit,
- owner: string,
- repo: string,
-}) {
- const releaseInfo = await getReleaseInfo({ channelName });
- console.log(releaseInfo);
-
- releaseInfo.forEach(async ({ version, date, dateDiff }) => {
- if (dateDiff > MIN_DAYS_TO_RELEASE) {
- return;
- }
- const milestone = await findMilestone({ version, github, owner, repo });
- if (!milestone) {
- console.log(`No milestone found for ${version}`);
- return;
- }
- const openIssues = await getMilestoneIssues({
- github,
- owner,
- repo,
- version,
- state: 'open'
- });
-
- await sendPreReleaseStatus({
- channelName,
- version,
- date,
- openIssues,
- closedIssueCount: milestone.closed_issues,
- milestoneId: milestone.number
- });
- });
-}