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

[Reporting] standardize internal config passing to use a simple object #157118

Merged
merged 14 commits into from
May 15, 2023

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented May 9, 2023

Summary

Remove a complex type of object that was used to pass around config settings, that was in place to follow code patterns from the old Kibana platform.

Addresses https://github.com/elastic/kibana/pull/155081/files#r1188025616

Checklist

  • Unit or functional tests were updated or added to match the most common scenarios
  • Ensure hostname 0.0.0.0 is re-written to localhost and warning logs are working correctly

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

Risk Probability Severity Mitigation/Notes
Regression in xpack.reporting.kibanaServer yml settings Low Med Reporting sometimes needs a URL to the Kibana server. The necessary protocol/hostname/port needed build the URL is sourced from kibana.yml settings under server.*, but can be overridden using settings in xpack.reporting.kibanaServer. This feature exists because the headless Chromium browser sometimes must connect to a proxy that Kibana otherwise doesn't know about.

For maintainers

@tsullivan tsullivan added the release_note:skip Skip the PR/issue when compiling release notes label May 9, 2023
@tsullivan tsullivan requested a review from rshen91 May 9, 2023 02:29
@rshen91
Copy link
Contributor

rshen91 commented May 9, 2023

Looking at the test failure - it seems that the API_BASE_URL in x-pack/plugins/reporting/common/constants/index.ts has a leading '/' - is it ok to just update the test?

I'm not sure why that wasn't failing before these changes. 🤔

Copy link
Contributor

@rshen91 rshen91 left a comment

Choose a reason for hiding this comment

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

I like that we're able to remove the level of abstraction of the kbnConfig and ReportingConfigType. Thank you for going through these changes 🙇🏻

I think the test failure can just be changed? I tested it and didn't see it affecting other tests by adding the leading slash but also was hesitant to push my changes onto this branch - I might try some roundabout PR request onto this for my own learning :face_palm:

@tsullivan
Copy link
Member Author

Looking at the test failure - it seems that the API_BASE_URL in x-pack/plugins/reporting/common/constants/index.ts has a leading '/' - is it ok to just update the test?

Yes, I also think that's the best way to move forward. 👍🏻

I'm not sure why that wasn't failing before these changes. 🤔

I think there was something wrong about the HTTP mocks used in reporting tests in the previous code. Somehow I fixed it, and now the tests a mistake that was in the previous code.

Unfortunately, I didn't catch this before filing this PR - which I usually try to do.

@tsullivan tsullivan changed the title [Reporting] refactor the means of passing config settings internally [Reporting] standardize internal config passing to use a simple object May 9, 2023
@tsullivan tsullivan marked this pull request as ready for review May 9, 2023 17:24
@tsullivan tsullivan requested a review from a team as a code owner May 9, 2023 17:24
@tsullivan tsullivan requested review from sebelga and Dosant May 9, 2023 23:57
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 400 404 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 480 484 +4
total +6

History

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

Copy link
Contributor

@sebelga sebelga left a comment

Choose a reason for hiding this comment

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

LGTM 👍

sebelga

This comment was marked as duplicate.

sebelga

This comment was marked as duplicate.

@tsullivan tsullivan merged commit f95ff49 into elastic:main May 15, 2023
@tsullivan tsullivan deleted the reporting/refactor-config branch May 15, 2023 19:32
@kibanamachine kibanamachine added v8.9.0 backport:skip This commit does not require backporting labels May 15, 2023
jasonrhodes pushed a commit that referenced this pull request May 17, 2023
#157118)

## Summary

Remove a complex type of object that was used to pass around config
settings, that was in place to follow code patterns from the old Kibana
platform.

Addresses
https://github.com/elastic/kibana/pull/155081/files#r1188025616

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Ensure hostname `0.0.0.0` is re-written to `localhost` and warning
logs are working correctly

### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Regression in `xpack.reporting.kibanaServer` yml settings | Low | Med
| Reporting sometimes needs a URL to the Kibana server. The necessary
protocol/hostname/port needed build the URL is sourced from kibana.yml
settings under `server.*`, but can be overridden using settings in
`xpack.reporting.kibanaServer`. This feature exists because the headless
Chromium browser sometimes must connect to a proxy that Kibana otherwise
doesn't know about. |

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
@tsullivan tsullivan added the Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) label May 17, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

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:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants