Skip to content

[CI] Add three pre-commit pygrep hooks - #12933

Open
jbampton wants to merge 6 commits into
apache:mainfrom
jbampton:add-pre-commit-pygrep-hooks
Open

jbampton wants to merge 6 commits into
apache:mainfrom
jbampton:add-pre-commit-pygrep-hooks

Conversation

@jbampton

Copy link
Copy Markdown
Member

https://github.com/pre-commit/pygrep-hooks

Official hooks from pre-commit some more basic checks or tests we can run

Description

This PR...

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

https://github.com/pre-commit/pygrep-hooks

Official hooks from pre-commit some more basic checks or tests we can run
@jbampton

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@jbampton a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@codecov

codecov Bot commented Mar 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 20.78%. Comparing base (c5bd11a) to head (04e4c86).

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #12933   +/-   ##
=========================================
  Coverage     20.77%   20.78%           
- Complexity    20855    20856    +1     
=========================================
  Files          6053     6053           
  Lines        548230   548230           
  Branches      73237    73237           
=========================================
+ Hits         113903   113923   +20     
+ Misses       420988   420959   -29     
- Partials      13339    13348    +9     
Flag Coverage Δ
uitests 3.86% <ø> (ø)
unittests 22.21% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17311

Copilot AI lite review requested due to automatic review settings August 12, 2026 05:29

Copilot AI 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.

Pull request overview

Adds additional upstream pygrep-hooks checks to the repository’s pre-commit configuration to catch a few common Python/text pitfalls earlier in CI and local developer workflows.

Changes:

  • Add python-check-mock-methods to detect common invalid unittest.mock method usages.
  • Add python-use-type-annotations to discourage PEP 484 type comments in favor of annotations (with a targeted exclude).
  • Add text-unicode-replacement-char to forbid UTF-8 replacement characters in committed files.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@DaanHoogland
DaanHoogland requested a review from vishesh92 August 12, 2026 13:46

@DaanHoogland DaanHoogland 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.

clgtm

Copilot AI review requested due to automatic review settings September 9, 2026 02:43

Copilot AI 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.

🟢 Approval recommended

The changes are limited to CI/pre-commit configuration, with only minor wording/spelling fixes suggested for clarity.

Review details

Suppressed comments (1)

.pre-commit-config.yaml:200

  • The hook name uses the abbreviation "char" while the description spells out "character"; keeping these consistent avoids confusion.
        name: run check for no unicode replacement char
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread .pre-commit-config.yaml Resolved
@jbampton
jbampton requested a review from Damans227 September 9, 2026 03:13
Comment thread .pre-commit-config.yaml Resolved
Comment thread .pre-commit-config.yaml Resolved
Comment thread .pre-commit-config.yaml Resolved

@borisstoyanov borisstoyanov 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.

LGTM, @jbampton could you please check the comments above

@borisstoyanov borisstoyanov removed their assignment Sep 11, 2026
@jbampton
jbampton marked this pull request as draft November 15, 2026 07:47
@boring-cyborg boring-cyborg Bot added the Python Warning... Python code Ahead! label Nov 15, 2026
@jbampton
jbampton requested a review from Damans227 November 15, 2026 08:27
@jbampton
jbampton marked this pull request as ready for review November 15, 2026 08:32
Copilot AI lite review requested due to automatic review settings November 15, 2026 08:32

Copilot AI 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.

🟢 Approval recommended

No active review issues are present, and the changes are limited to adding pinned validation checks and clarifying documentation.

No open issues 🎉

1 resolved since last review

Review effort: Lite

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:XenServer Python Warning... Python code Ahead!

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

6 participants