From eda57a7686c780495e21641a5464763895bd6075 Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Thu, 13 Jun 2019 15:08:33 -0400 Subject: [PATCH] new file: contributing/checklist-rpc-endpoint.md --- contributing/checklist-rpc-endpoint.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 contributing/checklist-rpc-endpoint.md diff --git a/contributing/checklist-rpc-endpoint.md b/contributing/checklist-rpc-endpoint.md new file mode 100644 index 000000000000..4df2e14aabf4 --- /dev/null +++ b/contributing/checklist-rpc-endpoint.md @@ -0,0 +1,24 @@ +# New RPC Endpoint Checklist + +Prefer adding a new message to changing any existing RPC messages. + +## Code + +* [ ] `Request` struct and `RequestType` constant in `nomad/structs/structs.go` +* [ ] In `nomad/fsm.go`, add a dispatch case to the switch statement in `Apply` + * `*nomadFSM` method to decode the request and call the state method +* [ ] State method for modifying objects in a `Txn` in `nomad/state/state_store.go` + * `nomad/state/state_store_test.go` +* [ ] Handler for the request in `nomad/foo_endpoint.go` + * RPCs are resolved by matching the method name for bound structs, + e.g.: `"Node.Deregister"` calls the `(*Node)Deregister(req)` + method without any extra registration + * Wrapper for the HTTP request in `command/agent/foo_endpoint.go` +* [ ] `nomad/core_sched.go` sends many RPCs + * `ServersMeetMinimumVersion` asserts that the server cluster is + upgraded, so use this to gaurd sending the new RPC, else send the old RPC + * Version must match the actual release version! + +## Docs + +* [ ] Changelog