Skip to content

Scheduler: human-readable messages for placement rejections #142

Open

Description

@samuelmbabhazi

placeReplica in packages/domain/src/lib/scheduler.ts returns one code per rejected node (not_ready, architecture, labels, not_allowed, volume, cpu, memory, ports).

Task

  • Add a pure describeRejection(code, nodeName) that returns a short English sentence for operators, for example "edge-1 does not have enough free memory".
  • Add a unit test per code in scheduler.spec.ts.

Acceptance

pnpm nx test domain passes. No framework import in the domain package.

Activity

  1. added
    enhancement
    good first issue
    priority:P3
    on Nov 5, 2026
  2. ningsiyuan1024 commented on Nov 28, 2026

    @ningsiyuan1024

    I’d like to work on this issue: Scheduler: human-readable messages for placement rejections. Is anyone already working on this?

  3. samuelmbabhazi commented on Nov 28, 2026

    @samuelmbabhazi
    CollaboratorAuthor

    Hi @ningsiyuan1024, thanks for offering! Nobody is working on it, so it's yours.

    Two codes were added after the issue was written. PlacementRejection in packages/domain/src/lib/scheduler.ts now has 10:

    • surge: on the machine that also hosts the control plane, the old and the new release don't fit together beside the control plane's reservation during a redeployment (ADR 0021).
    • disk: the node's free disk can't hold the replica's disk budget, plus what is already planned there and a margin.

    A few pointers:

    • apps/api/src/modules/deployments/application/deployment-pipeline.ts already has a sentence for surge, in its REJECTIONS map. Keeping yours close to it would be good. Using describeRejection in the API is out of scope here; we can do that in a follow-up.

    • If you type the parameter as PlacementRejection and use a switch with an exhaustive check, a code added later won't compile until it has a sentence.

    • Before opening the PR:

      • use one branch, e.g. feat/142-rejection-messages;
      • sign off your commits with git commit -s (a DCO check runs on every PR);
      • make sure pnpm nx test domain and pnpm lint pass;
      • add Closes #142 to the description.

      CONTRIBUTING.md has the rest.

    Feel free to ask here if anything is unclear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issuepriority:P3track:control-plane

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions