name: "🔧 Maintenance"
description: >
  Technical task with no new feature: docs, refactoring,
  tests, CI/CD, performance, deprecation.
title: "[MAINT] "
labels:
  - "status: triage"

body:
  - type: dropdown
    id: maint-type
    attributes:
      label: "Task type"
      description: >
        Select the primary type, then replace `status: triage`
        with the matching `type:` label after creation.
      options:
        - "chore       — dependencies, housekeeping, configuration"
        - "docs        — rustdoc, README, guides, examples"
        - "test        — adding or fixing tests, coverage"
        - "refactor    — restructuring without behaviour change"
        - "ci          — cargo, GitHub Actions, pipeline config"
        - "perf        — performance optimisation"
        - "deprecation — mark obsolete code with deprecation warnings"
    validations:
      required: true

  - type: textarea
    id: description
    attributes:
      label: "Description"
      description: "What needs to be done, and why now?"
      placeholder: >
        Update `serde` from `1.0.195` to `1.0.197` following the upstream
        changelog. Verify serialisation behaviour is identical after the update.
    validations:
      required: true

  - type: textarea
    id: done
    attributes:
      label: "Completion criteria"
      description: "Objective conditions to close this issue."
      placeholder: |
        - [ ] `cargo test` passes
        - [ ] `cargo clippy -- -D warnings`: 0 errors
        - [ ] `cargo fmt --check`: no diff
        - [ ] Coverage ≥ threshold defined in `.cargo/config.toml`
        - [ ] `CHANGELOG.md` updated if necessary
        - [ ] `Cargo.toml` and `Cargo.lock` committed if a dependency was updated
      render: markdown
    validations:
      required: true

  - type: textarea
    id: motivation
    attributes:
      label: "Urgency (optional)"
      description: >
        Why this task now rather than later?
        E.g.: vulnerability (CVE, RUSTSEC), blocking technical debt, prerequisite for a feature.
    validations:
      required: false

  - type: checkboxes
    id: scope
    attributes:
      label: "Affected scopes"
      description: "Apply the matching `scope:` labels manually after creation."
      options:
        - label: "`api` — public traits or types"
        - label: "`docs` — rustdoc, examples, guides"
        - label: "`tests` — unit tests, integration tests, doctests"
        - label: "`ci` — GitHub Actions, coverage, semver-checks"

  - type: dropdown
    id: priority
    attributes:
      label: "Priority"
      description: "Apply the matching `priority:` label after creation."
      options:
        - "none — someday, out of sprint"
        - "low — before the next minor version"
        - "medium — in the target version"
        - "high — blocks the release or CI"
    validations:
      required: true

  - type: dropdown
    id: effort
    attributes:
      label: "Estimated effort"
      description: "Apply the matching `effort:` label after creation."
      options:
        - "XS — < 1 h"
        - "S  — half-day"
        - "M  — 1 day"
        - "L  — 2–3 days"
        - "XL — > 3 days"
    validations:
      required: true

  - type: dropdown
    id: ecosystem
    attributes:
      label: "Ecosystem layer"
      description: "Apply the matching `ecosystem:` label after creation."
      options:
        - "language — Rust idioms, borrow checker, traits, generics, MSRV"
        - "framework — nalgebra, faer, rayon, thiserror"
        - "ops — crates.io publishing, packaging, NOTICE"
        - "pipeline — cargo, cargo-llvm-cov, clippy, cargo-semver-checks, GitHub Actions"
    validations:
      required: false

  - type: textarea
    id: dep-update
    attributes:
      label: "Dependency update detail (optional)"
      description: "Fill in only for a dependency-update `type: chore`."
      placeholder: |
        | Crate    | Before   | After    | Breaking? | Advisory            |
        |----------|----------|----------|-----------|---------------------|
        | serde    | 1.0.195  | 1.0.197  | No        | —                   |
        | thiserror| 1.x      | 2.x      | Yes       | —                   |
        | openssl  | 0.10.64  | 0.10.66  | No        | RUSTSEC-2024-XXXX   |
      render: markdown
    validations:
      required: false
