Skip to content
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

Remove duplicated imports for pkg/apis/kubeflow.org/v1 #1847

Merged

Conversation

tenzen-y
Copy link
Member

@tenzen-y tenzen-y commented Jul 4, 2023

What this PR does / why we need it:
I removed duplicated imports for "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1". commonv1 vs kubeflowv1.

Also, I removed redundant type casting for kubeflowv1.ReplicaType.

Which issue(s) this PR fixes (optional, in Fixes #<issue number>, #<issue number>, ... format, will close the issue(s) when PR gets merged):
Fixes #1816

Checklist:

  • Docs included if any changes are user facing

@google-oss-prow google-oss-prow bot requested review from jinchihe and kuizhiqing July 4, 2023 05:34
@tenzen-y tenzen-y force-pushed the replace-commonv1-with-kubeflowv1 branch from cefdbf9 to 6baf6e3 Compare July 4, 2023 05:34
@tenzen-y tenzen-y changed the title Remove duplicated imports Remove duplicated imports for pkg/apis/kubeflow.org/v1 Jul 4, 2023
@tenzen-y tenzen-y marked this pull request as ready for review July 4, 2023 05:35
kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
trainingoperatorcommon "github.com/kubeflow/training-operator/pkg/common"
"github.com/kubeflow/training-operator/pkg/common/util"
"github.com/kubeflow/training-operator/pkg/controller.v1/common"
"github.com/kubeflow/training-operator/pkg/controller.v1/control"
"github.com/kubeflow/training-operator/pkg/controller.v1/expectation"
commonutil "github.com/kubeflow/training-operator/pkg/util"
train_util "github.com/kubeflow/training-operator/pkg/util/train"
trainutil "github.com/kubeflow/training-operator/pkg/util/train"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't use snake case for Golang.

@coveralls
Copy link

coveralls commented Jul 4, 2023

Pull Request Test Coverage Report for Build 5451231793

  • 105 of 198 (53.03%) changed or added relevant lines in 21 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 33.822%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/common/util/reconciler.go 2 3 66.67%
pkg/reconciler.v1/common/service.go 4 5 80.0%
pkg/common/util/reconciler_generic.go 0 2 0.0%
pkg/common/util/scheduler.go 0 2 0.0%
pkg/common/util/util.go 1 3 33.33%
pkg/reconciler.v1/common/gang_volcano.go 0 2 0.0%
pkg/controller.v1/mxnet/mxnet.go 0 3 0.0%
pkg/controller.v1/mpi/mpijob_controller.go 16 20 80.0%
pkg/controller.v1/xgboost/xgboost.go 0 4 0.0%
pkg/controller.v1/pytorch/pytorchjob_controller.go 10 16 62.5%
Files with Coverage Reduction New Missed Lines %
pkg/controller.v1/mpi/mpijob_controller.go 1 79.89%
Totals Coverage Status
Change from base Build 5450631776: 0.2%
Covered Lines: 3296
Relevant Lines: 9745

💛 - Coveralls

@tenzen-y tenzen-y force-pushed the replace-commonv1-with-kubeflowv1 branch from 6baf6e3 to 937071e Compare July 4, 2023 05:38
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
@tenzen-y tenzen-y force-pushed the replace-commonv1-with-kubeflowv1 branch from 937071e to bb3c660 Compare July 4, 2023 05:41
@@ -89,25 +88,24 @@ const (
)

// initializeMPIJobStatuses initializes the ReplicaStatuses for MPIJob.
func initializeMPIJobStatuses(mpiJob *kubeflowv1.MPIJob, mtype commonv1.ReplicaType) {
replicaType := commonv1.ReplicaType(mtype)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant type casting.

@tenzen-y
Copy link
Member Author

tenzen-y commented Jul 4, 2023

Go Test / Test (1.27.1) (pull_request) is failed by flaky test: #1848

@tenzen-y
Copy link
Member Author

tenzen-y commented Jul 4, 2023

/assign @johnugeorge @terrytangyuan

@johnugeorge
Copy link
Member

Thanks @tenzen-y
/lgtm
/approve

@google-oss-prow google-oss-prow bot added the lgtm label Jul 4, 2023
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnugeorge, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit 59cc98c into kubeflow:master Jul 4, 2023
@tenzen-y tenzen-y deleted the replace-commonv1-with-kubeflowv1 branch July 4, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up the whole of training-operator
4 participants