-
Notifications
You must be signed in to change notification settings - Fork 12
feat: implement force push prevention and commit message validation #14
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
base: main
Are you sure you want to change the base?
Conversation
|
Hey @kp45, welcome onboard! Please just update the description including the expected outcome and adding a use case example so it'll be easier for maintainers to test your proposed functionality. Also, please use conventional commit messages, phrased in the imperative form (e.g., add feature instead of added feature). |
|
@kp45 I had a look and your proposed changes look really good - please update the description or send me to have a call if you prefer just to be on the same page! |
@dkargatzis Thanks, I’ll update the description now and am happy to jump on a call if needed. |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
|
Are you available for a call on Friday? Ideally, between 11am and 3pm UK time. if yes, give me your email so I can send the invitation. |
Yes, I am available at 11 AM UK time on Friday. Here is my email [email protected], could you please also send the invite to Project Manager ([email protected]) and Sales Person ([email protected])? |
feat: implement force push prevention and commit message validation
Overview
This PR introduces two major validators to improve repository safety and commit quality. With these validators in place, no one can skip commits or rewrite history unnoticed.
Additionally, this PR includes improvements to commit message length validation, enhanced logging, and refined violation handling. These serve as foundational changes that can be extended further as needed.
New Features Implemented
Technical Improvements
Files Modified
src/rules/validators.py– New validatorssrc/event_processors/push.py– Enhanced push processingsrc/agents/engine_agent/agent.py– Fixed violation extractionsrc/webhooks/router.py– Added push event loggingsrc/webhooks/handlers/push.py– Enhanced handler logging.watchflow/rules.yaml– Sample rules for testingReady for Testing
With these changes, Watchflow can now:
Details of the Validators Introduced
1. Force Push Prevention
Validator Name:
AllowForcePushConditionChanges Introduced:
AllowForcePushConditionvalidator with branch protection.RuleEngineAgent, ensuring violations are properly returned in responses.forcedflag and installation data.Pros:
Cons:
Use Case Example – Rules Configuration
2. Commit Message Validation
CommitCountLimitConditionCommitCountLimitConditionto enforce commit message/commit count limits.Pros
Use Case Example – Rules Configuration