fix: better source validation and refine required source fields#1895
fix: better source validation and refine required source fields#1895kodiakhq[bot] merged 21 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: a48ca67 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR ReviewGood overall design — the discriminated union approach is sound and the backward-compatibility tests for Session sources are a nice touch. Critical / Must-fix:
Minor quality issues:
|
E2E Test Results✅ All tests passed • 91 passed • 3 skipped • 992s
Tests ran across 4 shards in parallel. |
pulpdrew
left a comment
There was a problem hiding this comment.
Massive improvement! Just a couple questions and minor suggestions
## Summary Large refactor changing the TSource type to a true discriminated union. This means that the expected fields for `kind: 'log'` will differ from those for `'trace', 'session', 'metrics'`. This avoids the current laissez faire source type that currently exists, and required extensive changes across the api and app packages. Also includes a nice addition to `useSource` - you can now specify a `kind` field, which will properly infer the type of the returned source. This also makes use of discriminators in mongoose. This does change a bit of the way that we create and update sources. Obvious changes to sources have also been made, namely making `timeValueExpression` required on sources. Care has been taken to avoid requiring a migration. ### How to test locally or on Vercel 1. `yarn dev` 2. Play around with the app, especially around source creation, source edits, and loading existing sources from a previous version ### References - Linear Issue: References HDX-3352 - Related PRs: Ref: HDX-3352
## Summary Large refactor changing the TSource type to a true discriminated union. This means that the expected fields for `kind: 'log'` will differ from those for `'trace', 'session', 'metrics'`. This avoids the current laissez faire source type that currently exists, and required extensive changes across the api and app packages. Also includes a nice addition to `useSource` - you can now specify a `kind` field, which will properly infer the type of the returned source. This also makes use of discriminators in mongoose. This does change a bit of the way that we create and update sources. Obvious changes to sources have also been made, namely making `timeValueExpression` required on sources. Care has been taken to avoid requiring a migration. ### How to test locally or on Vercel 1. `yarn dev` 2. Play around with the app, especially around source creation, source edits, and loading existing sources from a previous version ### References - Linear Issue: References HDX-3352 - Related PRs: Ref: HDX-3352 Co-authored-by: peter-leonov-ch <209667683+peter-leonov-ch@users.noreply.github.com>
Summary
Large refactor changing the TSource type to a true discriminated union. This means that the expected fields for
kind: 'log'will differ from those for'trace', 'session', 'metrics'. This avoids the current laissez faire source type that currently exists, and required extensive changes across the api and app packages. Also includes a nice addition touseSource- you can now specify akindfield, which will properly infer the type of the returned source.This also makes use of discriminators in mongoose. This does change a bit of the way that we create and update sources. Obvious changes to sources have also been made, namely making
timeValueExpressionrequired on sources. Care has been taken to avoid requiring a migration.How to test locally or on Vercel
yarn devReferences
Ref: HDX-3352