Skip to content

Wrong Github link in auto-generated README #952

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

Closed
roycaihw opened this issue Sep 10, 2019 · 8 comments
Closed

Wrong Github link in auto-generated README #952

roycaihw opened this issue Sep 10, 2019 · 8 comments
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.

Comments

@roycaihw
Copy link
Member

What happened (please include outputs or screenshots):
ref #931 (comment)

What you expected to happen:
the generated address should be git+https://github.com/kubernetes-client/python.git

How to reproduce it (as minimally and precisely as possible):
run scripts/update-client.sh, and see the link in kubernetes/README.md

Anything else we need to know?:
This has been happening since we graduated this repo from kubernetes-incubator/client-python to kubernetes-client/python

The link seems to be composed as

git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

according to https://github.com/swagger-api/swagger-codegen/blob/master/samples/client/petstore/python/README.md#pip-install

however, the IDs that we use in gen repo look reasonable: https://github.com/kubernetes-client/gen/blob/795993978f8563a9c09089993be4d2b97d492eec/openapi/python.xml#L22-L23

Environment:

  • OS (e.g., MacOS 10.13.6): MacOS 10.14.6
  • Python version (python --version): 2.7.12
  • Python client version (pip list | grep kubernetes): master branch HEAD
@roycaihw roycaihw added kind/bug Categorizes issue or PR as related to a bug. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Sep 10, 2019
@palnabarun
Copy link
Member

I investigated this issue. The problem seems to have a root in the following lines of codes in kubernetes-client/gen:openapi/python.sh

find "${OUTPUT_DIR}" -path "${OUTPUT_DIR}/base" -prune -o -type f -a -name \*.md -exec sed -i 's/\bclient/kubernetes.client/g' {} +
find "${OUTPUT_DIR}" -path "${OUTPUT_DIR}/base" -prune -o -type f -a -name \*.md -exec sed -i 's/kubernetes.client-python/client-python/g' {} +

Reference: https://github.com/kubernetes-client/gen/blob/master/openapi/python.sh#L57-58

What is happening here is the first line replaces all instances of client with kubernetes.client, and the second line replaces all wrongly replaced instances of client-python with the correct string. The first line replaces kubernetes-client/python with kubernetes-kubernetes.client/python resulting in the issue described above.

One quick solution to this would be to add a line after the above code:

find "${OUTPUT_DIR}" -path "${OUTPUT_DIR}/base" -prune -o -type f -a -name \*.md -exec sed -i 's/kubernetes-kubernetes.client/kubernbetes-client/g' {} +

I believe a long term solution is make the string replacement is the README templates robust and removing the above hacks.

@palnabarun
Copy link
Member

/cc @roycaihw

@palnabarun
Copy link
Member

/assign

@palnabarun
Copy link
Member

Filed issue kubernetes-client/gen#133 to track this.

@palnabarun
Copy link
Member

Filed a PR kubernetes-client/gen#134 to resolve this.

@palnabarun
Copy link
Member

This issue has been fixed by kubernetes-client/gen#134. We should close this now maybe.

@roycaihw
Copy link
Member Author

Thanks for the fix!

/close

@k8s-ci-robot
Copy link
Contributor

@roycaihw: Closing this issue.

In response to this:

Thanks for the fix!

/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
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants