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

onlyLabels not working #207

Closed
takose opened this issue Jun 4, 2019 · 14 comments · Fixed by #213
Closed

onlyLabels not working #207

takose opened this issue Jun 4, 2019 · 14 comments · Fixed by #213
Labels

Comments

@takose
Copy link
Contributor

takose commented Jun 4, 2019

Hi 👋

I tried to introduce stale bot to comment stale issues which has specific label, but stale bot has marked all issues. Can you take a look and let me know if something is not configured correctly?

Here is test repository.
https://github.com/takose/stalebot-test

stale.yml

# Configuration for probot-stale - https://github.com/probot/stale

# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 1

# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels: []

# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels:
  - TestLavbel

# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: false

# Label to use when marking as stale
staleLabel: wontfix

# Comment to post when marking as stale. Set to `false` to disable
markComment: >
  Please check progress.

Thanks.

@issue-label-bot issue-label-bot bot added the bug label Jun 4, 2019
@issue-label-bot
Copy link

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

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

@Gustry
Copy link

Gustry commented Jun 7, 2019

Same for me. Stale bot just marked all issues of my repository with stale 5 minutes, while I got only 2 issues with the label candidate for closing.

Link to my stale.yml: https://github.com/3liz/QuickOSM/blob/master/.github/stale.yml#L12

# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels:
  - "candidate for closing"

Unfortunately, if no solution is found, I will have to disable stalebot because I don't want it to close all my issues.

GitHub
QGIS plugin to fetch OSM data with the Overpass API - 3liz/QuickOSM

@kesselb
Copy link

kesselb commented Jun 7, 2019

Looks like labels are always wrapped in quotes. Mind to try candidate for closing without quotes? The yaml validator does not complain about missing quotes.

stale/lib/stale.js

Lines 73 to 74 in e3c53eb

const queryParts = labels.map(label => `-label:"${label}"`)
queryParts.concat(onlyLabels.map(label => `label:"${label}"`))

@Gustry
Copy link

Gustry commented Jun 8, 2019

No, it is still not working without quotes, look at this issue: 3liz/QuickOSM#167 (comment) It's tagged stale a few minutes ago without the label candidate for closing.

I made the following change to stalebot 3liz/QuickOSM@32762e9

Thanks

@skjnldsv
Copy link

skjnldsv commented Jun 8, 2019

Yep, probot is using js-yaml.
https://nodeca.github.io/js-yaml/

And quote or no quote does not make a difference in the parsing at all.
https://github.com/probot/probot-config/blob/master/lib/index.js#L24

Any help? @probot @tcbyrd ?

Live example of YAML JavaScript parser right in your browser. Type your YAML code and see result.
GitHub
A Probot extension to easily share configs between repositories. - probot/probot-config

@takose
Copy link
Contributor Author

takose commented Jun 12, 2019

I sent PR to fix this 😜
#213

@antelle
Copy link

antelle commented Sep 9, 2019

Hi! Just came across the same issue, the bot closed several issues by mistake, which caused some confusion. I see that the pull request is very straightforward, can this please be merged 🙏? Not good to have it in production. Very sorry for the bump, but looks like it's somewhat forgotten, while the fix is already here.

@skjnldsv
Copy link

@antelle you better run your own stale bot, there is not much activity here :(
Fork it and merge the pending pr #213

I'm running it via docke-compose

version: '2'
services:
  stalebot:
    image: skjnldsv/stale:latest 
    restart: always
    ports:
      - 3000:3000
    environment:
      - APP_ID=12345
      - WEBHOOK_SECRET=123456789123456789123456789
      # - LOG_LEVEL=debug
      - PRIVATE_KEY_PATH=/app/private-key.pem
    volumes:
      - ./private-key.pem:/app/private-key.pem:ro

@antelle
Copy link

antelle commented Sep 10, 2019

@skjnldsv I do see some activity, for example some PR's were merged a week ago: https://github.com/probot/stale/pulls?q=is%3Apr+is%3Aclosed

GitHub
A GitHub App built with Probot that closes abandoned Issues and Pull Requests after a period of inactivity. - probot/stale

@skjnldsv
Copy link

Yep, simple prs, like ci, dependencies or default config messages. :/

@Gustry
Copy link

Gustry commented Sep 10, 2019

FYI, there is now a builtin feature in Github for stale issues. It's called Action.
https://github.com/actions/stale

GitHub
Marks issues and pull requests that have not had recent interaction - actions/stale

@skjnldsv
Copy link

Thanks @Gustry !!

@antelle
Copy link

antelle commented Sep 10, 2019

@Gustry thanks a lot! So, it's time to switch to it now.

@takose
Copy link
Contributor Author

takose commented Sep 11, 2019

FYI, there is now a builtin feature in Github for stale issues. It's called Action.

It doesn't seem to have onlyLabels option.. 👀

I forked and tried to add onlyLabels option.(However it doesn't work as expected..)
https://github.com/takose/stale-1

GitHub
Marks issues and pull requests that have not had recent interaction - takose/stale-1

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

Successfully merging a pull request may close this issue.

5 participants