Closed
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.
feat(workspace-run-tasks): add workspace run tasks support
Description
This PR adds comprehensive support for Terraform Cloud/Enterprise Workspace Run Tasks to the python-tfe SDK. This feature allows developers to manage run tasks at the workspace level, enabling custom policy enforcement, validation, and automation workflows specific to individual workspaces.
It provides full CRUD operations for creating, reading, updating, and deleting workspace run tasks, with support for different enforcement levels and execution stages.
Testing plan
External links
https://developer.hashicorp.com/terraform/cloud-docs/api-docs/workspaces#run-tasks
https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks
Output from tests
Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.
Unit Tests (All Passing):
Linting and Type Checks (All Passing):
Real HCP Terraform Cloud Integration (PASSED):
Test Coverage Summary:
Rollback Plan
Low Risk Assessment: This is an additive feature that introduces new functionality without modifying existing SDK behavior. No breaking changes to current users.
Rollback Strategy:
Immediate rollback (if critical issues discovered):
feat/workspace-run-taskbranchexamples/workspace_run_tasks.pysrc/pytfe/models/workspace_run_task.pysrc/pytfe/resources/workspace_run_tasks.pytests/units/test_workspace_run_tasks.py__init__.pyPartial rollback (if example issues only):
examples/workspace_run_tasks.pyMonitoring Plan
Communication Plan
Breaking Changes
No breaking changes. All new functionality is additive and does not modify existing SDK behavior.
Changes to Security Controls
No changes to existing security controls. This feature leverages existing SDK security patterns without modification.
Security Implementation Details:
Risk Assessment: Low security risk.
PCI review checklist