Skip to content
This repository was archived by the owner on Mar 13, 2022. It is now read-only.

Verify-boilerplate script - #107

Merged
k8s-ci-robot merged 2 commits into
kubernetes-client:masterfrom
iamneha:verify-scripts
Jan 23, 2019
Merged

k8s-ci-robot merged 2 commits into
kubernetes-client:masterfrom
iamneha:verify-scripts

Conversation

@iamneha

@iamneha iamneha commented Dec 3, 2018

Copy link
Copy Markdown
Contributor

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 3, 2018
@iamneha iamneha changed the title Verify scripts Verify-boilerplate script Dec 3, 2018
@k8s-ci-robot
k8s-ci-robot requested a review from dims December 3, 2018 11:05
Comment thread run_tox.sh Outdated
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env python

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a bash script :)

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #107 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #107   +/-   ##
=======================================
  Coverage   92.04%   92.04%           
=======================================
  Files          13       13           
  Lines        1182     1182           
=======================================
  Hits         1088     1088           
  Misses         94       94
Impacted Files Coverage Δ
config/config_exception.py 100% <ø> (ø) ⬆️
config/exec_provider_test.py 98.38% <ø> (ø) ⬆️
config/incluster_config.py 85.1% <ø> (ø) ⬆️
watch/watch.py 100% <ø> (ø) ⬆️
watch/watch_test.py 98.13% <ø> (ø) ⬆️
config/kube_config_test.py 94.41% <ø> (ø) ⬆️
watch/__init__.py 100% <ø> (ø) ⬆️
config/exec_provider.py 82.6% <ø> (ø) ⬆️
config/kube_config.py 84.24% <ø> (ø) ⬆️
config/incluster_config_test.py 97.29% <ø> (ø) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 879ab01...1bdcaf1. Read the comment docs.

@dims

dims commented Dec 3, 2018

Copy link
Copy Markdown

very cool!

/assign @roycaihw

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 3, 2018
@dims

dims commented Dec 4, 2018

Copy link
Copy Markdown

/assign @mbohlool

Mehdy, Roy, this looks ready

@micw523 micw523 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This generally looks good!

I left a few comments. I’m on vacation so I may not reply very quickly.

Comment thread config/__init__.py
@@ -1,3 +1,5 @@
#!/usr/bin/env python

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don’t think the python shebang should appear in the non-executable files. This applies to most files you added the shebang.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@micw523 this seems to be what was in k/k main repo for boilerplate. i think this is ok - https://github.com/kubernetes/kubernetes/blob/master/hack/boilerplate/boilerplate.py.txt#L1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@dims I agree if that’s how the main repo did things. Since I’m not very familiar with the main repo, does the main repo contain any python functions or it’s all executables with main()?

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.

Does the script only verify python-base files? I'd expect CI to fail since we don't have the python shebang in most of the generated files in python repo

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.

@roycaihw yes this script only verify python-base files.
I added ./hack/verify-boilerplate.sh inside python-base/.travis.yml
And python has different .travis.yml so I don't think it will affect the pthon repo

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@roycaihw correct me if I’m wrong, but the python files in the main repo seem to be mostly executables?

Comment thread hack/boilerplate/boilerplate.py Outdated
Comment thread hack/verify-boilerplate.sh Outdated
@@ -0,0 +1,35 @@
#!/usr/bin/env bash

# Copyright 2014 The Kubernetes Authors.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It’s now 2018 ;)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+1 to fix up the date

Comment thread hack/boilerplate/boilerplate.py Outdated


if __name__ == "__main__":
sys.exit(main())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add this file to the list of files for pycodestyle checking

@iamneha iamneha Dec 5, 2018 •

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.

I'll add this directory in kubernetes-client/python/script once this PR is merged

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I’m fine with it but please run autopep8 with aggressive level 2 on your file to check for the coding style to see if there’s any changes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@micw523 i think we should leave it as a simple copy of the code in main k/k repository. If we need to do more, we should do there first and copy it over here.

@k8s-ci-robot k8s-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Dec 5, 2018
@dims

dims commented Dec 6, 2018

Copy link
Copy Markdown

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 6, 2018
@mbohlool

Copy link
Copy Markdown
Contributor

This is generally looks good to me. However, I didn't get the point about python-base vs the main python repo. If this is only run for the python-base, I couldn't see why in 2 minutes I spend on this. I defer the review decision to @roycaihw as he had the same comment.

@dims

dims commented Dec 17, 2018

Copy link
Copy Markdown

@mbohlool let's start here and we can even reuse in the other repo. for me the motivation was that there were at least 3 files which had some bits in the license header wrong

@roycaihw

Copy link
Copy Markdown
Member

/approve

I think verifying python-base on its own is helpful

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 23, 2019
@k8s-ci-robot
k8s-ci-robot merged commit 8497dfb into kubernetes-client:master Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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 Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants