Inconsistent behavior of getMilliseconds with cel-spec
Describe the bug
The getMilliseconds behavior matches user expectations but does not match cel-spec. Eventually this function will be deprecated and the spec revised in favor of a function that matches user expectations.
To Reproduce Check which components this affects:
- [ ] parser
- [ ] checker
- [X] interpreter
Sample expression and input that reproduces the issue:
// Returns 23ms rather than converting the value to 1023.
duration("1s23ms").getMilliseconds()
Test setup: See https://github.com/google/cel-spec/pull/206 for more context on how to test this functionality.
Expected behavior The function returns the milliseconds component of the duration.
I looked into this issue and figured that duration.go#overloads.TimeGetMilliseconds and duration_test.go#TestDurationGetMilliseconds shall require the changes. If this issue is not assigned yet, can I take a stab at this? I believe this would be an excellent opportunity for me to start contributing here.
@kunaltawatia The existing behavior should be moved to a new function, but we have yet to finalize the name of the function. I'll follow up here once the new function name is identified and if you're still interested, you are welcome to work on it.
Sure, that'd not be a problem. Curious, Is the change of name required to avoid regression, or are there any other reasons?