github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/contributing/checklist-jobspec.md (about) 1 # New `jobspec` Entry Checklist 2 3 ## Code 4 5 * [ ] Consider similar features in Consul, Kubernetes, and other tools. Is there prior art we should match? Terminology, structure, etc? 6 * [ ] Add structs/fields to `api/` package 7 * `api/` structs usually have Canonicalize and Copy methods 8 * New fields should be added to existing Canonicalize, Copy methods 9 * Test the structs/fields via methods mentioned above 10 * [ ] Add structs/fields to `nomad/structs` package 11 * `structs/` structs usually have Copy, Equals, and Validate methods 12 * Validation happens in this package and _must_ be implemented 13 * Note that analogous struct field names should match with `api/` package 14 * Test the structs/fields via methods mentioned above 15 * Implement and test other logical methods 16 * [ ] Add conversion between `api/` and `nomad/structs` in `command/agent/job_endpoint.go` 17 * Add test for conversion 18 * [ ] Implement diff logic for new structs/fields in `nomad/structs/diff.go` 19 * Note that fields must be listed in alphabetical order in `FieldDiff` slices in `nomad/structs/diff_test.go` 20 * Add test for diff of new structs/fields 21 * [ ] Add change detection for new structs/feilds in `scheduler/util.go/tasksUpdated` 22 * Might be covered by `.Equals` but might not be, check. 23 * Should return true if the task must be replaced as a result of the change. 24 25 ## HCL1 (deprecated) 26 27 New jobspec entries should only be added to `jobspec2`. It makes use of HCL2 28 and the `api` package for automatic parsing. Before, additional parsing was 29 required in the original `jobspec` package. 30 31 * [ ] ~~Parse in `jobspec/parse.go`~~ (HCL1 only) 32 * [ ] ~~Test in `jobspec/parse_test.go` (preferably with a 33 `jobspec/text-fixtures/<feature>.hcl` test file)~~ (HCL1 only) 34 35 ## Docs 36 37 * [ ] Changelog 38 * [ ] Jobspec entry https://www.nomadproject.io/docs/job-specification/index.html 39 * [ ] Jobspec sidebar entry https://github.com/hashicorp/nomad/blob/master/website/source/layouts/docs.erb 40 * [ ] Job JSON API entry https://www.nomadproject.io/api/json-jobs.html 41 * [ ] Sample Response output in API https://www.nomadproject.io/api/jobs.html 42 * [ ] Consider if it needs a guide https://www.nomadproject.io/guides/index.html