Skip to content
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

scripts: remove receiver name check #19085

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

ivanvc
Copy link
Member

@ivanvc ivanvc commented Dec 19, 2024

This check is duplicated as the project uses revive's receiver-naming:

- name: receiver-naming
severity: error
disabled: false

Which is more robust, as the current check may have false positives.

Because golangci-lint runs before verify-receiver-name it captures the error first (refer to the prow job from the test pull request #19084), so this check is unnecessary. Moreover, the current implementation has false positives, as it doesn't detect the issue in that pull request because of a very lax regular expression:

make verify-receiver-name
PASSES="receiver_name" ./scripts/test.sh
Running with --race
Starting at: Wed Dec 18 10:53:16 PM PST 2024

'receiver_name' started at Wed Dec 18 10:53:16 PM PST 2024
'receiver_name' PASSED and completed at Wed Dec 18 10:53:18 PM PST 2024
SUCCESS

The problem is that it skips anything with an underscore in the test string. Because filenames may have underscores, it doesn't scan them. The problematic line is grep -Ev "(Descriptor|Proto|_)":

grep -Ev "(Descriptor|Proto|_)" | awk ' { print $3" "$4 } ' | sort | uniq -c | grep -v ' 1 ' | awk ' { print $2 } ')

However, because this check duplicates revive's linter, it doesn't make sense to fix it. It makes more sense to remove this check.

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

This check is duplicated as the project uses revive's receiver-naming,
which is more robust, as the current check may have false positives.

Signed-off-by: Ivan Valdes <[email protected]>
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.76%. Comparing base (b531071) to head (d2d1678).
Report is 2 commits behind head on main.

Additional details and impacted files

see 25 files with indirect coverage changes

@@           Coverage Diff           @@
##             main   #19085   +/-   ##
=======================================
  Coverage   68.75%   68.76%           
=======================================
  Files         420      420           
  Lines       35640    35640           
=======================================
+ Hits        24506    24509    +3     
+ Misses       9705     9701    -4     
- Partials     1429     1430    +1     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b531071...d2d1678. Read the comment docs.

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ivanvc, serathius

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@serathius serathius merged commit 21021b2 into etcd-io:main Dec 19, 2024
34 checks passed
@ivanvc ivanvc deleted the remove-receiver-name-check branch December 19, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants