Skip to content
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

[Logs/Metrics UI] Add deprecated field configuration to Deprecations API #115103

Merged
merged 7 commits into from
Oct 19, 2021

Conversation

Zacqary
Copy link
Contributor

@Zacqary Zacqary commented Oct 14, 2021

Summary

Closes #113166

This PR adds two different types of deprecations for the Source Configuration fields:

  1. A critical deprecation for any fields that are set to a non-default, non-ECS-compliant value, in any source configuration
  2. A warning deprecation for any presence in kibana.yml of xpack.infra.sources.default.fields.{DEPRECATED FIELD KEY}. This is only a warning because these values only affect anything the very first time the user runs Kibana, and don't seem to be able to update the source configuration later on.

Screen Shot 2021-10-14 at 3 58 23 PM

Screen Shot 2021-10-14 at 3 55 38 PM

Screen Shot 2021-10-14 at 3 55 27 PM

To test

Configure deprecated fields

  1. In kibana.dev.yml, set xpack.infra.sources.default.fields.{DEPRECATED FIELD KEY} to a different value. For example, set xpack.infra.sources.default.fields.timestamp to not-@timestamp
  2. Open the source configuration in the settings page, and ensure the field is changed and editable

Check the Upgrade Assistant

  1. Edit lines https://github.com/elastic/kibana/blob/master/x-pack/plugins/upgrade_assistant/public/plugin.ts#L25-L29 to say
const kibanaVersionInfo = {
  currentMajor: kibanaVersion.major - 1,
  prevMajor: kibanaVersion.major - 2,
  nextMajor: kibanaVersion.major,
};
  1. Delete lines https://github.com/elastic/kibana/blob/master/x-pack/plugins/upgrade_assistant/public/application/app.tsx#L35-L37
  2. Navigate to app/management/stack/upgrade_assistant and ensure you see warnings about the deprecated fields.

Checklist

Delete any items that are not applicable to this PR.

@Zacqary Zacqary added Feature:Metrics UI Metrics UI feature Feature:Logs UI Logs UI feature release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed v7.16.0 Epic: Logs & Metrics 8.0 Plan labels Oct 14, 2021
@Zacqary Zacqary marked this pull request as ready for review October 15, 2021 15:48
@Zacqary Zacqary requested a review from a team as a code owner October 15, 2021 15:48
@simianhacker simianhacker self-requested a review October 15, 2021 17:05
Copy link
Member

@simianhacker simianhacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove the actual field names from the translations since those need to remain untranslated. I was going to suggest things like tiebreaker, pod ID, container ID, host name, etc but I can't decide if it's OK to translate those OR not. But the actual literal field names need to remain untranslated.

x-pack/plugins/infra/server/deprecations.ts Outdated Show resolved Hide resolved
x-pack/plugins/infra/server/deprecations.ts Outdated Show resolved Hide resolved
x-pack/plugins/infra/server/deprecations.ts Outdated Show resolved Hide resolved
x-pack/plugins/infra/server/deprecations.ts Outdated Show resolved Hide resolved
x-pack/plugins/infra/server/deprecations.ts Outdated Show resolved Hide resolved
Zacqary and others added 4 commits October 15, 2021 16:59
Co-authored-by: Chris Cowan <chris@chriscowan.us>
…n-api

# Conflicts:
#	x-pack/plugins/infra/server/plugin.ts
@Zacqary Zacqary requested a review from simianhacker October 18, 2021 17:14
@kibanamachine
Copy link
Contributor

kibanamachine commented Oct 18, 2021

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / jest / Jest Tests.src/plugins/dashboard/public/application/hooks.Dashboard container lifecycle Old dashboard container is destroyed when new dashboardId is given

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: Timed out in waitForNextUpdate after 1000ms.
    at Object.waitForNextUpdate (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/@testing-library/react-hooks/lib/core/asyncUtils.js:102:13)
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.test.tsx:167:5)

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@Zacqary Zacqary enabled auto-merge (squash) October 19, 2021 15:45
Copy link
Member

@simianhacker simianhacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Zacqary Zacqary merged commit adbb808 into elastic:master Oct 19, 2021
@kibanamachine
Copy link
Contributor

💔 Backport failed

Status Branch Result
7.x Commit could not be cherrypicked due to conflicts

To backport manually run:
node scripts/backport --pr 115103

jloleysens added a commit to jloleysens/kibana that referenced this pull request Oct 19, 2021
…-link-to-kibana-app

* 'master' of github.com:elastic/kibana: (30 commits)
  Fix potential error from undefined (elastic#115562)
  [App Search, Crawler] Fix validation step panel padding/whitespace (elastic#115542)
  [Cases][Connectors] ServiceNow ITOM: MVP (elastic#114125)
  Change default session idle timeout to 8 hours. (elastic#115565)
  Upgrade EUI to v39.1.1 (elastic#114732)
  [App Search] Wired up organic results on Curation Suggestions view (elastic#114717)
  [i18n] remove i18n html extractor (elastic#115004)
  [Logs/Metrics UI] Add deprecated field configuration to Deprecations API (elastic#115103)
  [Transform] Add alerting rules management to Transform UI (elastic#115363)
  Update UI links to Fleet and Agent docs (elastic#115295)
  [ML] Adding ability to change data view in advanced job wizard (elastic#115191)
  Change deleteByNamespace to include legacy URL aliases (elastic#115459)
  [Unified Integrations] Remove and cleanup add data views (elastic#115424)
  [Discover] Show ignored field values (elastic#115040)
  [ML] Stop reading the ml.max_open_jobs node attribute (elastic#115524)
  [Discover] Improve doc viewer code in Discover (elastic#114759)
  [Security Solutions] Adds security detection rule actions as importable and exportable (elastic#115243)
  [Security Solution] [Platform] Migrate legacy actions whenever user interacts with the rule (elastic#115101)
  [Fleet] Add telemetry for integration cards (elastic#115413)
  🐛 Fix single percentile case when ES is returning no buckets (elastic#115214)
  ...

# Conflicts:
#	x-pack/plugins/reporting/public/management/__snapshots__/report_listing.test.tsx.snap
Zacqary added a commit to Zacqary/kibana that referenced this pull request Oct 19, 2021
…API (elastic#115103)

* [Logs/Metrics UI] Add deprecated field configuration to Deprecations API

* Add correction steps

* Add unit test for source config deprecations

* Apply suggestions from code review

Co-authored-by: Chris Cowan <chris@chriscowan.us>

* Lint fix

Co-authored-by: Chris Cowan <chris@chriscowan.us>
# Conflicts:
#	x-pack/plugins/infra/server/plugin.ts
Zacqary added a commit that referenced this pull request Oct 19, 2021
…API (#115103) (#115633)

* [Logs/Metrics UI] Add deprecated field configuration to Deprecations API

* Add correction steps

* Add unit test for source config deprecations

* Apply suggestions from code review

Co-authored-by: Chris Cowan <chris@chriscowan.us>

* Lint fix

Co-authored-by: Chris Cowan <chris@chriscowan.us>
# Conflicts:
#	x-pack/plugins/infra/server/plugin.ts
github-merge-queue bot pushed a commit that referenced this pull request Nov 7, 2023
…nfiguration code (#169430)

Resolves #168240

### Changes

- Removes `fields.message` from the `infrastructure-ui-source` saved
object who's value was being populated by
`xpack.infra.sources.default.fields.message` from config. See
https://www.elastic.co/guide/en/kibana/master/logs-ui-settings-kb.html
- Removes `getInternalSourceConfiguration` and
`defineInternalSourceConfiguration` functions introduced in
#36066 as I cannot see them being
used anywhere. Stops exposing `defineInternalSourceConfiguration` as
part of server plugin interface.
- Removes `getStaticDefaultSourceConfiguration` from InfraSources class
as we aren't using `sources` from kibana config in source configuration
anymore.
- Removes deprecations warning of removal in 8.0 for other fields
belonging to config xpack.infra.sources.* introduced in
#115103
- Removes `getAllSourceConfigurations` used only in removed deprecations
file
f427278#diff-081721894fc437938eb652beae0a0640ddeee532ec5e48af1f3093c8074f1eecL195
- Removed `getAllSavedSourceConfigurations` only used in
`getAllSourceConfigurations`

### How to test 
- `infrastructure-ui-source` saved object no longer has `fields`
attributes
- in kibana.yml set `xpack.infra.sources.default.fields.message:
['testmessage', '@testmessage']`
  - go to Infra -> Settings
  - Change the name and save the form
- view the `infrastructure-ui-source` saved object and no `fields`
attribute should exist (unless it previously existed in an already
existing `infrastructure-ui-source` saved object
- changes do not affect`fields.message` is used in logs_shared plugin
- i'm not sure how to easily test this and relying on someone with more
Logs knowledge to help out, but from what I can see logs accesses the
config directly (`xpack.infra.sources.default.fields.message`) and never
uses the saved object field being removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Epic: Logs & Metrics 8.0 Plan Feature:Logs UI Logs UI feature Feature:Metrics UI Metrics UI feature release_note:skip Skip the PR/issue when compiling release notes v7.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Logs UI] [Metrics UI] Register deprecations for field configurations
3 participants