merge
This commit is contained in:
Коммит
b5416843c3
|
@ -22,7 +22,7 @@ module.exports = function (context) {
|
|||
];
|
||||
var issuesToCheck = issues
|
||||
.filter(function (issue) {
|
||||
return (!issue.milestone || issue.milestone.number <= currentMilestone.number);
|
||||
return (!issue.milestone || issue.milestone.number == currentMilestone.number || issue.milestone.state === 'CLOSED');
|
||||
})
|
||||
.filter(function (issue) {
|
||||
return !functions_1.containsExclusiveLabels(issue, exclusiveLabels);
|
||||
|
@ -30,7 +30,7 @@ module.exports = function (context) {
|
|||
var issuesInTheCurrentMilestone = issuesToCheck
|
||||
.filter(function (issue) { return issue.milestone && issue.milestone.number === currentMilestone.number; });
|
||||
var issuesNotInMilestone = issuesToCheck
|
||||
.filter(function (issue) { return !issue.milestone || issue.milestone.number < currentMilestone.number; });
|
||||
.filter(function (issue) { return !issue.milestone || issue.milestone.state === 'CLOSED'; });
|
||||
var numberOfDaysWithoutActivity = parseInt(process.env.NUMBER_OF_DAYS_WITHOUT_ACTIVITY || '7');
|
||||
var inactiveIssuesInTheCurrentMilestone = issuesInTheCurrentMilestone.filter(function (issue) {
|
||||
return detectIssueWithoutActivity(issue, numberOfDaysWithoutActivity * 2);
|
||||
|
|
|
@ -33,11 +33,11 @@ module.exports = (context) => {
|
|||
'mute-bot'
|
||||
];
|
||||
|
||||
// only check issues in the current milestone or not in a milestone
|
||||
// only check issues in the current milestone or not in a milestone (or a previous milestone)
|
||||
// only check issues without exlusive labels
|
||||
const issuesToCheck = issues
|
||||
.filter(issue => {
|
||||
return (!issue.milestone || issue.milestone.number <= currentMilestone.number);
|
||||
return (!issue.milestone || issue.milestone.number == currentMilestone.number || issue.milestone.state === 'CLOSED');
|
||||
})
|
||||
.filter(issue => {
|
||||
return !containsExclusiveLabels(issue, exclusiveLabels);
|
||||
|
@ -47,7 +47,7 @@ module.exports = (context) => {
|
|||
.filter(issue => issue.milestone && issue.milestone.number === currentMilestone.number);
|
||||
|
||||
const issuesNotInMilestone = issuesToCheck
|
||||
.filter(issue => !issue.milestone || issue.milestone.number < currentMilestone.number);
|
||||
.filter(issue => !issue.milestone || issue.milestone.state === 'CLOSED');
|
||||
|
||||
const numberOfDaysWithoutActivity = parseInt(process.env.NUMBER_OF_DAYS_WITHOUT_ACTIVITY || '7');
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ var getGitHubIssuesQuery = function (repoOwner, repoName, afterCursor, labels) {
|
|||
value: labels ? JSON.stringify(labels) : null
|
||||
}
|
||||
];
|
||||
return "\n query { \n repository(owner: \"" + repoOwner + "\", name: \"" + repoName + "\") { \n issues(states: [OPEN], " + variables.filter(function (v) { return !!v; }).map(function (v) { return v.name + ": " + v.value; }).join(', ') + ") {\n pageInfo {\n hasNextPage,\n endCursor\n },\n edges {\n node {\n id,\n number,\n author {\n login\n },\n createdAt,\n comments {\n totalCount\n },\n lastComment: comments(last: 1) {\n edges {\n node {\n updatedAt\n }\n }\n },\n lastTwoComments: comments(last: 2) {\n edges {\n node {\n author {\n login\n },\n body\n }\n }\n },\n commentAuthors: comments(first: 100) {\n edges {\n node {\n author {\n login\n }\n }\n }\n },\n labels(first: 10) {\n edges {\n node {\n name\n }\n }\n },\n milestone {\n number\n }\n }\n }\n }\n }\n }";
|
||||
return "\n query { \n repository(owner: \"" + repoOwner + "\", name: \"" + repoName + "\") { \n issues(states: [OPEN], " + variables.filter(function (v) { return !!v; }).map(function (v) { return v.name + ": " + v.value; }).join(', ') + ") {\n pageInfo {\n hasNextPage,\n endCursor\n },\n edges {\n node {\n id,\n number,\n author {\n login\n },\n createdAt,\n comments {\n totalCount\n },\n lastComment: comments(last: 1) {\n edges {\n node {\n updatedAt\n }\n }\n },\n lastTwoComments: comments(last: 2) {\n edges {\n node {\n author {\n login\n },\n body\n }\n }\n },\n commentAuthors: comments(first: 100) {\n edges {\n node {\n author {\n login\n }\n }\n }\n },\n labels(first: 10) {\n edges {\n node {\n name\n }\n }\n },\n milestone {\n number,\n state\n }\n }\n }\n }\n }\n }";
|
||||
};
|
||||
exports.getPullRequest = function (headers, repoOwner, repoName, number, callback) {
|
||||
performGitHubGraphqlRequest(headers, {
|
||||
|
|
|
@ -108,7 +108,8 @@ const getGitHubIssuesQuery = (repoOwner: string, repoName: string, afterCursor?:
|
|||
}
|
||||
},
|
||||
milestone {
|
||||
number
|
||||
number,
|
||||
state
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче