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: 1 addition & 1 deletion tools/@aws-cdk/project-sync/lib/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class Github {
query {
repository(owner: "${REPOSITORY_OWNER}", name: "${REPOSITORY}") {
projectV2(number: ${project}) {
items(first: 100 ${cursor ? `, after: "${cursor}"` : ''}) {
items(first: 50 ${cursor ? `, after: "${cursor}"` : ''}) {
Copy link
Member

@ozelalisen ozelalisen Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why this is decreased to 50?

Copy link
Member Author

@Abogical Abogical Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To prevent throttling issues.

pageInfo {
hasNextPage
endCursor
Expand Down
4 changes: 2 additions & 2 deletions tools/@aws-cdk/project-sync/lib/issue-sync.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Github } from './github.js';
import { PROJECT_NUMBER, REPOSITORY } from './config.js';
import { projectIds, getPriorityFromLabels } from './utils.js';
import { projectIds, getPriorityFromLabels, isBotLogin } from './utils.js';

export const syncIssue = async (issue: string) => {
const github = Github.default();
Expand Down Expand Up @@ -49,7 +49,7 @@ export const syncIssueData = async (issueDetails: any) => {

for (let index = 0; index < timelineItems.length; index++) {
const item = timelineItems[timelineItems.length-index-1];
if (item?.createdAt !== undefined && item.author?.login !== 'github-actions' && item.actor?.login !== 'github-actions') {
if (item?.createdAt !== undefined && !isBotLogin(item.author?.login) && !isBotLogin(item.actor?.login)) {
updateDate = new Date(item.createdAt);
break;
}
Expand Down
5 changes: 3 additions & 2 deletions tools/@aws-cdk/project-sync/lib/pr-sync.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Github } from './github.js';
import { PROJECT_NUMBER, REPOSITORY } from './config.js';
import { projectIds, getPriorityFromLabels } from './utils.js';
import { projectIds, getPriorityFromLabels, isBotLogin } from './utils.js';

export const syncPr = async (pr: string) => {
const github = Github.default();
Expand Down Expand Up @@ -49,7 +49,8 @@ export const syncPrData = async (prDetails: any) => {

for (let index = 0; index < timelineItems.length; index++) {
const item = timelineItems[timelineItems.length-index-1];
if (item?.createdAt !== undefined && item.author?.login !== 'github-actions' && item.actor?.login !== 'github-actions' && item.commit?.author?.user?.login !== 'github-actions') {
if (item?.createdAt !== undefined && !isBotLogin(item.author?.login)
&& !isBotLogin(item.actor?.login) && !isBotLogin(item.commit?.author?.user?.login) ) {
updateDate = new Date(item.createdAt ?? item.commit.committedDate);
break;
}
Expand Down
7 changes: 7 additions & 0 deletions tools/@aws-cdk/project-sync/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,10 @@ export const getPriorityFromLabels = (labels: any[], priorityField: { options: R
}
return undefined;
};

const botLogins = new Set([
'github-actions',
'related-issues-bot-for-aws',
]);

export const isBotLogin = (login: string) => botLogins.has(login);
Loading