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

Implement pre-commit hooks #2184

Merged
merged 4 commits into from
Aug 5, 2024
Merged

Conversation

droctothorpe
Copy link
Contributor

What this PR does / why we need it:
This PR implements pre-commit hooks and ensures that they're executed, as validating admission control, in CI. Once this is merged, I plan to submit follow up PRs that progressively implement additional hooks.

Which issue(s) this PR fixes
Fixes # #2178

Checklist:

  • Docs included if any changes are user facing

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@droctothorpe
Copy link
Contributor Author

@andreyvelich 🎉

.pre-commit-config.yaml Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Jul 25, 2024

Pull Request Test Coverage Report for Build 10182830151

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 34.944%

Totals Coverage Status
Change from base Build 10131041132: 0.1%
Covered Lines: 3949
Relevant Lines: 11301

💛 - Coveralls

@droctothorpe
Copy link
Contributor Author

A few autogenerated files slipped through the cracks. Addressing now. Also going to move the black execution to the pre-commit hooks.

@droctothorpe
Copy link
Contributor Author

Fixed. All checks passing.

@droctothorpe
Copy link
Contributor Author

The integration test failures are unrelated to this PR afaict. They both stop logging after Collecting urllib3>=1.15.1 (from kubeflow-training==1.8.0).

Signed-off-by: droctothorpe <[email protected]>
@droctothorpe
Copy link
Contributor Author

@andreyvelich any chance we could expedite this? The changes are all superficial but the surface area is large so it's going to require constant rebasing.

Copy link
Member

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

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

Thank you for doing this for Training Operator @droctothorpe!
/assign @kubeflow/wg-training-leads

rev: 24.2.0
hooks:
- id: black
files: sdk/.*
Copy link
Member

Choose a reason for hiding this comment

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

Should we also format files in examples directory ?
@kubeflow/wg-training-leads do we have any other location where we store Python files ?

Copy link
Contributor Author

@droctothorpe droctothorpe Jul 31, 2024

Choose a reason for hiding this comment

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

Added the examples dir to this hook in a standalone commit so that you can review the scope of the changes. I'm in favor of it FWIW. Consistency across the whole codebase ftw.

docs/development/developer_guide.md Outdated Show resolved Hide resolved
docs/development/developer_guide.md Outdated Show resolved Hide resolved
docs/development/developer_guide.md Show resolved Hide resolved
@google-oss-prow google-oss-prow bot added size/XXL and removed size/L labels Jul 31, 2024
@andreyvelich
Copy link
Member

/rerun-all

Copy link
Member

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

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

I think, we should be ready to merge this.
Thanks for this work @droctothorpe!
/lgtm
/approve

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andreyvelich

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

The pull request process is described here

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

@google-oss-prow google-oss-prow bot merged commit faec4e8 into kubeflow:master Aug 5, 2024
38 checks passed
@droctothorpe droctothorpe deleted the pc branch August 5, 2024 17:28
@droctothorpe
Copy link
Contributor Author

Thanks for the merge, @andreyvelich! Happy to add more hooks and also bring the katib hooks into alignment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants