-
Notifications
You must be signed in to change notification settings - Fork 217
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
feat: Datetime constraint #1602
Conversation
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.
Change looks good from my end.
One thing to call out is that we should do the release dance of rpc/flipt
and then sdk/go
once that is bumped.
* main: chore(deps): bump alpine from 3.17.3 to 3.18.0 in /build (#1603) chore: increasing test coverage to 80%
Codecov Report
@@ Coverage Diff @@
## main #1602 +/- ##
==========================================
+ Coverage 81.08% 81.23% +0.15%
==========================================
Files 47 47
Lines 3786 3827 +41
==========================================
+ Hits 3070 3109 +39
- Misses 550 552 +2
Partials 166 166
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
…o/flipt into datetime-constraint-redo * 'datetime-constraint-redo' of https://github.com/flipt-io/flipt: chore(deps): update all otel metrics related packages (#1628) chore(deps-dev): bump vite from 4.3.5 to 4.3.7 in /ui (#1627) chore(deps-dev): bump @types/node from 18.16.10 to 18.16.12 in /ui (#1626)
…o/flipt into datetime-constraint-redo * 'datetime-constraint-redo' of https://github.com/flipt-io/flipt: chore(deps): bump react-router-dom from 6.11.1 to 6.11.2 in /ui (#1629)
…o/flipt into datetime-constraint-redo * 'datetime-constraint-redo' of https://github.com/flipt-io/flipt: chore(deps-dev): bump @types/node from 18.16.12 to 18.16.13 in /ui (#1630) chore(deps-dev): bump vite from 4.3.7 to 4.3.8 in /ui (#1631)
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.
Very sweet 👌 Couple tiny cleanup things. Otherwise, this looks great.
internal/server/evaluator.go
Outdated
return false, err | ||
} | ||
|
||
// TODO: we should consider parsing this at creation time since it doesn't change and it doesnt make sense to allow invalid constraint values |
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 think you can drop this comment now?
// TODO: we should consider parsing this at creation time since it doesn't change and it doesnt make sense to allow invalid constraint values |
// we know that a value is set and that the type is datetime | ||
// so validate that the value is a valid datetime | ||
// also convert it to UTC before we save | ||
// TODO: don't love that we are doing this here |
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.
+1 in the future maybe we move this next to the service/server layer.
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.
Nice one
* main: chore(deps): bump go.opentelemetry.io/otel/exporters/jaeger (#1640) chore(deps-dev): bump eslint from 8.40.0 to 8.41.0 in /ui (#1634) chore(deps-dev): bump @playwright/test from 1.33.0 to 1.34.0 in /ui (#1632) chore(deps): bump github.com/cloudflare/circl in /build (#1607) chore: ignore playwright-report not existing (#1643) chore: fix ui lint issue with constraint form feat: Datetime constraint (#1602) chore(deps): bump github.com/lib/pq from 1.10.8 to 1.10.9 (#1638) chore(deps): bump github.com/coreos/go-oidc/v3 from 3.5.0 to 3.6.0 (#1639) chore(deps): bump golang.org/x/sync from 0.1.0 to 0.2.0 (#1641) chore(deps): bump golang.org/x/tools from 0.8.0 to 0.9.1 in /_tools (#1616) chore(deps): bump codecov/codecov-action from 3.1.3 to 3.1.4 (#1636) chore(deps-dev): bump @types/node from 18.16.13 to 18.16.14 in /ui (#1633) chore(deps-dev): bump @typescript-eslint/parser in /ui (#1620) chore(deps-dev): bump @types/node from 18.16.12 to 18.16.13 in /ui (#1630) chore(deps-dev): bump vite from 4.3.7 to 4.3.8 in /ui (#1631) chore(deps): bump react-router-dom from 6.11.1 to 6.11.2 in /ui (#1629) chore(deps): update all otel metrics related packages (#1628) chore(deps-dev): bump vite from 4.3.5 to 4.3.7 in /ui (#1627) chore(deps-dev): bump @types/node from 18.16.10 to 18.16.12 in /ui (#1626)
Fixes: FLI-206
Adds new DateTime constraint type + UI
time.RFC3339
("2006-01-02T15:04:05Z07:00"
) ortime.Date
("2006-01-02"
)Screens
DateTime Constraint
Preferences / Display
TODO