Commit graph

9 commits

Author SHA1 Message Date
3b7a07e1d9 Refactor update_package with comprehensive error handling and integrate update scripts.
Add custom exception hierarchy (PackageUpdateError, PackageNotFoundError,
RepositoryStateError, ExternalCommandError, MissingToolError) for specific
error handling throughout package update operations.

Extract helper functions from 90-line update_package function:
- validate_package_info: Package validation
- resolve_package_directories: Path resolution
- ensure_package_checkout: Salsa checkout with error handling
- validate_repository_state: Check for uncommitted changes
- run_gbp_pq_workflow: Run gbp pq import/switch with error checks
- import_upstream_version: Import upstream using gbp
- run_command: Centralized subprocess execution with consistent errors
- check_required_tools: Validate required tools upfront

Incorporate update scripts as Python functions (replaces external shell scripts):
- update_debian_control: Update Standards-Version, remove obsolete fields
- update_debian_copyright_year: Update copyright years to current
- update_debian_watch: Upgrade watch files from version 4 to 5
- add_salsa_ci: Add debian/salsa-ci.yml if missing
- run_package_updates: Orchestrator for all update operations

Enhance network error handling in fetch_todo_list:
- Handle HTTP errors, network errors, timeouts, invalid JSON
- Add timeout parameter (default 30s)
- Graceful error messages in list_todos and update_todos

Add comprehensive test coverage:
- 67 tests for update-pkg functionality
- Tests for all helper functions and update operations
- Network error handling tests
- 125 total tests, all passing

Benefits:
- No external script dependencies
- Consistent error handling throughout
- Better error messages with actionable guidance
- All update logic in one maintainable codebase

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 16:55:50 +00:00
822dcedde7 Add new update-pkg command. 2026-02-01 14:24:52 +00:00
a7d4bc4ae9 Add tests. 2026-02-01 14:02:53 +00:00
e80f511155 Add docstrings and auto-download todo.json if missing
- Add module-level and function docstrings throughout
- Download todo.json from UDD automatically when running 'list'
  command if the file doesn't exist locally

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:37:01 +00:00
65789b0e5b Add project documentation and license
- README.md: usage, requirements, features, and configuration
- AGENTS.md: guidelines for AI agents working on the codebase
- LICENSE: MIT license

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:36:14 +00:00
ed57a5199a Add some notes 2026-02-01 13:20:58 +00:00
bbb671158d Various improvements 2026-02-01 13:20:45 +00:00
874d2b4aeb Show uploaders in todo list 2026-01-24 23:02:21 +00:00
16abb245f6 Initial commit. 2026-01-12 11:14:56 +00:00