Commits
Click on a commit to change the comparison rangeAdd 'prefect automation update' CLI command
Adds a new CLI command to update existing automations from a YAML/JSON file
or JSON string, addressing issue #20116.
The command follows the same patterns as the existing 'create' command:
- --id flag to specify the automation to update (required)
- --from-file/-f to provide automation data from a YAML or JSON file
- --from-json/-j to provide automation data as a JSON string
Includes comprehensive test coverage for:
- Updating from YAML file
- Updating from JSON file
- Updating from JSON string
- Error handling for not found, invalid ID, invalid file extension,
file not found, invalid JSON, missing input, both inputs provided,
and validation errors
Co-Authored-By: Nate Nowack <nate@prefect.io>2 days ago
by devin-ai-integration[bot] Remove @requires_automations decorator and consolidate tests
- Remove the @requires_automations decorator from the update command
(appears to be dead code from when automations were experimental)
- Consolidate 11 tests down to 4 using pytest.mark.parametrize
- Tests now cover: file updates (YAML/JSON), JSON string updates,
not found errors, and input validation errors
Co-Authored-By: Nate Nowack <nate@prefect.io>2 days ago
by devin-ai-integration[bot] Address PR review feedback
- Change from_file parameter type from str to Path (typer handles conversion)
- Update error message to 'Automation config failed validation' for clarity
- Remove unnecessary Path() conversion since from_file is now typed as Path
Co-Authored-By: Nate Nowack <nate@prefect.io>2 days ago
by devin-ai-integration[bot] Rewrite tests to use real API instead of mocking
- Use prefect_client fixture to create real automations in test DB
- Use run_sync_in_worker_thread for invoke_and_assert in async tests
- Handle 404 error gracefully when automation not found
- Add proper imports for AutomationCore and run_sync_in_worker_thread
Co-Authored-By: Nate Nowack <nate@prefect.io>2 days ago
by devin-ai-integration[bot]