Skip to content

[CI] Add pre-commit hook to stop ZIP files being committed - #12930

Open
jbampton wants to merge 4 commits into
apache:mainfrom
jbampton:add-zip-pre-commit-hook
Open

[CI] Add pre-commit hook to stop ZIP files being committed#12930
jbampton wants to merge 4 commits into
apache:mainfrom
jbampton:add-zip-pre-commit-hook

Conversation

@jbampton

Copy link
Copy Markdown
Member

Zip files are hard to track and have security implications

https://pre-commit.com/#repos-repo

https://pre-commit.com/#repository-local-hooks

https://pre-commit.com/#fail

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?

Ran pre-commit run --all-files

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

@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 19.65%. Comparing base (659f675) to head (0832519).

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #12930   +/-   ##
=========================================
  Coverage     19.64%   19.65%           
- Complexity    19790    19792    +2     
=========================================
  Files          6368     6368           
  Lines        574889   574889           
  Branches      70353    70353           
=========================================
+ Hits         112962   112970    +8     
+ Misses       449656   449646   -10     
- Partials      12271    12273    +2     
Flag Coverage Δ
uitests 3.41% <ø> (ø)
unittests 20.92% <ø> (+<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.

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

@blueorangutan

Copy link
Copy Markdown

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

Copilot AI lite review requested due to automatic review settings August 11, 2026 11:21

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 a pre-commit safeguard to prevent accidental commits of .zip artifacts, aligning with the repo’s CI/dev hygiene goals and reducing risk from opaque binary blobs.

Changes:

  • Introduces a local pre-commit hook that fails commits containing .zip files (case-insensitive).
  • Adds a targeted exclusion for the existing test resource core/src/test/resources/vhds/test.vhd.zip.

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

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

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (2)

.pre-commit-config.yaml:42

  • The failure message uses singular wording ("the zip file") even though multiple ZIPs could match, and the block-scalar | preserves newlines (including a trailing newline) which can make the output look odd. Prefer a folded scalar (>) with plural wording.
        entry: |
          Zip files are not allowed in the repository as they are hard to
          track and have security implications. Please remove the zip file from the repository.

.pre-commit-config.yaml:37

  • Hook name is grammatically awkward; consider using a clearer, imperative phrase (and consistent ZIP capitalization) so the hook list reads well.

This issue also appears on line 40 of the same file.

        name: check no zip files are committed

@DaanHoogland

Copy link
Copy Markdown
Contributor

@jbampton , why the autoscale label?

@jbampton

Copy link
Copy Markdown
Member Author

@jbampton , why the autoscale label?

Sorry @DaanHoogland it was a mistake.

Copilot AI review requested due to automatic review settings August 13, 2026 01:55

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@jbampton
jbampton requested a review from nvazquez August 13, 2026 02:48

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

i approve out of principle, but am not sure if our repo is clean enough for this ;)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants