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

CNV-39781: search by mac address #98

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

upalatucci
Copy link
Collaborator

Screenshot from 2024-03-22 12-21-39

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Mar 22, 2024

@upalatucci: This pull request references CNV-39781 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "4.16.0" version, but no target version was set.

In response to this:

Screenshot from 2024-03-22 12-21-39

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from avivtur and hstastna March 22, 2024 11:22
@upalatucci upalatucci force-pushed the search-by-mac branch 2 times, most recently from 6019c20 to f5fe99a Compare March 22, 2024 13:56
Copy link
Collaborator

@avivtur avivtur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good :)
just a small comment

) => {
if (!searchMACAddress) return true;

return iface?.['mac-address']?.includes(searchMACAddress) || false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use FILTER_TYPES.MAC_ADDRESS constant
and the || false can be omitted

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought here to return false instead of undefined if there is no mac-address

the FILTER_TYPES.MAC_ADDRESS does not have anything to do with the mac-address property. It's the filter id :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you got the first if, which will return true when searchMACAddress is undefined or empty, btw I would use isEmpty there, since this is covered in the first if, the || false should be redundant, please check

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the || false is if the interface has no mac address. It's not covered by the first if. It's a different obj.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avivtur fixed the first if using isEmpty

@openshift-ci openshift-ci bot added the lgtm label Mar 25, 2024
Copy link
Contributor

openshift-ci bot commented Mar 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hstastna, upalatucci

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

@avivtur
Copy link
Collaborator

avivtur commented Mar 25, 2024

/hold

@avivtur
Copy link
Collaborator

avivtur commented Mar 25, 2024

/lgtm

@upalatucci
Copy link
Collaborator Author

/unhold

@openshift-merge-bot openshift-merge-bot bot merged commit ae25a9b into nmstate:main Mar 25, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants