feat(workspace-run-task): add workspace run task support#63
Closed
KshitijaChoudhari wants to merge 1 commit into
Closed
feat(workspace-run-task): add workspace run task support#63KshitijaChoudhari wants to merge 1 commit into
KshitijaChoudhari wants to merge 1 commit into
Conversation
- Add WorkspaceRunTask models and resources - Add WorkspaceRunTasks service with CRUD operations - Update RunTask model to include workspace_run_tasks relationship - Fix Stage enum to use underscore format (pre_plan, post_plan, etc.) - Add comprehensive unit tests (20 tests) - Add example CLI for workspace run task operations - Update client to include workspace_run_tasks service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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