From 09ea6aa3e151c4185fb56969dc940f615ed37dcd Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Tue, 17 Nov 2026 14:12:12 +0100 Subject: [PATCH 1/3] chore: fix the oxlint violations in the reporting and release helper scripts --- .../create-playwright-test-health-report.mjs | 1 - .../lib/classify-report-buckets.mjs | 8 +- .../lib/normalize-repo-file-path.mjs | 24 ++-- .../lib/slack-test-health-blocks.mjs | 6 +- .github/scripts/create-flaky-test-report.mjs | 35 +++--- .github/scripts/generate-rc-commits.mjs | 36 +++--- .../scripts/post-relay-subsidy-balance.mjs | 6 +- .github/scripts/slack-release-testing.mjs | 53 ++++---- .github/scripts/stable-sync.js | 1 - .github/scripts/update-release-sheet.mjs | 32 ++--- oxlint-suppressions.json | 117 ------------------ package.json | 1 - vitest.config.mts | 8 +- yarn.lock | 8 -- 14 files changed, 101 insertions(+), 235 deletions(-) diff --git a/.github/actions/playwright-test-health-report/create-playwright-test-health-report.mjs b/.github/actions/playwright-test-health-report/create-playwright-test-health-report.mjs index 912176bb..b76e3c25 100644 --- a/.github/actions/playwright-test-health-report/create-playwright-test-health-report.mjs +++ b/.github/actions/playwright-test-health-report/create-playwright-test-health-report.mjs @@ -1,5 +1,4 @@ #!/usr/bin/env node - import { Octokit } from '@octokit/rest'; import { diff --git a/.github/actions/playwright-test-health-report/lib/classify-report-buckets.mjs b/.github/actions/playwright-test-health-report/lib/classify-report-buckets.mjs index 74176daa..4c8f315a 100644 --- a/.github/actions/playwright-test-health-report/lib/classify-report-buckets.mjs +++ b/.github/actions/playwright-test-health-report/lib/classify-report-buckets.mjs @@ -44,19 +44,19 @@ export function partitionSummary(summary) { export function allocateBucketSlots(topN, counts) { const { broken = 0, flaky = 0, watch = 0, infra = 0 } = counts; - let maxBroken = Math.min( + const maxBroken = Math.min( broken, Math.max(Math.ceil(topN * 0.4), broken > 0 ? 2 : 0), ); - let maxFlaky = Math.min( + const maxFlaky = Math.min( flaky, Math.max(Math.ceil(topN * 0.25), flaky > 0 ? 2 : 0), ); - let maxInfra = Math.min( + const maxInfra = Math.min( infra, Math.max(Math.ceil(topN * 0.1), infra > 0 ? 1 : 0), ); - let maxWatch = Math.min(watch, topN - maxBroken - maxFlaky - maxInfra); + const maxWatch = Math.min(watch, topN - maxBroken - maxFlaky - maxInfra); let remaining = topN - (maxBroken + maxFlaky + maxWatch + maxInfra); diff --git a/.github/actions/playwright-test-health-report/lib/normalize-repo-file-path.mjs b/.github/actions/playwright-test-health-report/lib/normalize-repo-file-path.mjs index b4518a6d..f927fc67 100644 --- a/.github/actions/playwright-test-health-report/lib/normalize-repo-file-path.mjs +++ b/.github/actions/playwright-test-health-report/lib/normalize-repo-file-path.mjs @@ -6,39 +6,41 @@ * - Optional testDir prefix (e.g. accounts/foo.spec.ts → tests/smoke-appium/accounts/foo.spec.ts) * - Idempotent when the path already starts with the prefix or `tests/` * - * @param {string} filePath - * @param {{ prefix?: string }} [options] - * @returns {string} + * @param {string} filePath - The test file path to normalize. + * @param {{ prefix?: string }} [options] - The options, where `prefix` is the test directory prepended to relative paths. + * @returns {string} The normalized repo relative path. */ export function normalizeRepoFilePath(filePath, { prefix } = {}) { if (!filePath) { return filePath; } - let normalized = String(filePath).replace(/\\/g, '/'); + let normalized = String(filePath).replace(/\\/gu, '/'); const isAbsolute = - normalized.startsWith('/') || /^[A-Za-z]:\//.test(normalized); + normalized.startsWith('/') || /^[A-Za-z]:\//u.test(normalized); if (isAbsolute) { - const testsMatch = normalized.match(/(?:^|\/)(tests\/.+)$/); + const testsMatch = normalized.match(/(?:^|\/)(tests\/.+)$/u); if (testsMatch) { normalized = testsMatch[1]; } else { - const runnerMatch = normalized.match(/\/work\/[^/]+\/[^/]+\/(.+)$/); + const runnerMatch = normalized.match(/\/work\/[^/]+\/[^/]+\/(.+)$/u); if (runnerMatch) { normalized = runnerMatch[1]; } else { - normalized = normalized.replace(/^\/+/, '').replace(/^[A-Za-z]:\//, ''); + normalized = normalized + .replace(/^\/+/u, '') + .replace(/^[A-Za-z]:\//u, ''); } } } - normalized = normalized.replace(/^\/+/, ''); + normalized = normalized.replace(/^\/+/u, ''); const cleanPrefix = prefix ?.trim() - .replace(/\\/g, '/') - .replace(/^\/+|\/+$/g, ''); + .replace(/\\/gu, '/') + .replace(/^\/+|\/+$/gu, ''); if (cleanPrefix) { const alreadyPrefixed = normalized === cleanPrefix || diff --git a/.github/actions/playwright-test-health-report/lib/slack-test-health-blocks.mjs b/.github/actions/playwright-test-health-report/lib/slack-test-health-blocks.mjs index 64cfad50..62ab12c9 100644 --- a/.github/actions/playwright-test-health-report/lib/slack-test-health-blocks.mjs +++ b/.github/actions/playwright-test-health-report/lib/slack-test-health-blocks.mjs @@ -14,15 +14,15 @@ export function normalizeErrorForSlack(message, maxLength = 120) { } const withoutEmojiShortcodes = String(message).replace( - /:[a-z0-9_+\-]+:/gi, + /:[a-z0-9_+-]+:/giu, ' ', ); const firstMeaningfulLine = withoutEmojiShortcodes - .split(/\r?\n/) + .split(/\r?\n/u) .map((line) => line.trim()) .find(Boolean); const normalized = (firstMeaningfulLine || withoutEmojiShortcodes) - .replace(/\s+/g, ' ') + .replace(/\s+/gu, ' ') .trim(); if (!normalized) { diff --git a/.github/scripts/create-flaky-test-report.mjs b/.github/scripts/create-flaky-test-report.mjs index 53b2238b..cb87d999 100644 --- a/.github/scripts/create-flaky-test-report.mjs +++ b/.github/scripts/create-flaky-test-report.mjs @@ -1,5 +1,4 @@ #!/usr/bin/env node - // Based on the original script done by @itsyoboieltr on Extension repo import { Octokit } from '@octokit/rest'; @@ -7,11 +6,13 @@ import { IncomingWebhook } from '@slack/webhook'; import unzipper from 'unzipper'; const githubToken = process.env.GITHUB_TOKEN; -if (!githubToken) throw new Error('Missing GITHUB_TOKEN env var'); +if (!githubToken) { + throw new Error('Missing GITHUB_TOKEN env var'); +} const env = { GITHUB_TOKEN: process.env.GITHUB_TOKEN, - LOOKBACK_DAYS: parseInt(process.env.LOOKBACK_DAYS ?? '1'), + LOOKBACK_DAYS: parseInt(process.env.LOOKBACK_DAYS ?? '1', 10), TEST_RESULTS_FILE_PATTERN: process.env.TEST_RESULTS_FILE_PATTERN || 'test-runs', OWNER: process.env.OWNER || 'MetaMask', @@ -184,7 +185,7 @@ function extractRealFailures(testData) { jobId: testSuite.job?.id, runId: testSuite.job?.runId, date: new Date(testSuite.date || Date.now()), - retryCount: retryCount, + retryCount, type: 'real_failure', }); } @@ -237,7 +238,7 @@ function extractFlakyTests(testData) { jobId: failureInfo.jobId, runId: failureInfo.runId, date: failureInfo.date, - retryCount: retryCount, + retryCount, type: 'flaky', }); } @@ -450,7 +451,7 @@ function createSlackBlocks( // Each failure top10 .filter((test) => test.realFailures > 0) - .forEach((test, idx) => { + .forEach((test) => { const globalIndex = top10.indexOf(test) + 1; const failText = test.realFailures === 1 ? 'time' : 'times'; const retryText = test.totalRetries === 1 ? 'retry' : 'retries'; @@ -482,7 +483,7 @@ function createSlackBlocks( elements: [ { type: 'rich_text_section', - elements: elements, + elements, }, ], }); @@ -491,7 +492,7 @@ function createSlackBlocks( const error = test.lastRealFailureError; if (error) { const errorPreview = - error.length > 150 ? error.substring(0, 150) + '...' : error; + error.length > 150 ? `${error.substring(0, 150)}...` : error; blocks.push({ type: 'rich_text', elements: [ @@ -500,7 +501,7 @@ function createSlackBlocks( elements: [ { type: 'text', - text: ` ${errorPreview.replace(/\n/g, ' ')}`, + text: ` ${errorPreview.replace(/\n/gu, ' ')}`, style: { italic: true }, }, ], @@ -577,7 +578,7 @@ function createSlackBlocks( elements: [ { type: 'rich_text_section', - elements: elements, + elements, }, ], }); @@ -586,7 +587,7 @@ function createSlackBlocks( const error = test.flakyFailureError; if (error) { const errorPreview = - error.length > 150 ? error.substring(0, 150) + '...' : error; + error.length > 150 ? `${error.substring(0, 150)}...` : error; blocks.push({ type: 'rich_text', elements: [ @@ -595,7 +596,7 @@ function createSlackBlocks( elements: [ { type: 'text', - text: ` ${errorPreview.replace(/\n/g, ' ')}`, + text: ` ${errorPreview.replace(/\n/gu, ' ')}`, style: { italic: true }, }, ], @@ -610,7 +611,7 @@ function createSlackBlocks( } function displayResults(summary, dateDisplay) { - console.log('\n' + '='.repeat(80)); + console.log(`\n${'='.repeat(80)}`); console.log(`📊 REPORT - ${dateDisplay}`); console.log('='.repeat(80)); @@ -662,9 +663,9 @@ function displayResults(summary, dateDisplay) { if (test.lastRealFailureError) { const errorPreview = test.lastRealFailureError.length > 100 - ? test.lastRealFailureError.substring(0, 100) + '...' + ? `${test.lastRealFailureError.substring(0, 100)}...` : test.lastRealFailureError; - console.log(` 💥 Error: ${errorPreview.replace(/\n/g, ' ')}`); + console.log(` 💥 Error: ${errorPreview.replace(/\n/gu, ' ')}`); } } else { // Flaky tests (failed initially but eventually passed) @@ -684,10 +685,10 @@ function displayResults(summary, dateDisplay) { if (test.flakyFailureError) { const errorPreview = test.flakyFailureError.length > 100 - ? test.flakyFailureError.substring(0, 100) + '...' + ? `${test.flakyFailureError.substring(0, 100)}...` : test.flakyFailureError; console.log( - ` 💥 Initial error: ${errorPreview.replace(/\n/g, ' ')}`, + ` 💥 Initial error: ${errorPreview.replace(/\n/gu, ' ')}`, ); } } diff --git a/.github/scripts/generate-rc-commits.mjs b/.github/scripts/generate-rc-commits.mjs index 74e21cf7..b2ec5124 100644 --- a/.github/scripts/generate-rc-commits.mjs +++ b/.github/scripts/generate-rc-commits.mjs @@ -26,10 +26,10 @@ async function getTeam(repository, prNumber) { const topologyJsonUrl = 'https://raw.githubusercontent.com/MetaMask/MetaMask-planning/refs/heads/main/topology.json'; - const githubToken = process.env.GITHUB_TOKEN; + const topologyToken = process.env.GITHUB_TOKEN; const response = await axios.get(topologyJsonUrl, { - headers: { Authorization: `token ${githubToken}` }, + headers: { Authorization: `token ${topologyToken}` }, }); // Check if the response is successful and contains data @@ -37,7 +37,7 @@ async function getTeam(repository, prNumber) { console.error( `Invalid response when fetching topology.json: ${response.status}`, ); - return undefined; + return; } const topologyJson = response.data; @@ -59,13 +59,11 @@ async function getTeam(repository, prNumber) { } // Return undefined if author not found in any team - return undefined; } catch (error) { console.error( `Error fetching team for PR #${prNumber}:`, error.message || error, ); - return undefined; } } @@ -75,7 +73,7 @@ async function filterCommitsByTeam(platform, refA, refB) { const MAX_COMMITS = 500; // Limit the number of commits to process console.log('Filtering commits by team...'); - var repository = ''; + let repository = ''; switch (platform) { case 'mobile': @@ -163,7 +161,7 @@ function formatAsCSV(commitsByTeam) { stripDelimiter(commit.author, ','), commit.prLink, stripDelimiter(team, ','), - , + '', assignChangeType(commit.message), ]; csvContent.push(row.join(',')); @@ -177,35 +175,31 @@ function formatAsCSV(commitsByTeam) { // Helper function to strip delimiter from CSV fields so they can be properly imported automatically later function stripDelimiter(inputString, delimiter) { // Create a regex dynamically based on the provided delimiter - const regex = new RegExp(delimiter, 'g'); + const regex = new RegExp(delimiter, 'gu'); return inputString.replace(regex, ''); } -// Helper function to escape CSV fields -function escapeCSV(field) { - if (field.includes(',') || field.includes('"') || field.includes('\n')) { - return `"${field.replace(/"/g, '""')}"`; // Encapsulate in double quotes and escape existing quotes - } - return field; -} // Helper function to create change type function assignChangeType(field) { - if (field.includes('feat')) return 'Added'; - else if ( + if (field.includes('feat')) { + return 'Added'; + } else if ( field.includes('cherry') || field.includes('bump') || field.includes('release') - ) + ) { return 'Ops'; - else if ( + } else if ( field.includes('chore') || field.includes('test') || field.includes('ci') || field.includes('docs') || field.includes('refactor') - ) + ) { return 'Changed'; - else if (field.includes('fix')) return 'Fixed'; + } else if (field.includes('fix')) { + return 'Fixed'; + } return 'Unknown'; } diff --git a/.github/scripts/post-relay-subsidy-balance.mjs b/.github/scripts/post-relay-subsidy-balance.mjs index a19a289e..623bbeeb 100644 --- a/.github/scripts/post-relay-subsidy-balance.mjs +++ b/.github/scripts/post-relay-subsidy-balance.mjs @@ -77,9 +77,9 @@ const validateRelayResponseShape = (data) => { const computeTotalUsd = (balances) => balances - .map((b) => parseAmountUsd(b?.amountUsd)) - .filter((v) => Number.isFinite(v)) - .reduce((sum, v) => sum + v, 0); + .map((balance) => parseAmountUsd(balance?.amountUsd)) + .filter((value) => Number.isFinite(value)) + .reduce((sum, value) => sum + value, 0); const formatAsOfDate = (date) => new Intl.DateTimeFormat('en-US', { diff --git a/.github/scripts/slack-release-testing.mjs b/.github/scripts/slack-release-testing.mjs index 9db5c680..95c7f564 100644 --- a/.github/scripts/slack-release-testing.mjs +++ b/.github/scripts/slack-release-testing.mjs @@ -36,7 +36,7 @@ async function getGoogleAuth() { // Initialize GoogleAuth with credentials object directly const auth = new google.auth.GoogleAuth({ - credentials: credentials, + credentials, scopes: ['https://www.googleapis.com/auth/spreadsheets'], }); @@ -86,19 +86,19 @@ function parseReleaseUpdates(data) { const result = []; const regex = - /(.*?):\s+\*(.*?)\*\s+-\s+@(.*?)\s+There (?:is|are) (\d+) .*? changes\. \*Pending validation:\* (\d+)\. \*Status:\* (.*)/; + /(.*?):\s+\*(.*?)\*\s+-\s+@(.*?)\s+There (?:is|are) (\d+) .*? changes\. \*Pending validation:\* (\d+)\. \*Status:\* (.*)/u; lines.forEach((line) => { const match = line.match(regex); if (match) { - const [_, emoji, team, slackHandle, changes, pendingValidations, status] = + const [, emoji, team, slackHandle, changes, pendingValidations, status] = match; result.push({ emoji: emoji.trim(), team: team.trim(), slackHandle: slackHandle.trim(), - changes: parseInt(changes), - pendingValidations: parseInt(pendingValidations), + changes: parseInt(changes, 10), + pendingValidations: parseInt(pendingValidations, 10), status: status.trim(), }); } @@ -130,9 +130,8 @@ async function findPullRequestUrlByBranch(owner, repo, branchName) { if (data.length > 0) { // Assuming you want the first PR that matches return data[0].html_url; // Return the URL of the first matching PR - } else { - throw new Error(`No pull requests found for branch ${branchName}`); } + throw new Error(`No pull requests found for branch ${branchName}`); } catch (error) { console.error('Error fetching pull requests:', error); throw error; @@ -174,8 +173,8 @@ async function getActiveReleases(documentId) { .filter((sheet) => !sheet.properties.hidden) .map(async (sheet) => { const { title } = sheet.properties; - const versionMatch = title.match(/v(\d+\.\d+\.\d+)/); - const platformMatch = title.match(/\(([^)]+)\)/); + const versionMatch = title.match(/v(\d+\.\d+\.\d+)/u); + const platformMatch = title.match(/\(([^)]+)\)/u); if (!versionMatch) { console.log(`Skipping sheet: ${title} - Semantic version not found.`); @@ -203,9 +202,9 @@ async function getActiveReleases(documentId) { // Filter out null values (sheets that were skipped) and resolve all promises const results = await Promise.all(promises); return results.filter((result) => result !== null); - } catch (err) { - console.error('Failed to retrieve spreadsheet data:', err); - throw err; + } catch (error) { + console.error('Failed to retrieve spreadsheet data:', error); + throw error; } } @@ -228,9 +227,9 @@ async function readSheetData(spreadsheetId, sheetName, cellRange) { }); return result.data.values; - } catch (err) { - console.error('Failed to read data from the sheet:', err); - throw err; + } catch (error) { + console.error('Failed to read data from the sheet:', error); + throw error; } } @@ -258,7 +257,7 @@ async function getReleaseBlockers(release, team) { const { data } = await octokit.rest.issues.listForRepo({ owner, repo, - labels: labels, + labels, state: 'open', // Optionally, filter by state (open, closed, all) }); @@ -280,20 +279,20 @@ async function getReleaseBlockers(release, team) { /** * Determine the Slack channel name to publish to based on the release - * @param {*} release + * @param {*} release - The release entry to publish. + * @returns {Promise} The Slack channel name to publish to. */ async function getPublishChannelName(release) { // convert the version to a format that can be used in a channel name - const formattedVersion = release.SemanticVersion.replace(/\./g, '-'); + const formattedVersion = release.SemanticVersion.replace(/\./gu, '-'); const channel = `#release-${release.Platform}-${formattedVersion}`; // Allows for local testing without publishing actual release channels if (testOnly()) { return `${channel}-testonly`; - } else { - return channel; } + return channel; } async function fmtSlackHandle(team) { @@ -337,11 +336,11 @@ async function publishReleaseTestingStatus(release) { `Publishing testing status for release ${release.SemanticVersion} on platform ${release.Platform} to channel ${channel}`, ); - var header = + let header = `:blablablocker:* [${fmtPlatform}] - ${release.SemanticVersion} Release Validation.*\n` + `_*Testing Plan and Progress Tracker Summary*_ ():`; - var body = `*Teams Sign Off ${release.SemanticVersion} Release on <${releasePrUrl}|GH>:*\n`; + let body = `*Teams Sign Off ${release.SemanticVersion} Release on <${releasePrUrl}|GH>:*\n`; const hasPendingSignoffs = teamResults.some( (team) => team.status !== 'Completed', @@ -350,12 +349,12 @@ async function publishReleaseTestingStatus(release) { let releaseBlockerCount = 0; for (const team of teamResults) { - let slackHandlePart = await fmtSlackHandle(team); + const slackHandlePart = await fmtSlackHandle(team); //Grab RCs for a specific team/release const releaseBlockers = await getReleaseBlockers(release, team.team); //Accumulate the total release blocker count releaseBlockerCount += releaseBlockers.count; - let releaseBlockerParts = + const releaseBlockerParts = releaseBlockers.count > 0 ? ` - <${releaseBlockers.url}|${releaseBlockers.count} Release Blockers>` : ''; @@ -373,7 +372,7 @@ async function publishReleaseTestingStatus(release) { try { await slackClient.chat.postMessage({ - channel: channel, + channel, text: slackMessage, unfurl_links: false, unfurl_media: false, @@ -458,7 +457,3 @@ function formatTitle(val) { function testOnly() { return process.env.TEST_ONLY === 'true'; } - -function createSheetUrl(documentId, sheetId) { - return `https://docs.google.com/spreadsheets/d/${documentId}/edit#gid=${sheetId}`; -} diff --git a/.github/scripts/stable-sync.js b/.github/scripts/stable-sync.js index 8794f555..ed504dfa 100644 --- a/.github/scripts/stable-sync.js +++ b/.github/scripts/stable-sync.js @@ -1,5 +1,4 @@ #!/usr/bin/env node - // USAGE: // This will create/update a local stable-sync branch // and get it in the state needed for a stable-sync PR diff --git a/.github/scripts/update-release-sheet.mjs b/.github/scripts/update-release-sheet.mjs index c22f734c..951450c1 100644 --- a/.github/scripts/update-release-sheet.mjs +++ b/.github/scripts/update-release-sheet.mjs @@ -1,4 +1,3 @@ -import { parse } from 'csv-parse/sync'; import fs from 'fs'; import { google } from 'googleapis'; @@ -28,7 +27,7 @@ async function getGoogleAuth() { // Initialize GoogleAuth with credentials object directly const auth = new google.auth.GoogleAuth({ - credentials: credentials, + credentials, scopes: ['https://www.googleapis.com/auth/spreadsheets'], }); @@ -43,6 +42,7 @@ async function getGoogleAuth() { * @param {string} platform - The platform for which the release is being prepared. * @param {string} semanticVersion - The semantic version of the release. * @param {number} templateSheetId - The sheet ID of the template to be duplicated. + * @param {Array>} sheetData - The rows of data to write into the new sheet. * @returns {Promise} A promise that resolves when the sheet has been created and modified. */ async function createReleaseSheet( @@ -82,7 +82,7 @@ async function createReleaseSheet( console.log(`Sheet duplicated successfully. New sheet ID: ${newSheetId}`); // Step 2. Make the new sheet the active sheet - const sheetActivationResponse = await sheets.spreadsheets.batchUpdate({ + await sheets.spreadsheets.batchUpdate({ spreadsheetId: documentId, resource: { requests: [ @@ -158,9 +158,9 @@ async function getTotalSheetCount(documentId) { } return sheetsData.length; - } catch (err) { - console.error('Failed to retrieve spreadsheet data:', err); - throw err; + } catch (error) { + console.error('Failed to retrieve spreadsheet data:', error); + throw error; } } @@ -197,8 +197,8 @@ async function getAllReleases(documentId) { // Create a list of promises for each sheet using map const promises = sheetsData.map(async (sheet) => { const { title } = sheet.properties; - const versionMatch = title.match(/v(\d+\.\d+\.\d+)/); - const platformMatch = title.match(/\(([^)]+)\)/); + const versionMatch = title.match(/v(\d+\.\d+\.\d+)/u); + const platformMatch = title.match(/\(([^)]+)\)/u); if (!versionMatch) { console.log( @@ -219,9 +219,9 @@ async function getAllReleases(documentId) { // Filter out null values (sheets that were skipped) and resolve all promises const results = await Promise.all(promises); return results.filter((result) => result !== null); - } catch (err) { - console.error('Failed to retrieve spreadsheet data:', err); - throw err; + } catch (error) { + console.error('Failed to retrieve spreadsheet data:', error); + throw error; } } @@ -281,7 +281,7 @@ async function main() { const releases = await getAllReleases(documentId); - var sheetExists = false; + let sheetExists = false; releases.forEach((release) => { console.log( @@ -341,8 +341,8 @@ function parseCSVv2(filePath) { // Regex patterns to exclude certain commit messages // Regex patterns to exclude certain commit messages const excludedCommitRegex = [ - /cherry-pick/, // Matches any occurrence of "cherry-pick" - /cp-\d+\.\d+\.\d+/, // Matches patterns like "cp-1.0.0" + /cherry-pick/u, // Matches any occurrence of "cherry-pick" + /cp-\d+\.\d+\.\d+/u, // Matches patterns like "cp-1.0.0" ]; try { @@ -358,7 +358,9 @@ function parseCSVv2(filePath) { // Start from the second line to skip headers for (let i = 1; i < lines.length; i++) { - if (lines[i].trim() === '') continue; // Skip empty lines + if (lines[i].trim() === '') { + continue; + } // Skip empty lines // Split the line into columns based on commas const columns = lines[i].split(','); diff --git a/oxlint-suppressions.json b/oxlint-suppressions.json index 61224d9f..828f2768 100644 --- a/oxlint-suppressions.json +++ b/oxlint-suppressions.json @@ -7,30 +7,6 @@ "count": 12 } }, - ".github/actions/playwright-test-health-report/lib/classify-report-buckets.mjs": { - "prefer-const": { - "count": 4 - } - }, - ".github/actions/playwright-test-health-report/lib/normalize-repo-file-path.mjs": { - "jsdoc/require-param-description": { - "count": 2 - }, - "jsdoc/require-returns-description": { - "count": 1 - }, - "require-unicode-regexp": { - "count": 9 - } - }, - ".github/actions/playwright-test-health-report/lib/slack-test-health-blocks.mjs": { - "no-useless-escape": { - "count": 1 - }, - "require-unicode-regexp": { - "count": 3 - } - }, ".github/scripts/clean-release-changelog.mts": { "node/no-process-env": { "count": 3 @@ -46,64 +22,25 @@ } }, ".github/scripts/create-flaky-test-report.mjs": { - "curly": { - "count": 1 - }, "n/hashbang": { "count": 1 }, - "no-unused-vars": { - "count": 1 - }, "node/no-process-env": { "count": 11 - }, - "object-shorthand": { - "count": 4 - }, - "prefer-template": { - "count": 5 - }, - "radix": { - "count": 1 - }, - "require-unicode-regexp": { - "count": 4 } }, ".github/scripts/generate-rc-commits.mjs": { - "curly": { - "count": 4 - }, "import/no-named-as-default": { "count": 1 }, - "no-shadow": { - "count": 1 - }, - "no-sparse-arrays": { - "count": 1 - }, - "no-unused-vars": { - "count": 1 - }, - "no-var": { - "count": 1 - }, "node/no-process-env": { "count": 2 }, "node/no-sync": { "count": 1 }, - "require-unicode-regexp": { - "count": 2 - }, "unicorn/no-process-exit": { "count": 2 - }, - "unicorn/no-useless-undefined": { - "count": 3 } }, ".github/scripts/merge-previous-release-changelog.mts": { @@ -159,9 +96,6 @@ } }, ".github/scripts/post-relay-subsidy-balance.mjs": { - "id-length": { - "count": 2 - }, "import/unambiguous": { "count": 1 }, @@ -233,38 +167,8 @@ } }, ".github/scripts/slack-release-testing.mjs": { - "id-denylist": { - "count": 4 - }, - "jsdoc/require-param-description": { - "count": 1 - }, - "jsdoc/require-returns": { - "count": 1 - }, - "no-else-return": { - "count": 2 - }, - "no-unused-vars": { - "count": 2 - }, - "no-var": { - "count": 2 - }, "node/no-process-env": { "count": 6 - }, - "object-shorthand": { - "count": 3 - }, - "prefer-const": { - "count": 2 - }, - "radix": { - "count": 2 - }, - "require-unicode-regexp": { - "count": 4 } }, ".github/scripts/stable-sync.js": { @@ -298,33 +202,12 @@ } }, ".github/scripts/update-release-sheet.mjs": { - "curly": { - "count": 1 - }, - "id-denylist": { - "count": 4 - }, - "jsdoc/require-param": { - "count": 1 - }, - "no-unused-vars": { - "count": 2 - }, - "no-var": { - "count": 1 - }, "node/no-process-env": { "count": 1 }, "node/no-sync": { "count": 1 }, - "object-shorthand": { - "count": 1 - }, - "require-unicode-regexp": { - "count": 4 - }, "unicorn/no-process-exit": { "count": 1 } diff --git a/package.json b/package.json index ab309874..557e7833 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "@slack/webhook": "^7.0.6", "@types/luxon": "^3.3.0", "axios": "^0.24.0", - "csv-parse": "5.6.0", "execa": "^9.5.2", "googleapis": "144.0.0", "luxon": "^3.3.0", diff --git a/vitest.config.mts b/vitest.config.mts index 33b3ca06..e3728aeb 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -49,10 +49,10 @@ export default defineConfig({ thresholds: { // Raises the thresholds in this file when coverage improves. autoUpdate: true, - branches: 41.72, - functions: 50.63, - lines: 41.61, - statements: 41.5, + branches: 41.81, + functions: 50.79, + lines: 41.63, + statements: 41.57, }, }, }, diff --git a/yarn.lock b/yarn.lock index 62cad97b..b177d8b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -311,7 +311,6 @@ __metadata: "@vitest/coverage-v8": "npm:^5.1.0" "@yarnpkg/types": "npm:^4.0.0" axios: "npm:^0.24.0" - csv-parse: "npm:5.6.0" eslint-plugin-n: "npm:^18.5.0" execa: "npm:^9.5.2" googleapis: "npm:144.0.0" @@ -2364,13 +2363,6 @@ __metadata: languageName: node linkType: hard -"csv-parse@npm:5.6.0": - version: 5.6.0 - resolution: "csv-parse@npm:5.6.0" - checksum: 10/4c82e11f50ae0ccbac2aed716ef2502d0468bf96552083561db789fc0258ee4bb0a30106fcfb2684f153cb4042f0413e0eac3645d5466874803b7ccdeba67ac8 - languageName: node - linkType: hard - "debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5": version: 4.4.0 resolution: "debug@npm:4.4.0" From af3e0455bffbc9a75a42cb6f256ec37fbd415c4f Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Tue, 17 Nov 2026 15:19:02 +0100 Subject: [PATCH 2/3] chore: restore the package version that the merge overwrote --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 557e7833..57103e23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/github-tools", - "version": "1.25.0", + "version": "1.26.0", "private": true, "description": "Tools for interacting with the GitHub API to do metrics gathering", "repository": { From 7276e88d6957e5fb6f7a801a0b0e9534ebc92a7d Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Wed, 18 Nov 2026 09:17:57 +0100 Subject: [PATCH 3/3] chore: move the skip empty lines comment above the if --- .github/scripts/update-release-sheet.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/scripts/update-release-sheet.mjs b/.github/scripts/update-release-sheet.mjs index 951450c1..23ccc7e8 100644 --- a/.github/scripts/update-release-sheet.mjs +++ b/.github/scripts/update-release-sheet.mjs @@ -358,9 +358,10 @@ function parseCSVv2(filePath) { // Start from the second line to skip headers for (let i = 1; i < lines.length; i++) { + // Skip empty lines if (lines[i].trim() === '') { continue; - } // Skip empty lines + } // Split the line into columns based on commas const columns = lines[i].split(',');