-
Notifications
You must be signed in to change notification settings - Fork 89
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
Limit maximum number of lines changed in file #1468
base: main
Are you sure you want to change the base?
Conversation
on: | ||
pull_request: | ||
paths: | ||
- '**/*.java' # Monitor changes to Java files only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also include .avsc
and .proto
files please?
Schema changes ideally deserve dedicated PRs anyway, but without making things too complicated at first, we could at least include them in the count?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But for new protocol updates, 'added' will count the entire file as added which would be very high most of the time. Do we ever do inplace avsc changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well that is the point, protocol changes should be reviewed in isolation, prior to any code getting written 😁
EXCEEDED=false | ||
while IFS=$'\t' read -r added removed file; do | ||
# Skip test files | ||
if [[ "${file,,}" == *test.java ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean test class files must end with the suffix Test
? That does not seem right, since we don't follow this convention consistently enough. Can we instead rely on the full path needing to contain src/main
in order to be included?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! Let me update that to check for full path, though developer should include "test" somewhere in the class name.
Limit maximum number of lines changed in file
During reviewing large PR, reviewer often times miss out critical bugs which later can cause production issues.
This PR limits the maximum number of lines changed in a PR to 500. It excludes test file changes.
To override the check, developer can add OVERRRIDE keyword in the title or description.
How was this PR tested?
CI
Does this PR introduce any user-facing changes?