fix(lock-bot): dynamically adjust lock message for issues vs pull requests#3693
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a dynamic message generator for locking closed issues and pull requests, replacing the previous static message implementation. Feedback focuses on refactoring the getLockMessage function to improve type safety by replacing the any type with a specific union type, fixing a wording regression where the 'This ' prefix was omitted, and simplifying the logic by passing the pre-calculated item type directly to the helper function.
c4edbe0 to
b1fe9b2
Compare
b1fe9b2 to
bb152b0
Compare
bb152b0 to
a5cd089
Compare
a5cd089 to
45cf9c4
Compare
Contributor
|
This PR was merged into the repository. The changes were merged into the following branches:
|
erkamyaman
added a commit
to erkamyaman/dev-infra
that referenced
this pull request
May 21, 2026
angular#3693 refactored the lock-closed action to vary its message between "issue" and "pull request" based on the conversation type. In the rewrite the leading "This" was dropped, so the bot now opens with "Issue has been automatically locked..." or "Pull request has been automatically locked..." instead of the previous "This issue has been...". The wording requested in the originating issue (angular/angular#68848) was likewise "This pull request has been automatically locked due to inactivity." for the PR variant, so the current output matches neither the pre-angular#3693 message nor the phrasing the proposal asked for. Restore the "This " prefix and use itemType as-is (already lowercase in the union) instead of upper-casing the first character. Both branches of the template now read naturally: - "This issue has been automatically locked due to inactivity." - "This pull request has been automatically locked due to inactivity."
erkamyaman
added a commit
to erkamyaman/dev-infra
that referenced
this pull request
May 21, 2026
angular#3693 dropped the leading "This " from the lock-bot message, so it now opens with "Issue has been..." or "Pull request has been..." instead of "This issue has been...". This also no longer matches the wording asked for in angular/angular#68848. Restore the "This " prefix so both branches read naturally and match the original request. Refs angular#3693, angular/angular#68848
erkamyaman
added a commit
to erkamyaman/dev-infra
that referenced
this pull request
May 21, 2026
angular#3693 dropped the leading "This " from the lock-bot message, so it now opens with "Issue has been..." or "Pull request has been..." instead of "This issue has been...". This also no longer matches the wording asked for in angular/angular#68848. Restore the "This " prefix so both branches read naturally and match the original request. Refs angular#3693, angular/angular#68848
erkamyaman
added a commit
to erkamyaman/dev-infra
that referenced
this pull request
May 21, 2026
angular#3693 dropped the leading "This " from the lock-bot message, so it now opens with "Issue has been..." or "Pull request has been..." instead of "This issue has been...". This also no longer matches the wording asked for in angular/angular#68848. Restore the "This " prefix so both branches read naturally and match the original request. Refs angular#3693, angular/angular#68848
alan-agius4
pushed a commit
that referenced
this pull request
May 21, 2026
#3693 dropped the leading "This " from the lock-bot message, so it now opens with "Issue has been..." or "Pull request has been..." instead of "This issue has been...". This also no longer matches the wording asked for in angular/angular#68848. Restore the "This " prefix so both branches read naturally and match the original request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change improves the automatic lock message generated by the Angular lock bot.
Previously, the bot always displayed:
"This issue has been automatically locked due to inactivity."
even when closing a pull request.
With this update:
Motivation
This is a minor UX and consistency improvement to make bot messages clearer for contributors.
Screenshots / Example
See the comment made by the bot under my merged PR
[https://github.com/angular/angular/pull/68297]
Notes
Closes angular/angular#68848