-
Notifications
You must be signed in to change notification settings - Fork 692
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
Adding automation to add boilerplate license/copyrights headers #4077
Conversation
Welcome @mohitsharma-in! |
Hi @mohitsharma-in. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
c4208f2
to
8630c6f
Compare
/assign Assigning to myself to approve. Will let @MadhavJivrajani and @Priyankasaggu11929 take an initial review pass at this. |
/ok-to-test |
445b713
to
5d35827
Compare
pull-org-test-all test is failing since |
cc664ac
to
b338101
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR and the contribution @mohitsharma-in. I've left a few comments above.
Apart from what @Priyankasaggu11929 suggested, |
2cdd61a
to
a9a7d01
Compare
a9a7d01
to
e37c5e7
Compare
@MadhavJivrajani Can you please review it. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mohitsharma-in The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Mohit Sharma <[email protected]> Adding license info Fixing some flags and test Signed-off-by: Mohit Sharma <[email protected]> Fixing boilerplate Making few optimistaion Signed-off-by: Mohit Sharma <[email protected]> Modification and resolving review Comments fixes Adding recommendded fixes and resolving comments Adding recommendded fixes Minor Modifications Fixing CI test Resolving Suggestions Fixing unused imports from removing config_test Adding Docs Adding license Data addding skip in existing boilerplate script adding test case validation
514182f
to
61f247c
Compare
@MadhavJivrajani Please review it once again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just 2 small comments, otherwise LGTM.
Thank you so much for persisting through reviews here, and I apologise this has taken so long.
hasLic, err := hasLicense(path) | ||
if !hasLic { | ||
if optTest.confirm { | ||
fmt.Printf("Modified %s file\n", path) | ||
return nil | ||
} | ||
} | ||
if err != nil { | ||
|
||
return fmt.Errorf("Error Adding Header/verifying Files") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add the if err != nil
check first here.
Also:
if !hasLic {
if optTest.confirm {
fmt.Printf("Modified %s file\n", path)
return nil
}
}
Shouldn't this return an error? If it does not have a license, but we had the confirm flag to set, it should add a license, which is what we want to check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please strongly consider using addlicense
instead: https://github.com/google/addlicense
There may also be some useful content here:
@MadhavJivrajani / @Priyankasaggu11929 |
Hey @mohitsharma-in, just checked out the discussion on kubernetes/repo-infra#82. It seems like we do originally wanted to use verify-boilerplate.py from Now, we have a working example in So, yea, I'm +1 on reusing this existing tooling to avoid duplication. |
@Priyankasaggu11929 / @MadhavJivrajani Please suggest the appropriate here. If we Don't need this one I'll mark it close. |
@mohitsharma-in, yes, let's close this PR and use the existing tooling (discussed in #4077 (comment)) wherever needed. |
@mohitsharma-in, thank you so much for all your work on this PR. This discussion resurfaced a lot of useful resources! |
/close |
@mohitsharma-in: Closed this PR. In response to this:
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. |
#4073 Adding support to automatically add license headers