Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] prevent lock-threads from locking issues with label 'feature request' #6047

Merged
merged 1 commit into from
Aug 19, 2023

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Aug 17, 2023

#6037 reintroduced a bot for locking discussion on long-inactive closed PRs and issues, to encourage discussions to stay in highly-visible places.

This PR fixes two bugs in that configuration:

  • ensures that bot-posted comments have correct text wrapping
  • ensures that issues with the label feature request are not locked
    • since we close such issues, link to them from Feature Requests & Voting Hub #2302, and encourage contributors to comment on them if they want to re-open the discussion and work on them

Text wrapping

What the bot currently produces:

image

What I want it to look like:

image

Notice that there isn't an unnecessary line break after the link to the issues page. That'll make the text look a bit better when screens are resized.

To learn how switching from | to > in the configuration achieves that, see https://yaml-multiline.info/.

feature request label

As described in #6037 (comment), the bot is locking some issues with label feature request, e.g. #3200 (comment).

Looks to me like lock-threads requires that labels passed into its exclude-any-issue-labels configuration be double-quoted if they contain spaces.

That's because that feature works by directly appending a -label: search body using GitHub's code search API (docs):

https://github.com/dessant/lock-threads/blob/be8aa5be94131386884a6da4189effda9b14aa21/src/index.js#L143-L146

query += ` -label:${excludeAnyLabels.join(',')}`;

I tested this in the GitHub UI, and can see the effect.

Screen Shot 2023-08-17 at 5 59 26 PM

https://github.com/microsoft/LightGBM/issues?q=is%3Aissue+is%3Aclosed+-label%3Afeature+request

With quoting around that label, the search matches the expected issues.

Screen Shot 2023-08-17 at 6 02 29 PM

https://github.com/microsoft/LightGBM/issues?q=is%3Aissue+is%3Aclosed+-label%3A%22feature+request%22

Thanks to this comment from @alessbell for the hint: dessant/lock-threads#40 (comment).

Notes for Reviewers

I've manually unlocked all of the closed issues with label feature request that were incorrectly locked after merging #6037.

@jameslamb jameslamb changed the title WIP: [ci] prevent lock-threads from locking issues with label 'feature request' [ci] prevent lock-threads from locking issues with label 'feature request' Aug 17, 2023
@jameslamb jameslamb marked this pull request as ready for review August 17, 2023 23:56
@jameslamb
Copy link
Collaborator Author

Thanks @jmoralez ! I'm gonna merge this and test by manually triggering a run. Will report back here.

@jameslamb jameslamb merged commit aafdf74 into master Aug 19, 2023
@jameslamb jameslamb deleted the ci/lockbot-fixes branch August 19, 2023 02:55
@jameslamb
Copy link
Collaborator Author

✅ looks like this did fix the text wrapping on the comment!

example: #5448 (comment)

image

@jameslamb
Copy link
Collaborator Author

✅ it's still successfully locking a mix of issues and PRs

issue example: #5663

PR example: #5621

@jameslamb
Copy link
Collaborator Author

✅ it's not locking issues with label feature request any more

I triggered 4 runs tonight that locked 400 issues/PRs. 0 issues with feature request were closed.

So I think this is working!

I'll stop triggering runs for now. This will run once a week (every Wednesday at midnight UTC) and close up to 100 issues. I'm not exactly sure how many it still needs to work through. Hopefully in a few weeks it'll be caught up, and then the runs will only be closing a few issues (and therefore only generating a few notifications) each time.

Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants