diff --git a/.github/labeler.yml b/.github/labeler.yml index 2ee0b684f5f..7f780b9102c 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,3 +1,5 @@ +max-files-changed: 100 + needs translations: - changed-files: - any-glob-to-any-file: ['**/intl/*.json'] diff --git a/.github/workflows/weekly-excel-sheet.yaml b/.github/workflows/weekly-excel-sheet.yaml index e564c64e498..b1d3c77a771 100644 --- a/.github/workflows/weekly-excel-sheet.yaml +++ b/.github/workflows/weekly-excel-sheet.yaml @@ -15,8 +15,8 @@ jobs: - uses: actions/setup-node@v6 with: node-version: '24' - cache: 'npm' - - run: npm ci + cache: 'yarn' + - run: yarn install --frozen-lockfile - name: Generate and post Excel testing sheet to Slack run: node scripts/sendWeeklyExcelSheet.mjs env: diff --git a/scripts/getCommitsForTesting.mjs b/scripts/getCommitsForTesting.mjs index 7e67d70e4e6..16486faaeeb 100644 --- a/scripts/getCommitsForTesting.mjs +++ b/scripts/getCommitsForTesting.mjs @@ -43,7 +43,7 @@ async function writeTestingCSV() { } export async function generateData(startDate, endDate) { - let data = await listCommits(startDate, endDate); + let [data, openOffPRs] = await Promise.all([listCommits(startDate, endDate), listOpenOffPRs()]); // First pass: extract PR numbers from commit messages let commitsWithPRs = []; @@ -63,7 +63,33 @@ export async function generateData(startDate, endDate) { let racPRs = []; let v3PRs = []; let otherPRs = []; - let offPRs = []; + + // Off PRs are currently open PRs with the 'test off PR' label + let offPRs = openOffPRs.map(pr => { + let labels = new Set(pr.labels.map(l => l.name)); + let matches = [...validLabels].filter(name => labels.has(name)); + + let component = ''; + if (matches.length > 0) { + if (matches.includes('documentation')) { + component = 'Docs'; + } else { + component = matches.sort().join('/'); + } + } + + if (matches.length === 0) { + component = removePRNumber(pr.title); + } + + let testInstructions = extractTestInstructions(pr.body); + return [ + component, + testInstructions.length > 300 ? 'See PR for testing instructions' : testInstructions, + pr.html_url, + removePRNumber(pr.title) + ]; + }); for (let i = 0; i < commitsWithPRs.length; i++) { let {title, num} = commitsWithPRs[i]; @@ -99,15 +125,8 @@ export async function generateData(startDate, endDate) { row.push(info.data.html_url); row.push(removePRNumber(title)); - if ( - !labels.has('S2') && - !labels.has('RAC') && - !labels.has('v3') && - !labels.has('test off PR') - ) { + if (!labels.has('S2') && !labels.has('RAC') && !labels.has('v3')) { otherPRs.push(row); - } else if (labels.has('test off PR')) { - offPRs.push(row); } else { if (labels.has('S2')) { s2PRs.push(row); @@ -153,6 +172,26 @@ export async function generateCSV(startDate, endDate) { return {csv, counts}; } +async function listOpenOffPRs() { + let allPRs = []; + let page = 1; + let lastPageSize; + do { + let res = await octokit.issues.listForRepo({ + owner: 'adobe', + repo: 'react-spectrum', + state: 'open', + labels: 'test off PR', + per_page: 100, + page + }); + allPRs.push(...res.data.filter(issue => issue.pull_request)); + lastPageSize = res.data.length; + page++; + } while (lastPageSize === 100); + return allPRs; +} + async function listCommits(startDate, endDate) { let start = new Date(startDate); let end = new Date(endDate + 'T23:59:59.999Z'); @@ -300,6 +339,7 @@ let validLabels = new Set([ 'IllustratedMessage', 'Image', 'InlineAlert', + 'LabeledValue', 'Link', 'LinkButton', 'ListBox', diff --git a/scripts/sendWeeklyExcelSheet.mjs b/scripts/sendWeeklyExcelSheet.mjs index ccc35172f75..9aabee657ed 100644 --- a/scripts/sendWeeklyExcelSheet.mjs +++ b/scripts/sendWeeklyExcelSheet.mjs @@ -13,7 +13,6 @@ if (!SLACK_TESTING_BOT_TOKEN || !SLACK_CHANNEL_ID) { function getPreviousWeekRange() { let today = new Date(); let endDate = new Date(today); - endDate.setDate(today.getDate() - 1); let startDate = new Date(today); startDate.setDate(today.getDate() - 7);