FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Travis configuration now does extra tag validation by fabianvf · Pull Request #1101 · kubernetes-client/python · GitHub

Travis configuration now does extra tag validation - #1101

Merged
k8s-ci-robot merged 3 commits into
kubernetes-client:masterfrom
fabianvf:travis-verify-tag
Mar 10, 2020
Merged

Travis configuration now does extra tag validation#1101
k8s-ci-robot merged 3 commits into
kubernetes-client:masterfrom
fabianvf:travis-verify-tag

Conversation

fabianvf commented Mar 10, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

Separate build matrix into 3 stages - verify-tag, test, and deploy

  • verify-tag compares the kubernetes.__version__ to $TRAVIS_TAG. Only
    runs on pushed tags
  • test runs the actual tests
  • deploy deploys the package to pypi. Only runs on pushed tags

Separate build matrix into 3 stages - verify-tag, test, and deploy
- verify-tag compares the kubernetes.__version__ to $TRAVIS_TAG. Only
runs on pushed tags
- test runs the actual tests
- deploy deploys the package to pypi. Only runs on pushed tags
k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 10, 2020
k8s-ci-robot requested review from roycaihw and yliaog March 10, 2020 15:18
k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 10, 2020

Copy link
Copy Markdown
Member

/cc @palnabarun

k8s-ci-robot requested a review from palnabarun March 10, 2020 16:14

fabianvf commented Mar 10, 2020
edited
Loading

Copy link
Copy Markdown
Contributor Author

Travis doesn't seem to have picked this up, which I assume implies a major mistake on my end

edit: The script started with [ which made travis interpret it as a list

fabianvf closed this Mar 10, 2020
fabianvf reopened this Mar 10, 2020

Copy link
Copy Markdown
Member

@fabianvf Thank you for splitting the stages out. I was working on it on the side. :)

Comment thread .travis.yml Outdated
- stage: verify-tag
python: 3.7
script: |
[ "v$(python -c 'import kubernetes ; print(kubernetes.__version__)')" == "${TRAVIS_TAG}" ]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We could also put in a check to make sure that the TRAVIS_TAG obeys semver

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I was going to say that. This would, in turn, ensure that the version that we put in constants.py is also validated.

palnabarun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM!

Comment thread .travis.yml
python: 3.7
script: >
[ "v$(python -c 'import kubernetes ; print(kubernetes.__version__)')" == "${TRAVIS_TAG}" ] &&
[[ "${TRAVIS_TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(([ab]|dev|rc)[0-9]+)?$ ]]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

👍

Copy link
Copy Markdown
Member

/lgtm

k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 10, 2020

yliaog commented Mar 10, 2020

Copy link
Copy Markdown
Contributor

/approve

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabianvf, yliaog

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 10, 2020
k8s-ci-robot merged commit cbf95cf into kubernetes-client:master Mar 10, 2020

Copy link
Copy Markdown
Contributor Author

@roycaihw would you mind doing another test with these changes, just to make sure it all works in the travis environment? Tested it out locally but you never know

Copy link
Copy Markdown
Member

@fabianvf I checked out the latest revision of the config: https://github.com/kubernetes-client/python/commits/travis-pypi-experiment and tagged a new release

verify-tag failed with ModuleNotFoundError: No module named 'urllib3':
https://travis-ci.org/kubernetes-client/python/jobs/660868889

Copy link
Copy Markdown
Member

I think this is due to the package not being installed in the environment or some other dependency issue.

When I ran it locally in a fresh virtual environment based on 3.7, it gave me this

$ mkvirtualenv --python=/usr/bin/python3.7 py37-temp
Running virtualenv with interpreter /usr/bin/python3.7
Already using interpreter /usr/bin/python3.7
Using base prefix '/usr'
New python executable in /home/nabarun/.envs/py37-temp/bin/python3.7
Also creating executable in /home/nabarun/.envs/py37-temp/bin/python
Installing setuptools, pip, wheel...
done.
virtualenvwrapper.user_scripts creating /home/nabarun/.envs/py37-temp/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/nabarun/.envs/py37-temp/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/nabarun/.envs/py37-temp/bin/preactivate
virtualenvwrapper.user_scripts creating /home/nabarun/.envs/py37-temp/bin/postactivate
virtualenvwrapper.user_scripts creating /home/nabarun/.envs/py37-temp/bin/get_env_details

$ python -c 'import kubernetes ; print(kubernetes.__version__)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/nabarun/c/kubernetes/kubernetes-client/python/kubernetes/__init__.py", line 19, in <module>
    import kubernetes.client
  File "/home/nabarun/c/kubernetes/kubernetes-client/python/kubernetes/client/__init__.py", line 20, in <module>
    from kubernetes.client.api.admissionregistration_api import AdmissionregistrationApi
  File "/home/nabarun/c/kubernetes/kubernetes-client/python/kubernetes/client/api/__init__.py", line 6, in <module>
    from kubernetes.client.api.admissionregistration_api import AdmissionregistrationApi
  File "/home/nabarun/c/kubernetes/kubernetes-client/python/kubernetes/client/api/admissionregistration_api.py", line 18, in <module>
    import six
ModuleNotFoundError: No module named 'six'

Getting the client version from scripts/constants.py is better since it does not depend on any other thing and kubernetes.__version__ is generated from scripts/constants.CLIENT_VERSION itself.

$ python -c 'from scripts.constants import CLIENT_VERSION; print(CLIENT_VERSION)'
11.0.0-snapshot

k8s-ci-robot added a commit that referenced this pull request Mar 12, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL