[Usage Collector] Fix schema types to allow arrays#70988
[Usage Collector] Fix schema types to allow arrays#70988afharo merged 3 commits intoelastic:masterfrom
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.
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.
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 :)
TinaHeiligers
left a comment
There was a problem hiding this comment.
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: |
TinaHeiligers
left a comment
There was a problem hiding this comment.
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
MakeSchemaFromtype 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