Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

About setup with daysUntilClose greater than daysUntilStale #224

Closed
trivikr opened this issue Jul 29, 2019 · 3 comments
Closed

About setup with daysUntilClose greater than daysUntilStale #224

trivikr opened this issue Jul 29, 2019 · 3 comments
Labels

Comments

@trivikr
Copy link

trivikr commented Jul 29, 2019

Hi,

We are discussing using Stale bot in Node.js core repository in nodejs/node#28798

While going through the code of Stale bot it appears that the set up with daysUntilClose>daysUntilStale will not close issues as stale bot will keep commenting every daysUntilStale of inactivity and issues will never reach daysUntilClose of inactivity

query = `repo:${owner}/${repo} is:open updated:<${timestamp} ${query}`

Is there a way to ignore comments from stale bot while counting daysUntilClose of inactivity?

Regards,
Trivikram

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label question to this issue, with a confidence of 0.67. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@trivikr
Copy link
Author

trivikr commented Jul 29, 2019

Looks like my assumption was incorrect. The stale bot will not comment on issues with stale label as per code

stale/lib/stale.js

Lines 66 to 75 in e3c53eb

const onlyLabels = this.getConfigValue(type, 'onlyLabels')
const staleLabel = this.getConfigValue(type, 'staleLabel')
const exemptLabels = this.getConfigValue(type, 'exemptLabels')
const exemptProjects = this.getConfigValue(type, 'exemptProjects')
const exemptMilestones = this.getConfigValue(type, 'exemptMilestones')
const exemptAssignees = this.getConfigValue(type, 'exemptAssignees')
const labels = [staleLabel].concat(exemptLabels)
const queryParts = labels.map(label => `-label:"${label}"`)
queryParts.concat(onlyLabels.map(label => `label:"${label}"`))
queryParts.push(Stale.getQueryTypeRestriction(type))

Stale bot removes staleLabel when any activity (outside of stalebot happens) in

stale/index.js

Lines 23 to 45 in e3c53eb

async function unmark (context) {
if (!context.isBot) {
const stale = await forRepository(context)
let issue = context.payload.issue || context.payload.pull_request
const type = context.payload.issue ? 'issues' : 'pulls'
// Some payloads don't include labels
if (!issue.labels) {
try {
issue = (await context.github.issues.get(context.issue())).data
} catch (error) {
context.log('Issue not found')
}
}
const staleLabelAdded = context.payload.action === 'labeled' &&
context.payload.label.name === stale.config.staleLabel
if (stale.hasStaleLabel(type, issue) && issue.state !== 'closed' && !staleLabelAdded) {
stale.unmarkIssue(type, issue)
}
}
}

Closing this issue, will continue this discussing our requirements in nodejs/node#28798 and reopen/create new one if required

@trivikr trivikr closed this as completed Jul 29, 2019
@trivikr
Copy link
Author

trivikr commented Jul 29, 2019

New feature request created at #225

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant