Skip to content
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

Fix copyright check issues in pre-commit #11711

Merged
merged 24 commits into from
Sep 29, 2022

Conversation

bdice
Copy link
Contributor

@bdice bdice commented Sep 14, 2022

Description

This PR resolves #10323 and phases out the gitutils.py module in favor of a dependency on GitPython that is managed by pre-commit. It fixes the pre-commit check for copyright years so that only modifications between the target branch (branch-X.Y) and the current git stage will trigger copyright changes (years will not be updated for unmodified files, or for changes that have not been staged). Additionally, it changes the return code to 1 if changes are requested and applied (if modifications were required, that should be considered a failure).

This is the last step to making our entire style check pipeline friendly to pre-commit.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@github-actions github-actions bot added the gpuCI label Sep 14, 2022
@bdice bdice added 2 - In Progress Currently a work in progress improvement Improvement / enhancement to an existing function non-breaking Non-breaking change and removed gpuCI labels Sep 14, 2022
@github-actions github-actions bot added the gpuCI label Sep 14, 2022
@github-actions github-actions bot added CMake CMake build issue libcudf Affects libcudf (C++/CUDA) code. labels Sep 14, 2022
@bdice bdice self-assigned this Sep 14, 2022
@github-actions github-actions bot removed libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue labels Sep 15, 2022
@bdice bdice mentioned this pull request Sep 15, 2022
3 tasks
@codecov
Copy link

codecov bot commented Sep 15, 2022

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.10@4681bdc). Click here to learn what that means.
Patch has no changes to coverable lines.

❗ Current head c844b55 differs from pull request most recent head 1f9d28f. Consider uploading reports for the commit 1f9d28f to get more accurate results

Additional details and impacted files
@@               Coverage Diff               @@
##             branch-22.10   #11711   +/-   ##
===============================================
  Coverage                ?   85.90%           
===============================================
  Files                   ?      151           
  Lines                   ?    23532           
  Branches                ?        0           
===============================================
  Hits                    ?    20214           
  Misses                  ?     3318           
  Partials                ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bdice bdice marked this pull request as ready for review September 19, 2022 12:53
@bdice bdice requested a review from a team as a code owner September 19, 2022 12:53
@bdice
Copy link
Contributor Author

bdice commented Sep 19, 2022

@vyasr @galipremsagar I tagged you both for review because of your experience with the copyright scripts and pre-commit. Thanks!

rapids-bot bot pushed a commit that referenced this pull request Sep 19, 2022
While working on #11711, I noticed a set of files that did not have copyright headers in place. This PR fixes them. I used the "start year" from the output of `git log` indicating the first commit to each file.

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)
  - Jordan Jacobelli (https://github.com/Ethyling)
  - Nghia Truong (https://github.com/ttnghia)

URL: #11712
ci/checks/style.sh Outdated Show resolved Hide resolved
ci/checks/copyright.py Show resolved Hide resolved
@bdice bdice mentioned this pull request Sep 19, 2022
4 tasks
@galipremsagar
Copy link
Contributor

Once merged, could you also copy over the changes to cuml: https://github.com/rapidsai/cuml/blob/branch-22.10/ci/checks/copyright.py, These scripts have been copied over from there actually.

@ttnghia
Copy link
Contributor

ttnghia commented Sep 28, 2022

Is this good to go?

@bdice bdice requested a review from vyasr September 28, 2022 05:33
@bdice
Copy link
Contributor Author

bdice commented Sep 28, 2022

Is this good to go?

I’d like a final approval from @vyasr to make sure there wasn’t anything else he wanted to address. Then please feel free to merge!

Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

I couldn't come up with a nice way to resolve the file vs git.Diff object issue, I think we just need to support both for now. Aside from that, this looks fine.

@vyasr
Copy link
Contributor

vyasr commented Sep 29, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 5fad289 into rapidsai:branch-22.10 Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - In Progress Currently a work in progress improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copyright check captures changes on target branch
5 participants