You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Scheduler: human-readable messages for placement rejections #142
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.
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);
Activity
ningsiyuan1024 commentedon Nov 28, 2026
I’d like to work on this issue: Scheduler: human-readable messages for placement rejections. Is anyone already working on this?
samuelmbabhazi commentedon Nov 28, 2026
Hi @ningsiyuan1024, thanks for offering! Nobody is working on it, so it's yours.
Two codes were added after the issue was written.
PlacementRejectioninpackages/domain/src/lib/scheduler.tsnow 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.tsalready has a sentence forsurge, in itsREJECTIONSmap. Keeping yours close to it would be good. UsingdescribeRejectionin the API is out of scope here; we can do that in a follow-up.If you type the parameter as
PlacementRejectionand use aswitchwith an exhaustive check, a code added later won't compile until it has a sentence.Before opening the PR:
feat/142-rejection-messages;git commit -s(a DCO check runs on every PR);pnpm nx test domainandpnpm lintpass;Closes #142to the description.CONTRIBUTING.md has the rest.
Feel free to ask here if anything is unclear.