Repository navigation
Label reminder bot incorrectly adds missing-required-type to issues that have a Type label at creation time #14990
Description
Summary
The dotnet-policy-service bot (GitOps.LabelReminder, configured in .github/policies/20-issue-label-reminder.yml) incorrectly adds the missing-required-type label and a "missing Type label" reminder comment to issues that already have a valid Type label, when that Type label is applied at issue-creation time.
Example
#14989 was created with the Type:DCR label, yet the bot still flagged it as missing a Type label.
Timeline from the issue's event history:
| Time (2026-07-10) | Actor | Event |
|---|---|---|
| 9:02:00 PM | nkolev92 | labeled Functionality:SDK |
| 9:02:00 PM | nkolev92 | labeled Type:DCR |
| 9:02:05 PM | nkolev92 | labeled Priority:2 |
| 9:02:59 PM | dotnet-policy-service[bot] | commented "Issue is missing Type label…" |
| 9:03:00 PM | dotnet-policy-service[bot] | labeled missing-required-type |
Type:DCR was present a full 59 seconds before the bot ran, so both the reminder comment and the missing-required-type label are incorrect.
Root cause
The reminder comment (@@nkolev92 …) matches task [20-30] "Remind NuGet Client member (issue author) to add Type label", which triggers on:
- payloadType: Issues
- isAction: { action: Opened }
- not: { hasLabel: Type:<each> }
- activitySenderHasPermission: WriteThis is a race condition. When an issue is created with labels via the web UI, the Opened webhook payload does not necessarily include labels applied at creation — those arrive as separate Labeled events milliseconds later. Task [20-30] evaluates its label filters against the Opened payload, sees no Type label, and fires.
The safety-net task [20-20] "Remove missing-required-type if it has Type label" does not correct this because:
- It only triggers on the
Labeledaction. - The
Type:DCRlabeled event (9:02:00) fired beforemissing-required-typeexisted, so its guardhasLabel: missing-required-typewas false and it did nothing. - When the bot added
missing-required-type(9:03:00), that label event is bot-generated; the policy service does not re-trigger [20-20] on the bot's own event, so the cleanup never runs.
Net result: an issue that always had a valid Type label is left with an incorrect missing-required-type label and a misleading reminder comment that are never cleaned up automatically.
Impact
- False-positive reminder comments and
missing-required-typelabels on correctly-labeled issues (noise for authors and triage). - The bogus
missing-required-typelabel is sticky — it is never removed automatically for these issues. - The same applies to the analogous responders [20-40] (Reopened / Assigned / Closed).
Suggested remediation (for discussion)
Any of the following, or a combination:
- Prefer the scheduled search over the immediate
Openedresponder. The daily scheduled search [20-10] already re-checks the full, settled label state and would not misfire. Consider removing/relaxing theOpened-triggered reminder [20-30] (and [20-40]). - Make cleanup [20-20] robust / self-healing. Ensure
missing-required-typeis removed whenever a Type label is present — e.g. via a scheduled sweep — so the sticky label self-heals regardless of event ordering. - Re-evaluate the current label state (not just the triggering event payload) before adding the reminder comment/label.
Repro
- Create a new issue in NuGet/Home and apply a Type label during creation (single submit).
- Observe the bot add
missing-required-typeand a reminder comment shortly after, despite the Type label being present.
Note: this very issue is filed with a
Type:Engineeringlabel at creation, so it may itself get incorrectly flagged — which would serve as additional confirmation of the bug.
Activity