-
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 collection] Make schema
mandatory
#79999
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
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.
LGTM for stack monitoring!
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were missing the import for UsageCollectorOptions
https://github.com/elastic/kibana/pull/79999/files#diff-43996794a7bdd31a9969b85c6512affa813db1959068e18f9921273ac86a473bR23.
Adds `UsageCollectorOptions` to `collector_set.test.ts`
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.
LGTM
@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 <[email protected]> Co-authored-by: Christiane (Tina) Heiligers <[email protected]> Co-authored-by: Kibana Machine <[email protected]> # 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 <[email protected]> Co-authored-by: Christiane (Tina) Heiligers <[email protected]> Co-authored-by: Kibana Machine <[email protected]> # Conflicts: # x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.ts * eslint fix Co-authored-by: Alejandro Fernández Haro <[email protected]>
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 aschema
definition (only forUsageCollectors
).In addition to that:
CollectorOptions
schema
to the still-in-legacy collectorlocalization
in 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)CollectorOptions
to extend the Collector class.any
due to the issue fixed in the previous pointChecklist
Delete any items that are not applicable to this PR.
For maintainers