-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Usage Collector] Fix schema types to allow arrays #70988
[Usage Collector] Fix schema types to allow arrays #70988
Conversation
Pinging @elastic/kibana-telemetry (Team:KibanaTelemetry) |
Adding @skh for awareness about the fix is almost there :) |
expect(collector).toBeDefined(); | ||
}); | ||
|
||
it('should be OK with arrays returned by fetch but object-schema', () => { |
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 don't understand what the description for this test means. From looking at the test itself, we allow arrays of objects. Translating that to the test description, I get: should be OK with arrays of objects returned by fetch
.
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.
You are right! My intention in the test was to use the Unit Tests as well to catch the TS errors when the object contains array properties. I'll rephrase the description of the test. Sorry for the confusion :)
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'm not a typescript expert but it looks good and works for me 😄
nit: Could we clarify the one test description a bit please?
LGTM
@TinaHeiligers I've changed the test description and also added more test use cases (collector and usage_collector files are now 💯% covered) 🙂 Please, let me know if the new structure and descriptions are easier to understand. |
As far as I can see, this seems to fix my issues: Here's what I did:
The result is here: #71075 |
@elasticmachine merge upstream |
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
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.
Thanks for these explicit test cases!
LGTM
…1123) * [Usage Collector] Fix schema types to allow arrays * More and better tests Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Pinging @elastic/kibana-core (Team:Core) |
Summary
It provides array support to the
schema
.A clear note: it was already supported regarding the actual checks but Types were raising errors in the
MakeSchemaFrom
type definition. This PR should fix those type-related issues.Related to #70180 and #69294
Checklist
Delete any items that are not applicable to this PR.
For maintainers