-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Technical and style guide to the contribution guide #2250
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -43,6 +43,25 @@ You can undeploy Katib v1beta1 manifests from a Kubernetes cluster as follows: | |||
make undeploy | ||||
``` | ||||
|
||||
## Technical and style guide | ||||
|
||||
The following guidelines apply primarily to Katib, | ||||
but other projects like [Training Operator](https://github.com/kubeflow/training-operator) might also adhere to them. | ||||
|
||||
## Go Development | ||||
|
||||
When coding: | ||||
|
||||
- Follow [effective go](https://go.dev/doc/effective_go) guidelines. | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should add that developer should use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be better to focus on mentioning only items that it is difficult to automatically detect in CI. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it makes sense to say that developer can run Like in K8s developer guides: https://github.com/kubernetes/community/blob/d48200bb58cfb877e4cd77043db1e9eb6d4c8e4e/contributors/devel/development.md#presubmission-verification There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It makes sense. Line 31 in 4617346
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, that even better, thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||
- Run locally [`make check`](https://github.com/kubeflow/katib/blob/46173463027e4fd2e604e25d7075b2b31a702049/Makefile#L31) | ||||
to verify if changes follow best practices before submitting PRs. | ||||
|
||||
Testing: | ||||
|
||||
- Use [`cmp.Diff`](https://pkg.go.dev/github.com/google/go-cmp/cmp#Diff) instead of `reflect.Equal`, to provide useful comparisons. | ||||
- Define test cases as maps instead of slices to avoid dependencies on the running order. | ||||
Map key should be equal to the test case name. | ||||
|
||||
## Modify controller APIs | ||||
|
||||
If you want to modify Katib controller APIs, you have to | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make a section about Golang here since Katib has various components written in Go, Python, Typescript?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.