Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
df393b4
using graphQL
vedansh-5 Jun 22, 2025
baa434e
dummy commit 1
vedansh-5 Jun 22, 2025
60fdf3e
dummy commit 2
vedansh-5 Jun 22, 2025
733f042
added forceGithubDataRefresh function
vedansh-5 Jun 22, 2025
bafecf4
commit formatting
vedansh-5 Jun 22, 2025
94302db
checkbox in UI
vedansh-5 Jun 22, 2025
9b1dfcb
fixed the public to authenticated vulnerability
vedansh-5 Jun 25, 2025
6102295
Merge branch 'master' into commits
vedansh-5 Jun 26, 2025
499cfc8
added missed calls during rebase
vedansh-5 Jun 26, 2025
4303dc8
taking inputs from user for number of commits
vedansh-5 Jun 26, 2025
92cea91
re-rendering on nnumber of commits change
vedansh-5 Jun 26, 2025
191ce7a
Merge branch 'master' into commits
vedansh-5 Jun 26, 2025
fac353b
removed the bug causing calls
vedansh-5 Jun 26, 2025
90681a7
changed commit input size
vedansh-5 Jun 27, 2025
323ca7a
removed username from commit list
vedansh-5 Jun 27, 2025
1250768
Merge branch 'master' into commits
vedansh-5 Jun 27, 2025
b1bd7c1
async function writeGithubIssues()
vedansh-5 Jun 27, 2025
82a82da
post merge changes
vedansh-5 Jun 27, 2025
ef8f56e
removed duplicacy interval
vedansh-5 Jun 29, 2025
385d745
finetuned intervals
vedansh-5 Jun 29, 2025
22f3c16
commit fetching outside dateScope
vedansh-5 Jun 29, 2025
3226c3b
removed commits input, using date scope for displaying commits
vedansh-5 Jun 30, 2025
aa0dcd1
existing PR
vedansh-5 Jun 30, 2025
d0d45be
custom date
vedansh-5 Jul 1, 2025
e323273
dateBUg
vedansh-5 Jul 2, 2025
65d07f8
Merge branch 'master' into commits
vedansh-5 Jul 2, 2025
e44d0fb
interval race cond
vedansh-5 Jul 3, 2025
3b6164c
commits only for exisiting PRs
vedansh-5 Jul 3, 2025
a9fd5ac
Delete scrumHelperDummy.js
vedansh-5 Jul 4, 2025
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
78 changes: 77 additions & 1 deletion src/scripts/scrumHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,21 @@ function allIncluded(outputTarget = 'email') {
githubPrsReviewData = await prRes.json();
githubUserData = await userRes.json();

if (githubIssuesData && githubIssuesData.items) {
// Collect open PRs
const openPRs = githubIssuesData.items.filter(
item => item.pull_request && item.state === 'open'
);
// Fetch commits for open PRs (batch)
if (openPRs.length && githubToken) {
const commitMap = await fetchCommitsForOpenPRs(openPRs, githubToken);
// Attach commits to PR objects
openPRs.forEach(pr => {
pr._lastCommits = commitMap[pr.number] || [];
});
}
}

// Cache the data
githubCache.data = { githubIssuesData, githubPrsReviewData, githubUserData };
githubCache.timestamp = Date.now();
Expand Down Expand Up @@ -411,6 +426,53 @@ function allIncluded(outputTarget = 'email') {
}
}

async function fetchCommitsForOpenPRs(prs, githubToken) {
if (!prs.length) return {};
let queries = prs.map((pr,idx) => {
const repoParts = pr.repository_url.split('/');
const owner = repoParts[repoParts.length - 2];
const repo = repoParts[repoParts.length - 1];
return `
pr${idx}: repository(owner: "${owner}", name: "${repo}") {
pullRequest(number: ${pr.number}) {
commits(last: 5) {
nodes {
commit {
messageHeadline
committedDate
url
author {
name
user { login }
}
}
}
}
}
}
`;
}).join('\n');
const query = `query { ${queries} }`;

const res = await fetch('https://api.github.com/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
...(githubToken ? {Authorization: `bearer ${githubToken}`} : {})
},
body: JSON.stringify({ query })
});
const data = await res.json();
let commitMap = {};
prs.forEach((pr, idx) => {
const prData = data.data && data.data[`pr${idx}`] && data.data[`pr${idx}`].pullRequest;
if (prData && prData.commits && prData.commits.nodes) {
commitMap[pr.number] = prData.commits.nodes.map(n => n.commit);
}
});
return commitMap;
}

async function verifyCacheStatus() {
log('Cache Status: ', {
hasCachedData: !!githubCache.data,
Expand Down Expand Up @@ -469,6 +531,8 @@ function allIncluded(outputTarget = 'email') {
if(!githubCache.subject && scrumSubject) {
scrumSubjectLoaded();
}
writeGithubIssuesPrs();
writeGithubPrsReviews();
}

function formatDate(dateString) {
Expand Down Expand Up @@ -706,7 +770,19 @@ ${userReason}`;
if (item.state === 'closed') {
li = `<li><i>(${project})</i> - Made PR (#${number}) - <a href='${html_url}'>${title}</a> ${pr_merged_button}</li>`;
} else if (item.state === 'open') {
li = `<li><i>(${project})</i> - Made PR (#${number}) - <a href='${html_url}'>${title}</a> ${pr_unmerged_button}</li>`;
li = `<li><i>(${project})</i> - Made PR (#${number}) - <a href='${html_url}'>${title}</a> ${pr_unmerged_button}`;
// ADD THIS BLOCK:
if (item._lastCommits && item._lastCommits.length) {
li += `<ul>`;
item._lastCommits.forEach(commit => {
li += `<li>
<a href="${commit.url}" target="_blank">${commit.messageHeadline}</a>
<span style="color:#888;font-size:11px;"> (${commit.author?.user?.login || commit.author?.name || 'unknown'}, ${new Date(commit.committedDate).toLocaleString()})</span>
</li>`;
});
li += `</ul>`;
}
li += `</li>`;
}
} else {
// is a issue
Expand Down