-
Notifications
You must be signed in to change notification settings - Fork 444
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
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tenzen-y The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @kubeflow/wg-automl-leads |
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.
Thank you for adding this @tenzen-y! I added a few comments.
/assign @johnugeorge
docs/developer-guide.md
Outdated
## Technical and style guide | ||
|
||
The following guidelines apply primarily to Katib, | ||
but other projects like training-operator might also adhere to them. |
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.
but other projects like training-operator might also adhere to them. | |
but other projects like [Training Operator](https://github.com/kubeflow/training-operator) might also adhere to them. |
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.
It makes sense.
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.
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add that developer should use gofmt
to format their code.
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.
It would be better to focus on mentioning only items that it is difficult to automatically detect in CI.
WDYT?
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.
Maybe it makes sense to say that developer can run ./hack/verify-gofmt.sh
to format their Go codes. In that case, we can reduce number of changes that contributors need to do when they create PRs.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense.
As an alternative, I would suggest using make check
. WDYT?
Line 31 in 4617346
check: generated-codes go-mod fmt vet lint |
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.
Sure, that even better, thanks!
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.
docs/developer-guide.md
Outdated
|
||
Testing: | ||
|
||
- Use `cmp.Diff` instead of `reflect.Equal`, to provide useful comparisons. |
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.
Would be nice to provide link to cmp.Diff
.
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.
That makes sense.
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.
docs/developer-guide.md
Outdated
Testing: | ||
|
||
- Use `cmp.Diff` instead of `reflect.Equal`, to provide useful comparisons. | ||
- Define test cases as maps instead of slices to avoid dependencies on te running order. |
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.
Maybe we should say that:
- Define test cases as maps instead of slices to avoid dependencies on te running order. | |
- 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. |
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.
That’s a great clarification!
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.
|
||
The following guidelines apply primarily to Katib, | ||
but other projects like training-operator might also adhere to them. | ||
|
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?
## Golang Development | |
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.
044d82e
to
17bed61
Compare
@andreyvelich I addressed all your comments. PTAL |
I will create a separate PR to fix the Python lint error. |
I opened a PR: #2251 |
Signed-off-by: tenzen-y <[email protected]>
17bed61
to
3731cba
Compare
Rebased |
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.
Thanks @tenzen-y!
/lgtm
What this PR does / why we need it:
I added the coding guide to the contribution guide.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Part-of #2186
Checklist: