-
Notifications
You must be signed in to change notification settings - Fork 612
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
Bug 2021205: fix git url change validation #10769
Bug 2021205: fix git url change validation #10769
Conversation
@abhinandan13jan: This pull request references Bugzilla bug 2021205, which is invalid:
Comment In response to this:
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/test-infra repository. |
/kind bug |
/bugzilla refresh |
@abhinandan13jan: This pull request references Bugzilla bug 2021205, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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/test-infra repository. |
6eee15a
to
2235291
Compare
@abhinandan13jan: This pull request references Bugzilla bug 2021205, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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/test-infra repository. |
/lgtm |
/test e2e-gcp-console |
/assign |
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.
2235291
to
a67a22c
Compare
@abhinandan13jan: This pull request references Bugzilla bug 2021205, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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/test-infra repository. |
} | ||
|
||
if ( | ||
detectedGitType === GitTypes.github || | ||
detectedGitType === GitTypes.gitlab || | ||
detectedGitType === GitTypes.bitbucket | ||
) { |
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 also if we compare it to "not unsure" (aka sure) instead of list all (currently) known Git provider?
You can optional add the && showGitTypes so that setFieldValue
is not called if it's already false.
} | |
if ( | |
detectedGitType === GitTypes.github || | |
detectedGitType === GitTypes.gitlab || | |
detectedGitType === GitTypes.bitbucket | |
) { | |
} else if (detectedGitType !== GitTypes.unsure && values.git.showGitType) { |
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 am now using a cleaner approach to the problem. Updated
gitType as any, | ||
detectedGitType as any, |
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'm not sure, but is this change really needed? Doesn't it make sense to use the selected type if we show this dropdown option?
Sorry, but I'm now even more sure that this is not what we want here. If the user selects a git provider for a custom domain we should his/her selection instead of the latest detection.
For example when the user enters https://git.mycomapny.com and selects GitLab and changes the repo name again we should still use GitLab to detect the import strategies.
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.
Updated
Works better. I unhold this if someone else will take a look. I added two questions and will take a deeper look later. /unhold |
@abhinandan13jan: This pull request references Bugzilla bug 2021205, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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/test-infra repository. |
a67a22c
to
c619932
Compare
/test e2e-gcp-console |
/lgtm |
/retest |
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.
Hi @abhinandan13jan, cc @karthikjeeyar,
the reason my review takes so long was that I'm not happy that handleGitUrlChange
was now called twice when switching from an invalid to a valid git URL.
This happen because const handleGitUrlChange = React.useCallback(...
updates the git type in line 252. The useEffect
in line 421 then calls the same handleGitUrlChange
again with a debounce.
I think we could fix it by cleaning the touched info when we automatically override the git.type
in line 251. See suggestion below.
Did you see any reasons, not to do this? IMHO this works only because the useEffect
has a (for me not really understandable) condition for different "touched" fields. Btw: I'm not a fan of this solution and that the InputField onChange, this callback, and the effect works so closely together, but that is something we should maybe cleanup in the future.
if (gitType !== values.git.type) { | ||
setFieldValue('git.type', gitType); | ||
} |
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.
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.
Thanks for the feedback, I updated accordingly :)
@abhinandan13jan @karthikjeeyar I replace Karthiks lgtm with my approval so that you can update this on Monday without my additional review. But I will do it if needed. I hope that's fine for you both. If you both agree that we can not apply my recommendation, Karthik can just re-add his lgtm. 😄 /lgtm cancel |
@abhinandan13jan I agree with Christoph's concern, we should try avoid multiple calls for git detection. Please update the PR. Thanks @jerolimov for the review and highlighting the issue with multiple network calls, which I overlooked. However I feel as reviewers we should not give lgtm / approve unless we are satisfied with the changes. |
c619932
to
c0eb4c5
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinandan13jan, jerolimov, karthikjeeyar 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 |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
@abhinandan13jan: 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/test-infra repository. I understand the commands that are listed here. |
@abhinandan13jan: All pull requests linked via external trackers have merged: Bugzilla bug 2021205 has been moved to the MODIFIED state. In response to this:
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/test-infra repository. |
Addresses
https://issues.redhat.com/browse/OCPBUGSM-36949
https://bugzilla.redhat.com/show_bug.cgi
Issue
Reads
gitType
instead ofdetectedGitType
Screenshots
Tests
no change
Browser conformance
Chrome / Firefox