kibana/oas_docs
Cristina Amico 9cf2b7b799
[Fleet] Sync Remote integrations: Show warning when package is not found in remote (#223248)
Closes https://github.com/elastic/kibana/issues/220850

## Summary
Add logic that handles the case of custom integrations that cannot be
installed in the remote because of error
` PackageNotFoundError: [pkgName] package not found in registry`

Currently, when the installation is attempted, we just log the error and
exit. I added some logic that creates an "empty" installation SO in
`epm-packages` with status `install_failed` and populates
the`latest_install_failed_attempts` field so we know what happened.
**NOTE**: we could add this logic in the regular install process as
well, it would be useful for debugging purpose

- I also added some logic to `compareSyncIntegrations` to make this
error a warning and because I also made the logic for the warning more
generic

### Testing 
- Install a custom integration in the main cluster, let the
syncIntegrationsTask run and after a while check `GET
.kibana_ingest/_doc/epm-packages:PKGNAME`. You should see the error
saved under `latest_install_failed_attempts`:

<img width="1804" alt="Screenshot 2025-06-10 at 16 20 09"
src="https://github.com/user-attachments/assets/2cffbf01-15f2-4091-bcbd-660fbb390c56"
/>

- In the remote, query `GET
kbn:/api/fleet/remote_synced_integrations/status` and verify that it
returns a warning for the custom integration. Example:
```
 "integrations": [
    {
      "package_name": "agentless_package_links",
      "package_version": "0.0.2",
      "install_status": {
        "main": "installed",
        "remote": "not_installed"
      },
      "updated_at": "2025-05-21T08:55:47.981Z",
      "sync_status": "warning",
      "warning": {
        "title": "agentless_package_links can't be automatically synced",
        "message": "This integration must be manually installed on the remote cluster. Automatic updates and remote installs are not supported."
      }
    },
...
```

- Test the UI - go to Fleet settings and verify that the custom
integration shows a warning:

![Uploading Screenshot 2025-06-11 at 16.26.47.png…]()


### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-12 11:53:57 +02:00
..
examples [OAS] Support examples (and more) (#212495) 2025-03-14 14:56:28 +01:00
linters [DOCS] Removes Serverless API x-beta overlay (#215587) 2025-03-22 02:30:25 +02:00
output [Fleet] Sync Remote integrations: Show warning when package is not found in remote (#223248) 2025-06-12 11:53:57 +02:00
overlays OpenAI (Other) Connector PKI implementation (#219984) 2025-06-06 20:43:57 +00:00
scripts [DOCS] Add minimal synthetic APIs (#214518) 2025-04-10 19:26:49 +02:00
bundle.json [Fleet] Sync Remote integrations: Show warning when package is not found in remote (#223248) 2025-06-12 11:53:57 +02:00
bundle.serverless.json [Fleet] Sync Remote integrations: Show warning when package is not found in remote (#223248) 2025-06-12 11:53:57 +02:00
kibana.info.serverless.yaml [DOCS] Remove technical preview from serverless APIs (#201054) 2024-11-21 09:45:10 +01:00
kibana.info.yaml [DOCS] Fix URLs in Kibana API documentation (#215989) 2025-05-06 16:01:09 -07:00
makefile [OAS] Publish OAS bundles to bump.sh (#197482) 2024-11-14 09:15:47 +01:00
package-lock.json Update dependency @redocly/cli to ^1.34.3 (main) (#220499) 2025-05-08 17:27:42 +02:00
package.json Update dependency @redocly/cli to ^1.34.3 (main) (#220499) 2025-05-08 17:27:42 +02:00
README.md SKA: Relocate "platform" packages that remain on /packages (#208704) 2025-02-24 11:03:30 +00:00

Kibana API reference documentation

Documentation about our OpenAPI bundling workflow and configuration. See Kibana's hosted stateful and serverless docs.

Workflow

The final goal of this workflow is to produce an OpenAPI bundle containing all Kibana's public APIs.

Step 0

OAS from Kibana's APIs are continuously extracted and captured in bundle.json and bundle.serverless.json as fully formed OAS documentation. See node scripts/capture_oas_snapshot --help for more info.

These bundles form the basis of our OpenAPI bundles to which we append and layer extra information before publishing.

Step 1

Append pre-existing bundles not extracted from code using kbn-openapi-bundler to produce the final resulting bundles.

To add more files into the final bundle, edit the appropriate oas_docs/scripts/merge*.js files.

Step 2

Apply any final overalys to the document that might include examples or final tweaks (see the "Scripts" section for more details).

Scripts

The oas_docs/scripts folder contains scripts that point to the source domain-specific OpenAPI bundles and specify additional parameters for producing the final output bundle. Currently, there are the following scripts:

  • merge_ess_oas.js script produces production an output bundle for ESS

  • merge_serverless_oas.js script produces production an output bundle for Serverless

Output Kibana OpenAPI bundles

The oas_docs/output folder contains the final resulting Kibana OpenAPI bundles

  • kibana.yaml production ready ESS OpenAPI bundle
  • kibana.serverless.yaml production ready Serverless OpenAPI bundle

Bundling commands

Besides the scripts in the oas_docs/scripts folder, there is an oas_docs/makefile to simplify the workflow. Use make help to see available commands.