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

move pkg to cmds #6399

Closed
wants to merge 1 commit into from
Closed

Conversation

rajatjindal
Copy link
Contributor

an ambitious try to move commands to a different package then 'main' to be able to use them as library.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 25, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @rajatjindal. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 25, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rajatjindal
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: chrislovecnm

If they are not already assigned, you can assign the PR to them by writing /assign @chrislovecnm in a comment when ready.

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

@zetaab
Copy link
Member

zetaab commented Jan 25, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 25, 2019
@rajatjindal
Copy link
Contributor Author

/test pull-kops-bazel-test

@chrisz100
Copy link
Contributor

I'm wondering what your goal with publishing the commands as a library is? That's quite a huge change...

@rajatjindal
Copy link
Contributor Author

Hi @chrisz100

thanks for looking at the PR.

I want to be able to use the commands from the wrapper i've on top of kops. today we exec kops command from it and if we could make use of commands directly, it will simplify a few things for us.

this is just like how kubectl exposes its commands as library and kops make use of them in its implementation.

does that make sense? and do u think its reasonable (i am hoping we don't consider it breaking change as these commands were never exposed to user anyways).

Thanks
Rajat Jindal

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 28, 2019
@rajatjindal
Copy link
Contributor Author

Hi @chrisz100

do you think this change can be merged. If not we can close the PR and I will look for other ways to do what I am trying to do.

If you think it can be merged, I will rebase it against master.

Many thanks for considering this PR.

Rajat Jindal

@chrisz100
Copy link
Contributor

@rajatjindal makes sense - by the way no need to be so formal. It's all just people eager to move this project forward here :-)

It's quite a huge PR, do you have some information on how you tested everything kops does still works?

README.md Outdated
@@ -1,4 +1,4 @@
<img src="/docs/img/logo.jpg" width="500px" alt="kops logo">
<img src="/docs/img/logo.jpg" width="500px" alt="kops logo">
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't really see this as a change that should be in this PR

Copy link
Contributor Author

@rajatjindal rajatjindal Feb 8, 2019

Choose a reason for hiding this comment

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

i think it was to trigger ci again as it flaked on a test. i will remove it.

@@ -1,131 +1,11 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not an expert in bazel. @justinsb is this good to remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think this is generated. i didn't explicitly removed it.

@drekle
Copy link
Contributor

drekle commented Jan 31, 2019

This kind of steps away from a traditional folder structure that you see in most go projects. When I am looking at a project I expect most libraries to be under /pkg. While there is no universally accepted standard for this, it seems common in most of the repos.

Consider:
https://github.com/golang-standards/project-layout

Also maybe refer to how its done here, which I find a little cleaner: https://github.com/kubernetes/kubernetes/blob/master/cmd/kubectl/kubectl.go#L29

I don't think the PR is that ambitious really. Just in the wrong place.

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package main
package cmds
Copy link
Contributor

@drekle drekle Jan 31, 2019

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Generally agree but the kops project is so spread I doubt starting with this would help to clean this up. @mikesplain @justinsb what do you say?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

requesting feedback from @mikesplain @justinsb

Copy link
Contributor

Choose a reason for hiding this comment

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

As this line refers to the package name and does not import anything this looks perfectly fine to me.

All projects do it as proposed here, see:
https://github.com/kubernetes/kubernetes/blob/master/cmd/kubectl/kubectl.go#L17

@zetaab
Copy link
Member

zetaab commented Feb 7, 2019

from my perspective this PR is really interesting and I would like to see progress in this. How we could get this forward? I know its big change, but this allows use kops as library. Now the situation is that if we want use kops as library we need copy paste quite much stuff.

@zetaab
Copy link
Member

zetaab commented Feb 27, 2019

@justinsb @mikesplain could you please give your opinion here? At least for me this PR looks very interesting because I would like to use kops as library from another code.

@chrisz100
Copy link
Contributor

Can you please rebase and fix the tests @rajatjindal ? Also, is this WIP still? When do you plan to have this ready?

@rajatjindal
Copy link
Contributor Author

I wanted to make sure this PR is acceptable to other core members of the project. I will rebase shortly and look into the test failure as well. thanks.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 6, 2019
@zetaab
Copy link
Member

zetaab commented Mar 6, 2019

@rajatjindal at least I want this PR. I am planning use kops as part of webservice

@rajatjindal rajatjindal force-pushed the fix-pkg-name branch 3 times, most recently from 64df6bf to aac02a7 Compare March 12, 2019 04:09
@rajatjindal rajatjindal changed the title [WIP] move pkg to cmds move pkg to cmds Mar 12, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 12, 2019
@rajatjindal
Copy link
Contributor Author

Hi @zetaab @chrisz100

I've rebased the PR and fixed the tests. can you please sponsor this PR with other core members of the project and help it move forward.

Many thanks
Rajat Jindal

@justinsb
Copy link
Member

This seems fine in general, though it's going to be hard to get it to a point where there are no conflicts, and we do have to prioritize bug fixes and the like.

I would like to see this though - I'm really pushing to get 1.12.0-alpha.1 done, and then hopefully things will settle down a little bit and then it won't be a constant rebase battle.

@justinsb justinsb added this to the 1.12 milestone Mar 15, 2019
@k8s-ci-robot
Copy link
Contributor

@rajatjindal: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 16, 2019
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 14, 2019
@rajatjindal
Copy link
Contributor Author

Hi @justinsb do you think this PR stand a chance to get merged now if I rebase it against master now?

@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 15, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants