mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Remove feature toggles github action (#85714)
* remove the feature toggle cleanup github action * removing codeowners entries that are unnecessary
This commit is contained in:
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -693,8 +693,6 @@ embed.go @grafana/grafana-as-code
|
|||||||
/.github/workflows/core-plugins-build-and-release.yml @grafana/plugins-platform-frontend @grafana/plugins-platform-backend
|
/.github/workflows/core-plugins-build-and-release.yml @grafana/plugins-platform-frontend @grafana/plugins-platform-backend
|
||||||
/.github/workflows/i18n-crowdin-upload.yml @grafana/grafana-frontend-platform
|
/.github/workflows/i18n-crowdin-upload.yml @grafana/grafana-frontend-platform
|
||||||
/.github/workflows/i18n-crowdin-download.yml @grafana/grafana-frontend-platform
|
/.github/workflows/i18n-crowdin-download.yml @grafana/grafana-frontend-platform
|
||||||
/.github/workflows/feature-toggle-cleanup.yml @tolzhabayev
|
|
||||||
/.github/workflows/scripts/feature-toggle-cleanup/feature-toggle-cleanup.js @tolzhabayev
|
|
||||||
/.github/workflows/pr-go-workspace-check.yml @grafana/grafana-app-platform-squad
|
/.github/workflows/pr-go-workspace-check.yml @grafana/grafana-app-platform-squad
|
||||||
|
|
||||||
# Generated files not requiring owner approval
|
# Generated files not requiring owner approval
|
||||||
|
|||||||
28
.github/workflows/feature-toggle-cleanup.yml
vendored
28
.github/workflows/feature-toggle-cleanup.yml
vendored
@@ -1,28 +0,0 @@
|
|||||||
name: Feature Toggle Cleanup
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
# * is a special character in YAML so you have to quote this string
|
|
||||||
- cron: '30 10 * * *'
|
|
||||||
jobs:
|
|
||||||
feature-toggle-cleanup:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
# This check is here to prevent this workflow from running on forks.
|
|
||||||
if: github.repository == 'grafana/grafana'
|
|
||||||
steps:
|
|
||||||
- name: Check out the code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: "20.x"
|
|
||||||
- run: npm install csv-parse
|
|
||||||
- name: Parse CVS file to see which Feature Toggles should be notified about
|
|
||||||
id: parse-csv-file
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
env:
|
|
||||||
FEATURE_TOGGLES_CSV_FILE_PATH: "pkg/services/featuremgmt/toggles_gen.csv"
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const { default: cleanupFeatureFlags } = await import('${{ github.workspace }}/.github/workflows/scripts/feature-toggle-cleanup/feature-toggle-cleanup.mjs')
|
|
||||||
await cleanupFeatureFlags({github, context, core})
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
import { parse } from 'csv-parse/sync';
|
|
||||||
import fs from 'fs';
|
|
||||||
|
|
||||||
/***
|
|
||||||
* Feauture Flag Structure example
|
|
||||||
* Name: 'disableEnvelopeEncryption',
|
|
||||||
Stage: 'GA',
|
|
||||||
Owner: '@grafana/grafana-as-code',
|
|
||||||
Created: '2022-05-24',
|
|
||||||
requiresDevMode: 'false',
|
|
||||||
RequiresLicense: 'false',
|
|
||||||
RequiresRestart: 'false',
|
|
||||||
FrontendOnly: 'false'
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
export default function cleanupFeatureFlags() {
|
|
||||||
const today = new Date();
|
|
||||||
const sixMonthAgo = today.setMonth(today.getMonth() - 6);
|
|
||||||
const inputFileContents = fs.readFileSync(process.env.FEATURE_TOGGLES_CSV_FILE_PATH);
|
|
||||||
const parsedFeatureFlags = parse(inputFileContents, {
|
|
||||||
columns: true,
|
|
||||||
skip_empty_lines: true,
|
|
||||||
cast: true,
|
|
||||||
cast_date: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
// Here we can have the custom logic of how to handle what type of feature flag - e.g. GA can be treated differently than experimental and so on.
|
|
||||||
for (const flag of parsedFeatureFlags) {
|
|
||||||
if (flag.Created < sixMonthAgo) {
|
|
||||||
console.log(`The flag ${flag.Name} was created more than 6 months ago. It should be checked.`);
|
|
||||||
console.log(flag);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user