-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Ingest Manager] Show experimental packages by default #70997
Conversation
…up some epm components
Pinging @elastic/ingest-management (Team:Ingest Management) |
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The design changes are product/design's (@mostlyjason & @hbharding) call but the code/UX improvements LGTM.
@@ -61,7 +61,9 @@ export function EPMHomePage() { | |||
|
|||
function InstalledPackages() { | |||
useBreadcrumbs('integrations_installed'); | |||
const { data: allPackages, isLoading: isLoadingPackages } = useGetPackages(); | |||
const { data: allPackages, isLoading: isLoadingPackages } = useGetPackages({ | |||
experimental: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? Doesn't useGetPackages
default to experimental: true
?
If it's not doing anything different from the defaults, or the other calls without the argument, I'd like to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this param will be needed when we switch to having a toggle/option to turn on experimental packages (#64869) instead of showing by default because we should always show all installed packages regardless of release type. I'd like to keep this param here as it would be easy to overlook the necessary behavior here when we remove experimental: true
from useGetPackages
packageName: string, | ||
internal: boolean = true | ||
): Promise<RegistrySearchResult> { | ||
export async function fetchFindLatestPackage(packageName: string): Promise<RegistrySearchResult> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add a second param, options
which takes internal: boolean = true
and experimental: boolean = true
.
That way we can still have this behavior if called with only the package name, but still allow other options if desired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from what I saw in the code, the current usage of fetchFindLatestPackage
implies finding the latest version given a package name regardless of if it's an internal package or experimental one. both internal and experimental always needs to be true to enable searching across all registry packages, so that's why I removed the existing internal
param and didn't replace it with options
const url = new URL(`${registryUrl}/categories`); | ||
if (params) { | ||
if (params.experimental) { | ||
url.searchParams.set('experimental', params.experimental.toString()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to skip the individual tests by passing a record to URLSearchParams like
const url = new URL(`${registryUrl}/categories`); | |
if (params) { | |
if (params.experimental) { | |
url.searchParams.set('experimental', params.experimental.toString()); | |
} | |
} | |
const url = new URL(`${registryUrl}/categories`); | |
if (params) { | |
url.search = new URLSearchParams(params) | |
} |
If we only want some properties from params
we can filter them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params.experimental
comes in as a boolean
. searchParams
doesn't like that, hence the need for conversion to string with params.experimental.toString()
. I think your suggestion would run into the same issue. this could be fixed by doing Object.entries(params).map()
or similar to convert boolean values, but I'll defer this improvement for now as we're only dealing with one param here atm
* Add beta and experimental badges to epm list and detail pages; clean up some epm components * Clean up styled warnings * Fix types * Allow experimental query param to be passed through to registry /search * Allow experimental query param to be passed through to registry /categories endpoint * Fix buggy categories count (#64981) * Always enable experimental packages and categories * Handle long package names nicely; misc layout tweaks * Move experimental=true flag to client side * Prevent layout jumps even more * Adjust beta/experimental badge tooltip copy
Summary
Resolves #70026. Fixes #64981.
This PR enables experimental packages to be shown in Ingest Manager:
/search
endpoint spec done in Makerelease
field available as part of/search
endpoint package-registry#591/api/ingest_manager/epm/categories
and/api/ingest_manager/epm/packages
to pass throughexperimental: true
param to corresponding registry endpointsexperimental: true
params on client-side to the Ingest Manager endpoints above ^Also, some code clean up was done in Integrations section:
WithHeaderLayout
to match rest of appstyled
components to outside of function components so that they are not created dynamically each time (there were many console warnings about this)Testing
release
field available as part of/search
endpoint package-registry#591 are deployed, you will need a local registry build that contains these changesScreenshots