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

[License Management] Create a URL locator #153104

Closed
yuliacech opened this issue Mar 10, 2023 · 1 comment · Fixed by #153792
Closed

[License Management] Create a URL locator #153104

yuliacech opened this issue Mar 10, 2023 · 1 comment · Fixed by #153792
Assignees
Labels
Feature:License Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@yuliacech
Copy link
Contributor

While checking for any "hidden"/implicit dependencies on the License Management plugin, we noticed that a lot of plugins have links that redirect to License Management. We need to create a URL locator so that other plugins could use it instead of a hard coded url. This is also a way to make the dependency on the License Management more explicit. The plugins can either declare the License Management plugin as a required or optional dependency or use share plugin if a direct dependency is not possible.

List of plugins linking to License Management

@yuliacech yuliacech added Feature:License Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Mar 10, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/platform-deployment-management (Team:Deployment Management)

@yuliacech yuliacech self-assigned this Mar 10, 2023
yuliacech added a commit that referenced this issue Mar 31, 2023
## Summary

Fixes #153104
Fixes #153037

This PR adds a URL locator to the License Management plugin that can be
used by other plugins to safely render links to that plugin. An example
of that is implemented in the Watcher plugin.

### How to test
Since there is some logic in the code that disables Watcher if the
license is not valid for that feature, it is actually not very probable
to run into an issue with an invalid license in the UI. But we still can
mock the license status and test the changes of this PR:
1. Start ES with the trial license `yarn es snapshot --license=trial`
and start Kibana `yarn start`.
2. Update this
[file](https://github.com/elastic/kibana/blob/main/x-pack/plugins/watcher/public/application/app.tsx)
to mock an invalid license status: change line 61 to `if (true) {`.
3. Navigate to Watcher to see that there is a link to License
Management.
4. Update this
[file](https://github.com/elastic/kibana/blob/main/x-pack/plugins/watcher/public/application/app.tsx)
to mock an undefined License Management URL locator (imitates that the
License Management plugin is disabled): change line 63 to
`<LicensePrompt message={message} />`.
5. Navigate to Watcher to see that there is not link to License
Management.

#### Screenshots
When the license status is invalid and the License Management plugin is
enabled (not changed)
<img width="1259" alt="Screenshot 2023-03-28 at 14 55 54"
src="https://user-images.githubusercontent.com/6585477/228833667-a96337cc-52c4-40fc-9209-37f7c0adab33.png">

When the license status is invalid and the License Management plugin is
disabled
<img width="1258" alt="Screenshot 2023-03-28 at 14 55 27"
src="https://user-images.githubusercontent.com/6585477/228834043-7aa270ba-92c4-48cd-9c75-3a060e3924eb.png">


### 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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:License Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants