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

Allowing ports to be string so that they can be variable refs #825

Merged
merged 3 commits into from
Apr 19, 2022

Conversation

juandiegopalomino
Copy link
Collaborator

Description

Safety checklist

  • This change is backwards compatible and safe to apply by existing users
  • This change will NOT lead to data loss
  • This change will NOT lead to downtime who already has an env/service setup

How has this change been tested, beside unit tests?

Manually

@codecov
Copy link

codecov bot commented Apr 15, 2022

Codecov Report

Merging #825 (ffb41ea) into main (a1538fb) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #825   +/-   ##
=======================================
  Coverage   74.06%   74.06%           
=======================================
  Files         119      119           
  Lines        7821     7821           
=======================================
  Hits         5793     5793           
  Misses       2028     2028           
Flag Coverage Δ
unittests 74.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

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

Copy link
Contributor

@bigbitbus bigbitbus left a comment

Choose a reason for hiding this comment

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

Can we add validation on the port numbers whent they are strings? Idea for example - https://stackoverflow.com/questions/12968093/regex-to-validate-port-number

port: int(min=1, max=65535)
service_port: int(min=1, max=65535, required=False)
port: any(int(min=1, max=65535), str(matches='[0-9]*'), required=False)
service_port: any(int(min=1, max=65535), str(matches='[0-9]*'), required=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to limit the string to 65535, or atleast 5 digits at max?

tcp: int(required=False)
grpc: int(required=False)
websocket: int(required=False)
http: any(int(min=1, max=65535), str(matches='[0-9]*'), required=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as above - some validation...

@juandiegopalomino
Copy link
Collaborator Author

@bigbitbus excellent suggestion

@juandiegopalomino juandiegopalomino merged commit b866bbd into main Apr 19, 2022
@juandiegopalomino juandiegopalomino deleted the jd/http-port-string branch April 19, 2022 17:30
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.

2 participants