Metadata-Version: 2.4
Name: fastpluggy-update-checker
Version: 0.2.0
Summary: Update checker and usage telemetry plugin for FastPluggy
Author: FastPluggy Team
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: FastPluggy>=0.4.0
Requires-Dist: loguru
Provides-Extra: tests
Requires-Dist: pytest>=7.0; extra == "tests"
Requires-Dist: pytest-cov>=4.0; extra == "tests"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "tests"
Provides-Extra: e2e
Requires-Dist: fastpluggy-cli; extra == "e2e"

# Update Checker Plugin for FastPluggy

![Update Checker](https://img.shields.io/badge/FastPluggy-Update%20Checker-blue)
[![update_checker](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/update_checker/-/badges/release.svg)](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/update_checker/-/releases)
[![Pipeline Status](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/update_checker/badges/main/pipeline.svg?key_text=CI)](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/update_checker/-/pipelines?ignore_skipped=true)
[![Coverage](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/update_checker/badges/main/coverage.svg)](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/update_checker/-/pipelines)

Checks for available updates to installed FastPluggy packages and sends optional installation telemetry to the registry. Replaces the deprecated `usage-cli` plugin.

## Install

```bash
pip install fastpluggy-update-checker
```

## Settings

| Setting | Default | Description |
|---------|---------|-------------|
| `registry_url` | `""` | Registry base URL (required) |
| `check_interval` | `3600` | Seconds between checks |
| `enabled` | `True` | Enable/disable update checking |
| `package_prefix` | `"fastpluggy-"` | Package name prefix filter |
| `use_tasks_worker` | `False` | Use tasks_worker for scheduling |
| `send_telemetry` | `True` | Send installation telemetry |
| `installation_id` | `""` | Auto-generated UUID |

## Usage

Configure `registry_url` to point at your FastPluggy registry. The plugin starts checking for updates automatically on startup.

The admin dashboard shows a table of all installed packages with their update status. Use the "Check Now" button to trigger an immediate re-check.

## API

- `GET /api/updates` — all packages with version comparison (supports `?available_only=true`)
- `GET /api/updates/{name}` — single package info
- `GET /api/summary` — `{total, updates_available, last_checked}`
- `POST /api/check` — trigger immediate check

## Events

The plugin emits `update_checker.updates_detected` via the EventBus when new updates are discovered. Downstream plugins (marketplace, fp_deployer, notification_center) can subscribe to react to updates. See `docs/update_checker.md` for payload schema.

## Integration

Other plugins can discover this plugin via the `updates_provider` capability attribute and call `get_available_updates()` or `get_updates_summary()` for server-side access.

## Migration from usage-cli

The `update_checker` plugin replaces `usage-cli`. Key differences:

| usage-cli | update_checker |
|-----------|----------------|
| `api_url` setting | `registry_url` setting |
| `send_packages` | `send_telemetry` |
| Sends to separate usage-server | Sends to pypi_registry `/fastpluggy/` endpoints |
| No update checking | Full update checking with dashboard |
| Uses httpx | Uses stdlib urllib (no extra dependency) |

Remove `fastpluggy-usage-cli` from your dependencies and install `fastpluggy-update-checker` instead.
