Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Respond PortsStatus with sorted ports #13788
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
Respond PortsStatus with sorted ports #13788
Changes from all commits
64c0798
137363e
54f0678
2569216
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is it something only for internal usage of supervisor? I don’t think we should have such property here then. These are types for gitpod config.
cc @mustard-mh could you remove it to avoid confusion please
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.
Could we instead return an ordered list and avoid specifying the sort order as a property on a map of items?
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 want to do it too (my first implement), but we have ranged ports (i.e.
3000-5000
), if someone defined it with large range, the array will be very large tooThere 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.
Is this a concern around the number of bytes needed to store or some other size? I'd expect that the resulting size in bytes would be nearly identical, we're storing n items in both cases.
The extra property of Index probably costs us more as its repeated on each item as opposed to have the sorting implicit which is what a list would do.
Anyhow, just to wanted to flag this up as it felt odd.
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.
With
Sort
property defined, we don't need anything.But if we use a new variable like
SortedPorts
array, it will contain100001
items. Or, you need to check if this port number is inside this range or not everytime, it makes code harder to read and wastes resources while getting the ports listThere 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.
We could store it as
Which would give us the same result.
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.
It's this case
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.
Let's leave it open, and make it a follow-up PR if we are going to change it.
cc @akosyakov @iQQBot