Follow-up to #2087. Core sends two deliveries to a channel connector with fixed payloads: message (an object with title, optionally body and approval_request_id) and chat_message (chat_id and text). A connector declares input schemas for these, but nothing checks the declaration accepts what core actually sends, so an incompatible schema is only found when a delivery fails.
Done when
When a connector declares message or chat_message, its declared input schema is checked against every payload shape core may send on it, when the connector loads.
A declaration that rejects a payload core sends fails the connector with a clear reason, instead of failing deliveries at run time.
The delivery names have one definition (exported from the connectors module), used by core's senders and the check.
A table test in modules/connectors covers an accepting schema, a rejecting schema, and an undeclared delivery.
task check passes.
Follow-up to #2087. Core sends two deliveries to a channel connector with fixed payloads: `message` (an object with `title`, optionally `body` and `approval_request_id`) and `chat_message` (`chat_id` and `text`). A connector declares input schemas for these, but nothing checks the declaration accepts what core actually sends, so an incompatible schema is only found when a delivery fails.
## Done when
- When a connector declares `message` or `chat_message`, its declared input schema is checked against every payload shape core may send on it, when the connector loads.
- A declaration that rejects a payload core sends fails the connector with a clear reason, instead of failing deliveries at run time.
- The delivery names have one definition (exported from the connectors module), used by core's senders and the check.
- A table test in `modules/connectors` covers an accepting schema, a rejecting schema, and an undeclared delivery.
- `task check` passes.
connectors now exports DeliveryMessage ("message") and DeliveryChatMessage ("chat_message"); deliveries and runs use them instead of their own constants, so the contract has one definition.
checkCoreDeliveries runs in launch before declarations are stored: each declared core delivery's input schema is validated against every payload shape core sends (title always, body and approval_request_id optionally, for message; chat_id+text for chat_message). A rejection stops the connector and fails it with delivery "..." doesn't accept what core sends: ....
Table test TestCoreDeliveriesGuardWhatCoreSends in modules/connectors covers accepting schemas, a required field core never sends, a wrong field type, an empty schema, and an undeclared delivery; verified to fail with the check disabled. task check passes.
Landed in 592d36e0d.
- `connectors` now exports `DeliveryMessage` ("message") and `DeliveryChatMessage` ("chat_message"); `deliveries` and `runs` use them instead of their own constants, so the contract has one definition.
- `checkCoreDeliveries` runs in `launch` before declarations are stored: each declared core delivery's input schema is validated against every payload shape core sends (`title` always, `body` and `approval_request_id` optionally, for `message`; `chat_id`+`text` for `chat_message`). A rejection stops the connector and fails it with `delivery "..." doesn't accept what core sends: ...`.
- Table test `TestCoreDeliveriesGuardWhatCoreSends` in modules/connectors covers accepting schemas, a required field core never sends, a wrong field type, an empty schema, and an undeclared delivery; verified to fail with the check disabled. `task check` passes.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Follow-up to #2087. Core sends two deliveries to a channel connector with fixed payloads:
message(an object withtitle, optionallybodyandapproval_request_id) andchat_message(chat_idandtext). A connector declares input schemas for these, but nothing checks the declaration accepts what core actually sends, so an incompatible schema is only found when a delivery fails.Done when
messageorchat_message, its declared input schema is checked against every payload shape core may send on it, when the connector loads.modules/connectorscovers an accepting schema, a rejecting schema, and an undeclared delivery.task checkpasses.Landed in
592d36e0d.connectorsnow exportsDeliveryMessage("message") andDeliveryChatMessage("chat_message");deliveriesandrunsuse them instead of their own constants, so the contract has one definition.checkCoreDeliveriesruns inlaunchbefore declarations are stored: each declared core delivery's input schema is validated against every payload shape core sends (titlealways,bodyandapproval_request_idoptionally, formessage;chat_id+textforchat_message). A rejection stops the connector and fails it withdelivery "..." doesn't accept what core sends: ....TestCoreDeliveriesGuardWhatCoreSendsin modules/connectors covers accepting schemas, a required field core never sends, a wrong field type, an empty schema, and an undeclared delivery; verified to fail with the check disabled.task checkpasses.Landed in
592d36e0d. Closing without the manual check; it moves to #2096.