-
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
Context-aware documentation links for Serverless #167088
Comments
Pinging @elastic/kibana-core (Team:Core) |
Currently there are two main benefits of the docLinks service:
So I'd be inclined to try for a solution that's closer to option How this actually works behind the scenes is an implementation detail which I'll let others on the team weigh in on. Maybe we have a separate list of serverless URLs that "override" known keys on startup. Or maybe we restructure our list of URLs to have a way to store both serverless & non-serverless variants which can be picked up by the service accordingly. What I think is important is avoiding pushing this complexity down to the individual plugin level, because otherwise we are just asking to have more unnecessary |
I agree with Luke in that we shouldn't push complexity down to the plugin level. Thinking along the same lines as option (b) sounds like a better solution than creating a new service to pretty much do the same thing as the existing one and because Kibana can only run in one environment: either it's serverless or not. One thing I'm not sure about is if the doclinks become static after Kibana's built. If they are, then perhaps using the environment for which we build Kibana's an option? |
I agree. I think we could fairly easily adapt the docLink service and the underlying kibana/packages/kbn-doc-links/src/get_doc_links.ts Lines 13 to 18 in fe22ff0
That way, we could just change the urls of existing link depending on the environment (serverless or not). E.g instead of this line:
We could have
Regarding adding new doc link entries that would be specific to serverless (not used in traditional), I would simply add them to the Overall, keeping a single interface and a single implementation seems the best for everyone (consumers don't need to change anything, and also easiest maintaining the docLinks provider ihmo). There's a minor detail of sending this "isServerless" flag to the UI within core service, given the docLinks service is instantiated both on browser and server, and the "isServerless" info is, AFAIK, not directly sent to the browser atm, but that doesn't sound like anything that could be a problem. If we're all fine with the idea, and if it's already a pain point for the doc team, I can probably take a shot at implementing it next week or so. |
What is the status on this effort? |
I apologize, the lack of replies caused the issue to not surface back in my notifications 😅, so it never got prioritized. I'll take the thumbs up as a go, and I'll start working on this asap. |
Thanks @pgayvallet ! As soon as support for this type of condition is added, I'm happy to take the work of updating all the existing links in the list. If there's anything else I can do to help, just lmk! |
I just opened #172358 for review. I'll notify on this issue once merged |
Hey @pgayvallet. Not sure if we have a lot of these cases yet, but I'm wondering if we could consider pushing the "context awareness" to solution types for serverless? I think in the docs there are (or will be) features where:
cc @lcawl |
## Summary Fix #167088 Add a new `buildFlavor` (`traditional` | `serverless`) parameter to `getDocLinks` and `getDocLinksMeta` so that the doc links generator logic can leverage the information --------- Co-authored-by: kibanamachine <[email protected]>
## Summary Fix elastic#167088 Add a new `buildFlavor` (`traditional` | `serverless`) parameter to `getDocLinks` and `getDocLinksMeta` so that the doc links generator logic can leverage the information --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit c50f3d7)
…173135) # Backport This will backport the following commits from `main` to `8.12`: - [[doclinks] propagate build flavor to `getDocLinks` (#172358)](#172358) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Pierre Gayvallet","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-12-12T09:59:41Z","message":"[doclinks] propagate build flavor to `getDocLinks` (#172358)\n\n## Summary\r\n\r\nFix https://github.com/elastic/kibana/issues/167088\r\n\r\nAdd a new `buildFlavor` (`traditional` | `serverless`) parameter to\r\n`getDocLinks` and `getDocLinksMeta` so that the doc links generator\r\nlogic can leverage the information\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"c50f3d749ed9071bf4c0974ed4f71399627f088a","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","Team:Core","release_note:skip","v8.12.0","v8.13.0"],"number":172358,"url":"https://github.com/elastic/kibana/pull/172358","mergeCommit":{"message":"[doclinks] propagate build flavor to `getDocLinks` (#172358)\n\n## Summary\r\n\r\nFix https://github.com/elastic/kibana/issues/167088\r\n\r\nAdd a new `buildFlavor` (`traditional` | `serverless`) parameter to\r\n`getDocLinks` and `getDocLinksMeta` so that the doc links generator\r\nlogic can leverage the information\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"c50f3d749ed9071bf4c0974ed4f71399627f088a"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172358","number":172358,"mergeCommit":{"message":"[doclinks] propagate build flavor to `getDocLinks` (#172358)\n\n## Summary\r\n\r\nFix https://github.com/elastic/kibana/issues/167088\r\n\r\nAdd a new `buildFlavor` (`traditional` | `serverless`) parameter to\r\n`getDocLinks` and `getDocLinksMeta` so that the doc links generator\r\nlogic can leverage the information\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"c50f3d749ed9071bf4c0974ed4f71399627f088a"}}]}] BACKPORT--> Co-authored-by: Pierre Gayvallet <[email protected]>
It looks like at this moment, the "build flavours" are kibana/packages/kbn-config/src/types.ts Line 31 in 47614ec
My hope is that the places where we're calling solution-specific doc links are also solution-specific UIs and thus can use unique keywords in the doc link service. If we can find examples of where that's not the case (i.e. the same code is re-used in multiple solutions and thus needs some way to be context-aware with the doc links it uses), that would be useful for figuring out how to address them. |
Description of the problem including expected versus actual behavior:
Relates to the kbn-doc-links service, implemented in #123818
I want to be able to link from Serverless UI to appropriate Serverless docs.
However, if I add a new Serverless-specific keyword to the doc link service and update the app to use that keyword, this also affects the non-Serverless UI, as shown in #167084
I think we need a recommendation for how to code context-specific doc links consistently across our apps.
Steps to reproduce:
Proposal:
It seems to me (non-developer) that we either need to: (a) provide guidance for how to update every doc link in every app such that it's context-specific (if serverless, use keyword X; if not-serverless, use keyword Y); or (b) provide a serverless-specific doc link service that contains the same set of keywords but with appropriate serverless doc targets. In the case of (b) we'd need to ensure that either the serverless- or non-serverless-specific doc link service was running, depending on the context.
The text was updated successfully, but these errors were encountered: