Issue police

This commit is contained in:
Maurus Decimus
2026-04-18 14:29:53 +02:00
parent dd95efe3ce
commit 11c58120cd
2 changed files with 83 additions and 29 deletions

View File

@@ -1,40 +1,27 @@
name: Confirmed Bug Report
description: Only for issues that have been discussed and confirmed as bugs in GitHub Discussions.
name: Bug Report (auto-closed)
description: Issues opened here are automatically closed. Please start a Discussion instead.
labels: ["bug"]
title: "🪲: "
body:
- type: markdown
attributes:
value: |
> [!IMPORTANT]
> This template is **only** for issues that have already been discussed and confirmed as bugs in the [Discussions](https://github.com/stalwartlabs/stalwart/discussions) section.
> [!CAUTION]
> **Issues opened directly in this repository are automatically closed and locked.**
>
> If you haven't had your issue confirmed yet, please [start a Discussion](https://github.com/stalwartlabs/stalwart/discussions/new?category=issue-triage) first.
- type: input
attributes:
label: Discussion Link
description: Provide the link to the Discussion where this issue was confirmed as a bug.
placeholder: https://github.com/stalwartlabs/stalwart/discussions/1234
validations:
required: true
- type: textarea
attributes:
label: Bug Summary
description: Brief summary of the confirmed bug.
validations:
required: true
- type: textarea
attributes:
label: Additional Information
description: |
Include any additional information not covered in the original Discussion, such as new findings, workarounds discovered, or updated reproduction steps.
validations:
required: false
> All bug reports must first be triaged in the [Discussions](https://github.com/stalwartlabs/stalwart/discussions/new?category=issue-triage) section. If a maintainer confirms that your report is a genuine bug, **they will create an Issue on your behalf** — you do not need to (and should not) open one yourself.
>
> This policy exists because a large volume of unverified, AI-generated bug reports has been consuming maintainer time that would otherwise be spent fixing real problems. Triaging in Discussions first ensures that every Issue tracked here represents a confirmed bug worth investigating.
>
> **What to do instead:**
> - Suspected bug? → [Start a Discussion in *Issue Triage*](https://github.com/stalwartlabs/stalwart/discussions/new?category=issue-triage)
> - Question or support? → [Start a Discussion in *Q&A*](https://github.com/stalwartlabs/stalwart/discussions/new?category=q-a)
> - Feature request? → [Start a Discussion in *Feature Requests & Ideas*](https://github.com/stalwartlabs/stalwart/discussions/new?category=feature-requests-and-ideas)
>
> If you proceed and submit this form anyway, your issue will be closed automatically and a comment will be posted explaining this policy.
- type: checkboxes
attributes:
label: Confirmation
label: Acknowledgement
options:
- label: This issue was discussed and confirmed as a bug in the linked Discussion.
required: true
- label: I have included the link to the Discussion above.
- label: I understand that this issue will be automatically closed and that I should open a Discussion instead.
required: true

67
.github/workflows/auto-close-issues.yml vendored Normal file
View File

@@ -0,0 +1,67 @@
name: Auto-close untriaged issues
on:
issues:
types: [opened, reopened]
permissions:
issues: write
jobs:
auto-close:
runs-on: ubuntu-latest
steps:
- name: Close issues from non-allowed authors
uses: actions/github-script@v7
with:
script: |
// Users allowed to open issues directly. All other authors will have
// their issues auto-closed. Add GitHub usernames (lowercase) here to
// grant additional contributors permission to open issues.
const allowedAuthors = [
'mdecimus',
];
const issue = context.payload.issue;
const author = (issue.user && issue.user.login) || '';
if (allowedAuthors.includes(author.toLowerCase())) {
core.info(`Issue #${issue.number} opened by allowed author '${author}'. Skipping.`);
return;
}
const comment = [
`Hi @${author}, thanks for taking the time to file this report.`,
``,
`This issue is being **automatically closed** because all bug reports in this repository must first be triaged in a [Discussion](https://github.com/stalwartlabs/stalwart/discussions/new?category=issue-triage). Once a maintainer has confirmed the report as a bug, an Issue will be created on your behalf. This process is described in the issue template and in [CONTRIBUTING](https://github.com/stalwartlabs/stalwart/blob/main/.github/ISSUE_TEMPLATE/config.yml), but it appears the instructions were ignored, most likely because this report was generated by an AI coding agent.`,
``,
`Please be aware that **AI-generated bug reports that have not been verified by a human consume a significant amount of maintainer time**: they are frequently inaccurate, fabricate symptoms or code paths that do not exist, and pull attention away from genuine issues affecting real users. If you are using an agent to interact with this project, please review its output and reproduce the problem yourself before reporting it, and always start in [Discussions](https://github.com/stalwartlabs/stalwart/discussions/new?category=issue-triage) rather than filing an Issue directly.`,
``,
`Thank you for understanding.`,
].join('\n');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: comment,
});
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
state: 'closed',
state_reason: 'not_planned',
});
try {
await github.rest.issues.lock({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
lock_reason: 'off-topic',
});
} catch (err) {
core.warning(`Could not lock issue #${issue.number}: ${err.message}`);
}