Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
max-files-changed: 100

needs translations:
- changed-files:
- any-glob-to-any-file: ['**/intl/*.json']
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/weekly-excel-sheet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
60 changes: 50 additions & 10 deletions scripts/getCommitsForTesting.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -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];
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -300,6 +339,7 @@ let validLabels = new Set([
'IllustratedMessage',
'Image',
'InlineAlert',
'LabeledValue',
'Link',
'LinkButton',
'ListBox',
Expand Down
1 change: 0 additions & 1 deletion scripts/sendWeeklyExcelSheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading