[Usage collection] Make schema mandatory#79999
Conversation
| default_admin_email: { type: 'text' }, | ||
| }, | ||
| }, | ||
| async fetch(this: Collector<EmailSettingData | undefined>) { |
There was a problem hiding this comment.
TS's fancy way of specifying the expected type for this. It doesn't affect the arguments.
b00f7c8 to
ef8188e
Compare
| public makeStatsCollector = < | ||
| T, | ||
| U, | ||
| O extends CollectorOptions<T, U> = CollectorOptions<T, U> // Used to allow extra properties (the Collector constructor extends the class with the additional options provided) |
There was a problem hiding this comment.
This is to allow x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.ts to send the additional method getEmailValueStructure without TS complaining about it.
The logic inside the Collector class actually allows doing that.
In a follow-up PR I'll update the types inside the Collector class to better define the this context in the isReady, fetch and formatForBulkUpload methods. It requires some mocks to be updated in tests (production logic is good as it is for now), and I don't want to make the scope of this PR explode 🙂
|
Pinging @elastic/kibana-telemetry (Team:KibanaTelemetry) |
chrisronline
left a comment
There was a problem hiding this comment.
LGTM for stack monitoring!
lukeelmers
left a comment
There was a problem hiding this comment.
App arch docs change LGTM (not sure why the generated markdown changed, but I'm not seeing anything concerning)
|
@elasticmachine merge upstream |
|
merge conflict between base and head |
There was a problem hiding this comment.
We were missing the import for UsageCollectorOptions https://github.com/elastic/kibana/pull/79999/files#diff-43996794a7bdd31a9969b85c6512affa813db1959068e18f9921273ac86a473bR23.
Adds `UsageCollectorOptions` to `collector_set.test.ts`
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]distributable file count
History
To update your PR or re-run it, just comment with: |
Co-authored-by: Ahmad Bamieh <ahmadbamieh@gmail.com> Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/usage_collection/server/collector/collector_set.test.ts # x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.ts
…arm-phase-to-formlib * 'master' of github.com:elastic/kibana: [Trigger Actions UI] Properly unmount app (elastic#81436) skip flaky suite (elastic#81576) skip flaky suite (elastic#78373) [Security Solution] Fix styling of EditDataProvider content (elastic#81456) [Search] Error Alignment 2 (elastic#80965) [APM] Unskip test (elastic#81574) [ML] Fix partition value selection on the Single Metric Viewer (elastic#81585) cleaning up expression service types (elastic#80643) Fix suggestions dropdown for query input (elastic#80990) [Usage collection] Make `schema` mandatory (elastic#79999) [ILM] Update show/hide data tier logic on cloud (elastic#81455) added brace import to advanced settings (elastic#81458) chore(NA): add spec-to-console and plugin-helpers as devOnly dependencies
* [Usage collection] Make `schema` mandatory (#79999) Co-authored-by: Ahmad Bamieh <ahmadbamieh@gmail.com> Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.ts * eslint fix Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
|
Pinging @elastic/kibana-core (Team:Core) |
Summary
Now that all the existing collectors have a
schema, let's change the TS definition to enforce every collector to include aschemadefinition (only forUsageCollectors).In addition to that:
CollectorOptionsschemato the still-in-legacy collectorlocalizationin the legacy filesrc/plugins/telemetry/schema/legacy_plugins.json(we might need a follow up issue to move that plugin out of the legacy dir)CollectorOptionsto extend the Collector class.anydue to the issue fixed in the previous pointChecklist
Delete any items that are not applicable to this PR.
For maintainers