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

Label Key validation on Deploy page #492

Merged
merged 1 commit into from
Mar 4, 2016

Conversation

digitalfishpond
Copy link
Contributor

Validation on Deploy Page: Labels -> Label Key
separate validation for pattern of prefix (before forward slash if there is one) and name (after forward slash if there is one present, or entire string if not), and for string length of each.
Only one slash is permitted (consistent with backend validation)

validation for 'value' will be in a separate PR.

Review on Reviewable

@codecov-io
Copy link

Current coverage is 83.57%

Merging #492 into master will increase coverage by +0.39% as of a31c270

@@            master    #492   diff @@
======================================
  Files           84      84       
  Stmts          678     694    +16
  Branches         0       0       
  Methods          0       0       
======================================
+ Hit            564     580    +16
  Partial          0       0       
  Missed         114     114       

Review entire Coverage Diff as of a31c270

Powered by Codecov. Updated on successful CI builds.

@bryk
Copy link
Contributor

bryk commented Mar 4, 2016

Very nice. Thanks for good tests :) A few comments. PTAL


Reviewed 2 of 4 files at r1.
Review status: 2 of 4 files reviewed at latest revision, 4 unresolved discussions.


src/app/frontend/deploy/deploylabel_controller.js, line 92 [r1] (raw file):
This comment is now false. Remove?


src/app/frontend/deploy/deploylabel_controller.js, line 97 [r1] (raw file):
This does not validate key anymore. This does a lot more.


src/app/frontend/deploy/deploylabel_controller.js, line 100 [r1] (raw file):
Hey, can you move all this code to a validator directive? To have single responsibility classes. This should be very easy. Check out how it is done in other files.

CC @floreks


src/app/frontend/deploy/deploylabel_controller.js, line 201 [r1] (raw file):
Use ' for strings. This is to be consistent across the codebase.


Comments from the review on Reviewable.io

@digitalfishpond
Copy link
Contributor Author

src/app/frontend/deploy/deploylabel_controller.js, line 100 [r1] (raw file):
maciaszczykm is sick and @floreks is on leave until Tuesday and I'm not sure how to start -- is there a particular directive you had in mind that would illustrate what should happen here?


Comments from the review on Reviewable.io

@digitalfishpond
Copy link
Contributor Author

src/app/frontend/deploy/deploylabel_controller.js, line 97 [r1] (raw file):
It still only validates key, but now there are more conditions that it is checking than before. Everything in this function is directly involved with validating Key input.


Comments from the review on Reviewable.io

@digitalfishpond
Copy link
Contributor Author

src/app/frontend/deploy/deploylabel_controller.js, line 92 [r1] (raw file):
:) Thanks! I will update


Comments from the review on Reviewable.io

@digitalfishpond
Copy link
Contributor Author

src/app/frontend/deploy/deploylabel_controller.js, line 100 [r1] (raw file):
I've found validprotocol_directive.js. I will use as example.


Comments from the review on Reviewable.io

@digitalfishpond
Copy link
Contributor Author

src/app/frontend/deploy/deploylabel_controller.js, line 100 [r1] (raw file):
@bryk label key validation now has five distinct parts (each with separate messages) and some depend on shared values (such as whether the string contains a slash or not). Refactoring this code to directive would require five new directives (each related to a different message in the html) and a proper tangle of shared values... should I get started? Or shall I add a TODO so that I can have a chance to sort out validation for Label Value in time for Monday?


Comments from the review on Reviewable.io

@digitalfishpond digitalfishpond force-pushed the label-key-validation branch 2 times, most recently from e3ee711 to 94bda93 Compare March 4, 2016 12:35
@bryk
Copy link
Contributor

bryk commented Mar 4, 2016

Review status: 2 of 4 files reviewed at latest revision, 4 unresolved discussions.


src/app/frontend/deploy/deploylabel_controller.js, line 100 [r1] (raw file):
Yes this is a good idea, add a TODO and create issue and do this after Mondey :)

Let me know when ready for rereview.


Comments from the review on Reviewable.io

@digitalfishpond digitalfishpond force-pushed the label-key-validation branch 2 times, most recently from 218d3a7 to b546ce3 Compare March 4, 2016 12:45
@digitalfishpond
Copy link
Contributor Author

@bryk PTAL


Comments from the review on Reviewable.io

@bryk
Copy link
Contributor

bryk commented Mar 4, 2016

Last comment and let's merge.


Reviewed 1 of 1 files at r4.
Review status: 3 of 4 files reviewed at latest revision, 1 unresolved discussion.


src/app/frontend/deploy/deploylabel.html, line 24 [r4] (raw file):
Wording: change prefix eg. my-domain.com to prefix. Example value: my-domain.com. (or something similar to separate sentences). This would be cleaner.


Comments from the review on Reviewable.io

@digitalfishpond
Copy link
Contributor Author

@digitalfishpond
Copy link
Contributor Author

Changed :) I avoided the word 'value' to avoid confusion with the 'value' field next to this 'key' field.
PTAL


Comments from the review on Reviewable.io

@bryk
Copy link
Contributor

bryk commented Mar 4, 2016

Reviewed 1 of 1 files at r5.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


src/app/frontend/deploy/deploylabel.html, line 24 [r4] (raw file):
Awesome, thanks!


Comments from the review on Reviewable.io

bryk added a commit that referenced this pull request Mar 4, 2016
@bryk bryk merged commit dcf6d6a into kubernetes:master Mar 4, 2016
@digitalfishpond digitalfishpond deleted the label-key-validation branch April 12, 2016 10:44
anvithks pushed a commit to anvithks/k8s-dashboard that referenced this pull request Sep 27, 2021
Fixed alerts view in storage details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants