feat(workspace-run-task): add workspace run task support #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive support for Terraform Cloud Workspace Run Tasks, enabling users to attach, manage, and configure run tasks at the workspace level.
Changes
New Files
src/pytfe/models/workspace_run_task.py: Pydantic models for workspace run tasks including:
src/pytfe/resources/workspace_run_task.py: Complete CRUD operations:
tests/units/test_workspace_run_task.py: Comprehensive test coverage (20 tests):
examples/workspace_run_task.py: Complete example demonstrating all operations
Modified Files
src/pytfe/models/run_task.py:
src/pytfe/resources/run_task.py: Added parsing for workspace_run_tasks relationship
src/pytfe/client.py: Registered workspace_run_tasks service
src/pytfe/models/init.py: Exported workspace run task models
src/pytfe/errors.py: Added InvalidWorkspaceRunTaskIDError for validation
tests/units/test_run_task.py: Updated tests to use underscore format for Stage enum
Testing
All tests pass successfully:
Quality checks:
API Compatibility
Implements the Terraform Cloud API endpoints:
Breaking Changes