Skip to content

Label reminder bot incorrectly adds missing-required-type to issues that have a Type label at creation time #14990

Open

Description

@nkolev92

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: Write

This 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:

  1. It only triggers on the Labeled action.
  2. The Type:DCR labeled event (9:02:00) fired before missing-required-type existed, so its guard hasLabel: missing-required-type was false and it did nothing.
  3. 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-type labels on correctly-labeled issues (noise for authors and triage).
  • The bogus missing-required-type label 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:

  1. Prefer the scheduled search over the immediate Opened responder. The daily scheduled search [20-10] already re-checks the full, settled label state and would not misfire. Consider removing/relaxing the Opened-triggered reminder [20-30] (and [20-40]).
  2. Make cleanup [20-20] robust / self-healing. Ensure missing-required-type is removed whenever a Type label is present — e.g. via a scheduled sweep — so the sticky label self-heals regardless of event ordering.
  3. Re-evaluate the current label state (not just the triggering event payload) before adding the reminder comment/label.

Repro

  1. Create a new issue in NuGet/Home and apply a Type label during creation (single submit).
  2. Observe the bot add missing-required-type and a reminder comment shortly after, despite the Type label being present.

Note: this very issue is filed with a Type:Engineering label at creation, so it may itself get incorrectly flagged — which would serve as additional confirmation of the bug.

Activity

  1. added
    Type:Engineeringproduct/infrastructure work/not a customer bug/feature/DCR
    Priority:1High priority issues that must be resolved in the current sprint.
    on Jul 10, 2026
  2. added
    Priority:2Issues for the current backlog.
    and removed
    Priority:1High priority issues that must be resolved in the current sprint.
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Priority:2Issues for the current backlog.Type:Engineeringproduct/infrastructure work/not a customer bug/feature/DCR

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions