-
Notifications
You must be signed in to change notification settings - Fork 174
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
[STORY] Add error handling to parseAlphaNumTime #539
Comments
I can pick it up |
go ahead |
Hey @AndrewHess , I had a question with respect to checking the length of the input value. While having a check for "less than 6 characters" makes sense, should there be an upper bound check? Based off of the possible values, the highest it can currently go would be 7 characters "now-90d" but that could change in the future. |
You don't need an upper bound on the length; as long as the string is properly formatted, we should handle it. You could have a check to make sure we don't overflow the return value, but since it's a Also if you want you can remove/refactor that check for less than 6 characters. That's there because we need at least something like |
Hey @AndrewHess , does this need to be assigned to me to open a PR or can I go ahead? |
You can just go ahead
…On Wed, May 15, 2024 at 8:12 PM Goutham K ***@***.***> wrote:
Hey @AndrewHess <https://github.com/AndrewHess> , does this need to be
assigned to me to open a PR or can I go ahead?
—
Reply to this email directly, view it on GitHub
<#539 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAETPJLGFHIHZ6CWLCLKTXDZCP2X3AVCNFSM6AAAAABDV2JLSKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJTGY4DCOBUHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Description
parseAlphaNumTime()
is defined in pkg/ast/pipesearch/searchHandler.go. It converts strings likenow-1h
(meaning one hour before now) to a unix timestamp in milliseconds. However, the code is a little messy and doesn't properly handle invalid cases (e.g., strings likeHello, World!
). You should refactor/comment this code to make it more legible and add error handling.Acceptance Criteria
make pr
from the siglens base directory gives no errorsThe text was updated successfully, but these errors were encountered: