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

Rename Probe implementations to be more idiomatic/brief #248

Merged
merged 3 commits into from
Jul 10, 2024

Conversation

abyrne55
Copy link
Contributor

@abyrne55 abyrne55 commented Jul 8, 2024

What does this PR do?

This PR renames the curl_json package and both the CurlJSON and Legacy probe implementations such that they can be referred to as curl.Probe and legacy.Probe. It also updates all external (to the probe package) references to those types to use the new names.

This change was originally suggested by @AlexVulaj in a comment on an earlier PR, citing the awkwardness of needing to refer to the probe implementations by names like curl_json.CurlJSONProbe. This suggestion is backed up by Effective Go:

The importer of a package will use the name to refer to its contents, so exported names in the package can use that fact to avoid repetition.... For instance, the buffered reader type in the bufio package is called Reader, not BufReader, because users see it as bufio.Reader, which is a clear, concise name.

As for the renaming of curl_json to curl

By convention, packages are given lower case, single-word names; there should be no need for underscores or mixedCaps... And don't worry about collisions a priori.

This PR doesn't cover docs; those will be updated with OSD-24417. Test names are also not covered (although it does update the error messages in the tests) for the sake of timeliness.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 8, 2024
Copy link
Contributor

openshift-ci bot commented Jul 8, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@abyrne55 abyrne55 changed the title Add Probe alias and standardize references Rename Probe implementations to be more idiomatic/brief Jul 10, 2024
@abyrne55 abyrne55 marked this pull request as ready for review July 10, 2024 17:51
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 10, 2024
Copy link
Contributor

openshift-ci bot commented Jul 10, 2024

@abyrne55: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.

Project coverage is 31.18%. Comparing base (705bbe5) to head (4ae48be).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #248   +/-   ##
=======================================
  Coverage   31.18%   31.18%           
=======================================
  Files          12       12           
  Lines        1119     1119           
=======================================
  Hits          349      349           
  Misses        752      752           
  Partials       18       18           
Files Coverage Δ
pkg/probes/curl/curl_json_result.go 96.29% <ø> (ø)
pkg/probes/legacy/legacy.go 89.28% <100.00%> (ø)
pkg/verifier/aws/aws_verifier.go 26.47% <0.00%> (ø)
pkg/probes/curl/curl_json.go 75.94% <50.00%> (ø)

@AlexVulaj
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 10, 2024
@AlexVulaj
Copy link
Contributor

/approve

Copy link
Contributor

openshift-ci bot commented Jul 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlexVulaj

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 10, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 191b26b into openshift:main Jul 10, 2024
6 checks passed
@abyrne55 abyrne55 deleted the probe-alias branch July 10, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants