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

Add new Scheduled rule: EnforceMaxLifeOfIssues #7693

Merged
merged 9 commits into from
Feb 26, 2024

Conversation

JimSuplizio
Copy link
Member

@JimSuplizio JimSuplizio commented Feb 15, 2024

Fixes: #7660

Rule: Enforce 2-year max life of issues

Tigger: CRON – Once Weekly which will be '0 10 * * MON' (10am on Monday). Time selected by @ronniegeraghty.
Criteria:
• Issue is Open
• Issue Create Time > 2 years
• Issue was last updated > 30 days (30 ensures that we won't close anything that's actively being looked at and pretty much guarantees it won't interfere with two other scheduled rules, Close Stale Issues and Close Addressed Issues, that close issues.
Actions:
• Close the Issue
• Add the following comment
Hi @<ISSUE AUTHOR>, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.
• Lock the Issue

@JimSuplizio JimSuplizio added the GitHub Event Processor Anything related to the GitHub Event Processor label Feb 15, 2024
@JimSuplizio JimSuplizio self-assigned this Feb 15, 2024
@JimSuplizio JimSuplizio requested a review from benbp as a code owner February 15, 2024 19:26
…f a block that contains a ServiceLabel entry which was missing from the example.
Copy link
Member

@weshaggard weshaggard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me I'll defer the approval to @jsquire

@ronniegeraghty
Copy link
Member

Just want to verify that merging this won't turn the rule on, it'll just add the rule as an option for the repos to opt into.
We'll need to properly alert our partner teams that this is happening before we turn it on.

Copy link
Member

@jsquire jsquire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks good to me. I'd strongly suggest that we rename the rule to be more generic, as criteria may change over time.

@@ -48,6 +48,7 @@ public class RulesConstants
public const string IdentifyStalePullRequests = "IdentifyStalePullRequests";
public const string CloseAddressedIssues = "CloseAddressedIssues";
public const string LockClosedIssues = "LockClosedIssues";
public const string Enforce2YearMaxLifeOfIssues = "Enforce2YearMaxLifeOfIssues";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we maybe generalize the name a bit, in case we adjust the "2 year" duration at a later point? It would suck to have to go update all the repo config files or have the name and rule mismatch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsquire changed the rule to EnforceMaxLifeOfIssues which is more generic.

@JimSuplizio
Copy link
Member Author

Just want to verify that merging this won't turn the rule on, it'll just add the rule as an option for the repos to opt into. We'll need to properly alert our partner teams that this is happening before we turn it on.

@ronniegeraghty this PR only adds the rule processing to the github-event-processor. When this is complete there is another PR that needs to be created that updates the scheduled-event-processor.yml file, in azure-sdk-tools' .github/workflows directory with the new scheduled event and even then, until each individual repository's event-processor.config is updated to turn the rule on, it won't run. New rules, that aren't in the config, default to off.

@JimSuplizio JimSuplizio changed the title Add new Scheduled rule: EnforceMax2YearLifeOfIssues Add new Scheduled rule: EnforceMaxLifeOfIssues Feb 26, 2024
@JimSuplizio JimSuplizio merged commit 7d9603e into Azure:main Feb 26, 2024
8 checks passed
@JimSuplizio JimSuplizio deleted the EnforceMax2YearLifeOfIssues branch February 26, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GitHub Event Processor Anything related to the GitHub Event Processor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a scheduled rule that will close issues created more than 2 years ago.
4 participants