Skip to content

Release 0.12.0

Choose a tag to compare

@tercel tercel released this 18 Jan 12:47
· 134 commits to main since this release

Added

  • Task Model Enhancements

  • Added task_tree_id field to TaskModel for managing task hierarchy and relationships

  • Introduced origin_type field to track task origin (own, link, copy, reference, archive)

  • Implemented SchemaMigration model to track migration history for schema evolution

  • Added has_references flag validation in task creation tests

  • Executor Access Control System

  • Implemented executor access control via APFLOW_EXTENSIONS environment variable

  • Added functions to retrieve allowed executor IDs and filter available executors

  • Created new API endpoint (/system/executors) to list available executors with restriction support

  • Introduced CLI commands to list executors with various output formats (table, json, yaml)

  • Added permission checks in TaskManager to enforce executor access control during task execution

  • Comprehensive test coverage for executor permissions and API functionality

  • CLI Extension System Enhancements

  • Automatic Root Command Detection: All single functions registered via @cli_register are now automatically treated as root commands (e.g., apflow version, apflow server --port 8000)

  • Removed root_command parameter - no longer needed

  • Functions are always root commands, classes are always groups

  • Simplified API: @cli_register(name="hello") creates a root command automatically

  • Group Extension Support: Added group parameter to @cli_register decorator for extending existing CLI groups

  • Extend custom groups: @cli_register(group="my-group", name="new-command")

  • Extend built-in groups: @cli_register(group="tasks", name="custom-action")

  • Override subcommands: @cli_register(group="my-group", name="existing", override=True)

  • New get_cli_group() Function: Convenient API for accessing and extending CLI groups

  • Supports both registered extensions and built-in groups (tasks, config, etc.)

  • Usage: group = get_cli_group("my-group"); @group.command() def new_cmd(): ...

  • Clear error messages when group doesn't exist

  • Improved Override Behavior: Clear distinction between different override scenarios

  • name="my-group", override=True - Override entire group

  • group="my-group", name="cmd", override=True - Override subcommand in group

  • name="my-cmd", override=True - Override root command

  • Comprehensive test coverage (8 tests) for all extension scenarios

  • CLI Documentation

  • Added comprehensive CLI documentation with configuration management guide (cli/configuration.md)

  • Created practical usage examples (cli/examples.md)

  • Developed detailed CLI usage guide covering installation, modes, and best practices (cli.md)

  • Introduced CLI documentation index for improved navigation

  • TaskCreator hanldeing different origin types

  • Added comprehensive tests for TaskCreator methods handling different origin types:
    from_link, from_copy, from_archive, and from_mixed methods.

  • Removed create_task_copy* moethods

  • Includes test cases for single tasks, recursive trees, field overrides, dependency handling, and edge cases (error conditions, immutability).

Changed

  • TaskCreator Logic Refactoring

  • Refactored and clarified the logic for from_link, from_copy, from_archive, and from_mixed methods in TaskCreator.

  • Improved type annotations, docstrings, and error handling for all task creation methods.

  • Enhanced dependency and subtree validation logic for recursive copy/link/archive operations.

  • Improved handling of parent/child relationships and task tree construction.

  • Updated internal helper methods for better maintainability and testability.

  • Extension Management Refactoring

  • Moved executor-related functions from apflow.api.extensions to apflow.core.extensions.manager for better code organization

  • Updated import paths across the entire codebase to reflect new structure

  • Enhanced TaskManager to load executors dynamically with permission checks

  • Improved on-demand extension loading for better performance and security

  • Decorator Override Logic

  • All decorators.py override logic has been changed to force logic for consistency and clarity across the codebase.

  • Task Execution Improvements

  • Enhanced task execution logic with improved error handling

  • Implemented priority grouping for better task scheduling

  • Optimized task tree retrieval using task_tree_id with fallback mechanism

  • TaskRepository Refactored

  • Refactored task update methods in TaskRepository for improved maintainability and clarity.

  • Use the method task_update(self, task_id: str, **kwargs) instead of all update_task_* series functions.

  • Refactored TaskModel to TaskModelType and enhanced task creation methods for better type safety and extensibility.

Fixed

  • Database Schema Management
  • Simplified TaskRepository initialization by removing custom column checks
  • Added migration tests to ensure proper schema evolution and idempotent execution
  • Improved database schema handling for more reliable operations
  • Fixed edge cases in recursive copy/link/archive logic where tasks with external dependencies or disconnected subtrees could cause errors.
  • Improved error messages for invalid task trees and dependency cycles.