Skip to content

feat: enforce No-Op Protection Policy via git hooks#2611

Closed
google-labs-jules[bot] wants to merge 7 commits into
mainfrom
jules-add-git-hooks-10051262785515626045
Closed

feat: enforce No-Op Protection Policy via git hooks#2611
google-labs-jules[bot] wants to merge 7 commits into
mainfrom
jules-add-git-hooks-10051262785515626045

Conversation

@google-labs-jules

@google-labs-jules google-labs-jules Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Problem Statement

The current Git commit process allows for placeholder messages that do not convey meaningful changes, which can lead to confusion and miscommunication within the development team.

Goal

Implement the No-Op Protection Policy to ensure that all git commits contain meaningful changes and prohibit placeholder messages by utilizing pre-commit and commit-msg hooks.

Non-Goals

None.

Proposed Approach

The implementation will involve configuring pre-commit and commit-msg hooks to validate commit messages. The .githooks directory configuration will continue to be used to manage these hooks.

Alternatives Considered

None.

Architectural Impact

None.

Scope

The scope includes the establishment of the No-Op Protection Policy through the implementation of the necessary git hooks, ensuring that all future commits adhere to the requirement of meaningful messages.

UNDERSTAND THE ISSUE

The issue arises from the existing practice where developers may use placeholder commit messages, which detracts from version control clarity and can create challenges in tracking changes effectively.

DETERMINE APPROACH

The approach will be to set up and enforce pre-commit and commit-msg hooks that reject commits with non-meaningful messages.

SPECIFY SCOPE

The specific scope includes configuring the .githooks directory to include the new hooks and testing them to ensure that they function as intended in rejecting inappropriate commit messages.

DEFINITION OF DONE

  • The git hooks are implemented and configured correctly.
  • A test is conducted to ensure that commits with placeholder messages are rejected.
  • Documentation is updated to reflect the new commit message policy and how to comply with it.

Adds a pre-commit hook to block empty and whitespace-only commits.
Adds a commit-msg hook to block placeholder commit messages like 'agent update'.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployment Details (Last updated: Jun 19, 2026, 11:38 AM PST)

🚀 Pushed to gh-pages; publish in progress

Adds a pre-commit hook to block empty and whitespace-only commits.
Adds a commit-msg hook to block placeholder commit messages like 'agent update'.

@arii arii left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

ANTI-AI-SLOP\n\n\n## FINDINGS\n\n\n## FINAL RECOMMENDATION\n<Approved | Approved with Minor Changes | Not Approved>\n\n

Inline Comments (Fallback due to Github line resolution errors)

  • :1:

@arii arii left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

ANTI-AI-SLOP\n\n\n## FINDINGS\n\n\n## FINAL RECOMMENDATION\n<Approved | Approved with Minor Changes | Not Approved>\n\n

Inline Comments (Fallback due to Github line resolution errors)

  • :1:

@arii arii left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

ANTI-AI-SLOP\n\n\n## FINDINGS\n\n\n## FINAL RECOMMENDATION\n<Approved | Approved with Minor Changes | Not Approved>\n\n

Inline Comments (Fallback due to Github line resolution errors)

  • :1:

@arii arii left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Automated Review for PR #2611

CI Status: All checks passing.

FINAL RECOMMENDATION

Approved

Adds a pre-commit hook to block empty and whitespace-only commits.
Adds a commit-msg hook to block placeholder commit messages like 'agent update'.

@arii arii left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Automated Review for PR #2611

CI Status: All checks passing.

Recommendation: Everything looks good from a CI perspective. Ready for manual review/merge if no other concerns.

FINAL RECOMMENDATION

Approved

@arii arii left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Comprehensive Review for PR #2611

CI Status: All checks passing.

Recommendation: Everything looks good from a CI perspective. All tests and linters pass. Ready for manual review/merge if no other concerns.

FINAL RECOMMENDATION

Approved

Adds a pre-commit hook to block empty and whitespace-only commits.
Adds a commit-msg hook to block placeholder commit messages like 'agent update'.
@arii

arii commented Jun 19, 2026

Copy link
Copy Markdown
Owner

🤖 AI Technical Audit

ANTI-AI-SLOP

The implementation relies on verbose bash scripting for logic better suited to lightweight validation. The FORBIDDEN_PHRASES array is hard-coded and not easily extensible by teams or projects. Furthermore, the pre-commit hook is overly restrictive; prohibiting whitespace-only changes prevents necessary structural refactoring or linting fixes that do not change token logic but are required for codebase health.

FINAL RECOMMENDATION

Approved with Minor Changes

Review automatically published via RepoAuditor.

@google-labs-jules

Copy link
Copy Markdown
Contributor Author

🤖 AI Technical Audit

ANTI-AI-SLOP

The implementation relies on verbose bash scripting for logic better suited to lightweight validation. The FORBIDDEN_PHRASES array is hard-coded and not easily extensible by teams or projects. Furthermore, the pre-commit hook is overly restrictive; prohibiting whitespace-only changes prevents necessary structural refactoring or linting fixes that do not change token logic but are required for codebase health.

FINAL RECOMMENDATION

Approved with Minor Changes

Review automatically published via RepoAuditor.

Thank you for the review. I have removed the restrictive whitespace check from the pre-commit hook to allow structural refactoring and linting fixes. I have also refactored the forbidden phrases into an external forbidden-phrases.txt file to make it easily extensible.

- Adds pre-commit hook to block empty commits
- Adds commit-msg hook to block placeholder commits reading from `.githooks/forbidden-phrases.txt`
- Removes the previous whitespace-only block as per reviewer feedback.
- Adds `.github/workflows/block-empty-jules-patches.yml` to block empty pull requests created by automated systems bypassing local hooks.
- Refines `.githooks/pre-commit` to remove overly restrictive whitespace-only checks, based on reviewer feedback.
- Refines `.githooks/commit-msg` to dynamically read restricted phrases from `.githooks/forbidden-phrases.txt`.
Fixes ShellCheck SC2086 (Double quote to prevent globbing and word splitting) inside the GitHub Actions workflow `block-empty-jules-patches.yml` that was causing `actionlint` to fail in CI.
@arii arii closed this Jun 19, 2026
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.

1 participant