-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
CI: new check for leftover skips/fixmes #15096
CI: new check for leftover skips/fixmes #15096
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Just something I started on Monday then lost track of. I just did some polishing and am submitting as a short-n-sweet possibility for our CI. Runs in near-zero time. Sample output:
|
c0905a4
to
7723c0f
Compare
################## | ||
sub fixed_issues { | ||
# gitHUB commit message, not the git one. | ||
my $change_message = $ENV{CIRRUS_CHANGE_MESSAGE} |
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 it only check the PR description then? I think it would also make sense to check for the actual commit messages. From past experiences the issues are closed when you merged commits with Fixes #XXXX. It doesn't have to be in the PR description.
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.
Checking commit messages is harder: there's a lot of git involved. I was going for good-enough, not 100%. When time allows, I'll see what it takes to check git.
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.
I thought you already check commits for [NO NEW TESTS NEEDED]
?
Either way using the PR descriptions is already much better than nothing. This is definitely not a blocker for me.
'verbose|v' => \$verbose, | ||
|
||
help => \&usage, | ||
man => \&man, |
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.
This is not used?
'dry-run|n!' => sub { $NOT = ' [NOT]' }, | ||
'force' => \$force, | ||
'verbose|v' => \$verbose, |
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.
$NOT, $force and $verbose are not used? I don't know perl so maybe I am missing something?
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 eyes. I use a script template that I've honed over years, with all the usually-needed crap that I then trim down. I missed trimming-down some stuff. Will clean up - thanks.
== no match if Skip is commented out | ||
[123] | ||
! test/e2e/foo_test.go:10: // Skip("#123: commented out") | ||
! test/system/012-foo.bats:20: # skip "#123: commented out" |
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.
This does not seem to work correctly for all cases. This test will fail:
! test/e2e/foo_test.go:10: // Skip("FIXME: #123 commented out")
! test/system/012-foo.bats:20: # skip "FIXME: #123 commented out"
But do we actually want to exclude commented skips? Skips should be removed and not commented out, especially when the issues is supposedly fixed.
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.
Again, I was going for quick-easy. To understand the problem with comments we have to go back to the grep
expression in line 129 above. I found it safest to check for:
skip
with only leading whitespaceFIXME
anywhere on the line
I can't find any instances right now like '// make sure we don't skip bytes (#11496)` in the code itself, only in release notes, but I could imagine someone adding that and getting very upset about being blocked for it. Unlikely, I know.
Again, this is not meant to be perfect. I do manual scans of the repo every once in a while, with a much looser expression, because I don't mind manually double-checking the questionable cases. The purpose of this is simply to make my job a little easier, so I can spend my days sipping margaritas on the beach.
I think we can enhance this going forward |
If a PR says "Fixes #123", make sure it removes skips and/or FIXME comments that reference issue 123. Signed-off-by: Ed Santiago <[email protected]>
7723c0f
to
6764fe0
Compare
/lgtm |
If a PR says "Fixes #123", make sure it removes skips and/or
FIXME comments that reference issue 123.
Signed-off-by: Ed Santiago [email protected]