Skip to content
Merged
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
17 changes: 16 additions & 1 deletion .github/scripts/generate-rc-commits.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ async function getTeam(repository, prNumber) {

// Step 4: Return the team name or 'Unknown' if not found
return team || 'Unknown';

} catch (error) {
console.error(
`Error fetching team for PR #${prNumber}:`,
Expand All @@ -59,6 +60,8 @@ async function getTeam(repository, prNumber) {

// Function to filter commits based on unique commit messages and group by teams
async function filterCommitsByTeam(platform, branchA, branchB) {

const MAX_COMMITS = 500; // Limit the number of commits to process
console.log('Filtering commits by team...');

var repository = '';
Expand Down Expand Up @@ -89,9 +92,13 @@ async function filterCommitsByTeam(platform, branchA, branchB) {
};

const log = await git.log(logOptions);

console.log(`Total commits between ${branchA} and ${branchB}: ${log.total}`);
console.log(`Processing up to ${Math.min(log.all.length, MAX_COMMITS)} commits...`);

const commitsByTeam = {};

const MAX_COMMITS = 500; // Limit the number of commits to process


for (const commit of log.all) {
const { author, message, hash } = commit;
Expand Down Expand Up @@ -121,7 +128,15 @@ async function filterCommitsByTeam(platform, branchA, branchB) {
});
}
}

// Count total processed commits after the loop
const totalProcessed = Object.values(commitsByTeam)
.reduce((sum, commits) => sum + commits.length, 0);

console.log(`Total commits eligible for commits.csv : ${totalProcessed}`);

return commitsByTeam;

} catch (error) {
console.error(error);
return {};
Expand Down
Loading