feat(update): implement self-update command

Summary

  • Implement self-update functionality for osdu-activity CLI matching osdu-quality behavior
  • Add version checking against GitLab Package Registry
  • Support automatic installer detection (uv/pipx)
  • Display changelog from GitLab Releases

Changes

  • config.py: Add package registry constants (PACKAGE_NAME, PACKAGE_REGISTRY_PROJECT_ID, PACKAGE_REGISTRY_URL)
  • update.py: New module with self-update logic (version comparison, installer detection, upgrade execution)
  • cli.py: Replace stub update command with full implementation
  • test_update.py: 25 comprehensive unit tests for update module
  • test_cli.py: Update test to reflect new behavior

Features

  • osdu-activity update - Check for and install updates
  • osdu-activity update --check-only - Show update availability without installing
  • osdu-activity update --force - Reinstall even when on latest version
  • osdu-activity update --no-changelog - Skip changelog display

Test plan

  • All 263 tests pass
  • black formatting passes
  • ruff linting passes
  • mypy type checking passes
  • Manual test: osdu-activity update --check-only shows version info

Merge request reports

Loading