Skip to content

Wrong Github link in auto-generated README  #952

Closed

Description

@roycaihw

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

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug.
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Sep 10, 2019
  2. palnabarun commented on Oct 24, 2019

    @palnabarun
    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.

  3. palnabarun commented on Oct 24, 2019

    @palnabarun
    Member
  4. palnabarun commented on Oct 24, 2019

    @palnabarun
    Member

    /assign

  5. palnabarun commented on Oct 24, 2019

    @palnabarun
    Member

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

  6. palnabarun commented on Oct 24, 2019

    @palnabarun
    Member

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

  7. palnabarun commented on Nov 25, 2019

    @palnabarun
    Member

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

  8. roycaihw commented on Nov 26, 2019

    @roycaihw
    MemberAuthor

    Thanks for the fix!

    /close

  9. k8s-ci-robot commented on Nov 26, 2019

    @k8s-ci-robot
    Contributor

    @roycaihw: Closing this issue.

    Details

    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

Metadata

Metadata

Assignees

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions