Skip to content

Conversation

@Yashks1994
Copy link
Contributor

@Yashks1994 Yashks1994 commented Apr 29, 2021

What type of PR is this?

/kind cleanup
/kind documentation

What this PR does / why we need it:

Removed the custom_object.py and created a new file as namespaced_custom_object.py which is more specific to usage of namespaced custom resource.

Which issue(s) this PR fixes:

Fixes #1438

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/documentation Categorizes issue or PR as related to documentation. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 29, 2021
@k8s-ci-robot k8s-ci-robot requested review from roycaihw and yliaog April 29, 2021 04:16
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 29, 2021
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 29, 2021
@Yashks1994 Yashks1994 changed the title Removed custom_object.py Removed custom_object.py and created a new file namespaced_custom_object.py which is more specific to usage of namespaced custom resource Apr 29, 2021
@roycaihw
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 29, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: roycaihw, Yashks1994

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 29, 2021
@Yashks1994
Copy link
Contributor Author

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Apr 29, 2021
@Priyankasaggu11929
Copy link
Contributor

Priyankasaggu11929 commented Apr 29, 2021

~@Yashks1994, just a note.

Git takes renaming of the file with name custom_object.py to namespaced_custom_object.py as two steps:

  • deleting the file custom_object.py
  • and creating a new file namespaced_custom_object.py having the same contents as above.

To reflect the deletion of file custom_object.py, you need to add the deleted file as well in your git staging & then commit both the deleted file & new file.

Doing that, in the Files changed section of this PR, both the deleted file (custom_object.py) & new file (namespaced_object.py) will reflect.

Ok, I misunderstood the file renaming with the file deletion part. The file renaming would look something like this in the PR's Files Changed section.

Screenshot from 2021-04-29 11-50-17

Sorry for the trouble. (And I learnt this new thing. :) )

@Yashks1994 Yashks1994 force-pushed the remove-custom-patch1 branch from 3d09481 to 0a1c73c Compare April 29, 2021 06:55
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 29, 2021
@Yashks1994
Copy link
Contributor Author

@roycaihw needs your /lgtm as CI build passed.

@roycaihw
Copy link
Member

The file renaming would look something like this in the PR's Files Changed section.

@Priyankasaggu11929 I was surprised when I saw that the first time. I didn't expect Github to render it that way but it's really beautiful.

@Yashks1994 LGTM. Please squash the commits as I suggested in #1439 (comment):

  • one commit for adding patch example to custom_object.py
  • one commit for renaming the file to namespaced_custom_object.py

@Yashks1994 Yashks1994 force-pushed the remove-custom-patch1 branch 2 times, most recently from 2482a33 to f8c37d3 Compare April 30, 2021 04:53
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 30, 2021
@Yashks1994 Yashks1994 force-pushed the remove-custom-patch1 branch from f8c37d3 to a5cee19 Compare April 30, 2021 04:54
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 30, 2021
# patch the namespaced custom object to update the `spec.cronSpec` field
patch_resource = api.patch_namespaced_custom_object(
# delete it
api.delete_namespaced_custom_object(
Copy link
Member

Choose a reason for hiding this comment

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

why do we have a commit that reverse the order of patch_namespaced_custom_object and delete_namespaced_custom_object?

Copy link
Member

Choose a reason for hiding this comment

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

https://github.com/kubernetes-client/python/pull/1444/commits is what I was asking for, if that makes sense

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 kept the order like this,
we have create, get, patch, delete

Copy link
Member

@roycaihw roycaihw Apr 30, 2021

Choose a reason for hiding this comment

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

currently the two PRs have the same code change, but the commits are different

Commits should represent meaningful milestones or units of work. Currently the commits in this PR are:

  • your first commit renames the file and adds a patch method after the delete method, which means the example has a bug and will run into an error
  • your second commit reverses the order of the patch method and the delete method to fix the bug in the first commit

please take a look at https://github.com/kubernetes/community/blob/master/contributors/guide/github-workflow.md#squash-commits. The second commit is a "Work in progress" (it fixes a bug in the first commit during development), so please squash it.

again, I think having two commits like the following will be most reasonable and readable:

  • one commit for adding patch example to custom_object.py
  • one commit for renaming the file to namespaced_custom_object.py

at this point I'm also okay with having just one commit, which will be more reasonable than the current two commits in this PR

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 am keeping the one commit and with proper commit message.

@k8s-ci-robot
Copy link
Contributor

@Yashks1994: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@Yashks1994 Yashks1994 force-pushed the remove-custom-patch1 branch from 3d48709 to 9248a90 Compare April 30, 2021 07:38
@roycaihw
Copy link
Member

Thanks!
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 30, 2021
@k8s-ci-robot k8s-ci-robot merged commit 36d2108 into kubernetes-client:master Apr 30, 2021
@Yashks1994 Yashks1994 deleted the remove-custom-patch1 branch May 1, 2021 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/documentation Categorizes issue or PR as related to documentation. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the custom_object.py to be more specific to usage of namespaced custom resource

4 participants