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

[Infra UI] Removed unused saved object attribute and unused source configuration code #169430

Merged
merged 7 commits into from
Nov 7, 2023

Conversation

neptunian
Copy link
Contributor

@neptunian neptunian commented Oct 19, 2023

Resolves #168240

Changes

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 affectfields.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.

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@neptunian neptunian force-pushed the 168240-cleanup-unused-code branch from 28c9187 to a7997ec Compare October 31, 2023 10:05
@neptunian neptunian changed the title [Infra UI] Removed unused code [Infra UI] Removed unused saved object attribute and unused source configuration code Oct 31, 2023
updatedSourceConfiguration.configuration
),
};
}

private async getStaticDefaultSourceConfiguration() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this function looked for sources field in the kibana infra config and returned it as part of source configuration. It merges it with "default configuration". we can remove this function and just get the default configuration since we aren't using sources from config in our source configuration anymore.

@neptunian neptunian force-pushed the 168240-cleanup-unused-code branch from 1f6040e to db33848 Compare October 31, 2023 17:43
@@ -50,42 +50,9 @@ describe('the InfraSources lib', () => {
});
});

test('adds missing attributes from the static configuration to a source configuration', async () => {
Copy link
Contributor Author

@neptunian neptunian Oct 31, 2023

Choose a reason for hiding this comment

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

this is testing for kibana config values in sources field, which is no longer supported as part of source configuration. I assume at some point in the past metricAlias and logsIndices was able to be set in the kibana config from looking at this test. Under xpack.infra.sources.default.metricAlias, etc.

@neptunian neptunian marked this pull request as ready for review October 31, 2023 18:15
@neptunian neptunian requested a review from a team as a code owner October 31, 2023 18:15
@neptunian neptunian added the Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team label Oct 31, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@neptunian neptunian added the release_note:skip Skip the PR/issue when compiling release notes label Oct 31, 2023
@neptunian neptunian marked this pull request as draft October 31, 2023 18:29
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
infra 39 36 -3

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
infra 11 10 -1
Unknown metric groups

API count

id before after diff
infra 42 39 -3

History

  • 💛 Build #172307 was flaky 1f6040e2547c7352a2b33aea722c1c545a0526cd
  • 💔 Build #172158 failed 608cf1c95d35fe29fa3f83dcfd83ba30e166731d
  • 💔 Build #172137 failed a7997ec35491f8ec41e0251927f99dd90d9399aa
  • 💔 Build #169679 failed 28c91871fca36eb1f70ac3540010c91fe3bbe5e2
  • 💔 Build #169593 failed 250e60f42f08c2d63e3a74637a64ad761074625b

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

@neptunian neptunian marked this pull request as ready for review November 1, 2023 16:42
@crespocarlos crespocarlos self-requested a review November 3, 2023 08:38
Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

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

Looks good.

I tested it against a clean local ES cluster, and the fields.message attribute is gone.

However, I still see it on my oblt-cli cluster, even after saving the infra settings form.

image

Is this also supposed to remove it from existent saved objects too?

@neptunian
Copy link
Contributor Author

@crespocarlos Thanks. You're correct and I updated the testing instructions to expect it to still exist if it already existed on the saved object. I am thinking to not bother removing it and new objects created will no longer have it.

@neptunian neptunian added this pull request to the merge queue Nov 7, 2023
Merged via the queue into elastic:main with commit ea7ae45 Nov 7, 2023
4 checks passed
@neptunian neptunian deleted the 168240-cleanup-unused-code branch November 7, 2023 12:21
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Infra UI] Removed unused saved object field
6 participants