Skip to content

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

Merged
jameslamb merged 1 commit into
masterfrom
ci/lockbot-fixes
Aug 19, 2023
Merged

jameslamb merged 1 commit into
masterfrom
ci/lockbot-fixes

Conversation

@jameslamb

@jameslamb jameslamb commented Aug 17, 2023 •

Copy link
Copy Markdown
Member

#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

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
Copy Markdown
Member 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
Copy Markdown
Member Author

βœ… looks like this did fix the text wrapping on the comment!

example: #5448 (comment)

image

@jameslamb

Copy link
Copy Markdown
Member Author

βœ… it's still successfully locking a mix of issues and PRs

issue example: #5663

PR example: #5621

@jameslamb

Copy link
Copy Markdown
Member 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.

@github-actions

Copy link
Copy Markdown
Contributor

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