-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Use-cases
When listing runs in an organisation client.runs.list_for_organization(args.organization, org_options) will fail with the following pedantic error:
pydantic_core._pydantic_core.ValidationError: 1 validation error for Run
source
Input should be 'tfe-api', 'tfe-configuration-version', 'tfe-ui' or 'terraform+cloud' [type=enum, input_value='terraform', input_type=str]
For further information visit https://errors.pydantic.dev/2.12/v/enum
This will also occur when runs have a source of:
tfe-run-trigger
tfe-infrastructure-lifecycle
Attempted Solutions
To allow runs.list_for_organization to successfully retrieve all runs; adding the following to class RunSource(str, Enum) in models/run.py has worked for me:
Run_Source_Terraform = "terraform"
Run_Source_Run_Trigger = "tfe-run-trigger"
Run_Source_Infra_Lifecycle = "tfe-infrastructure-lifecycle"
Proposal
Could all possible run sources for a run be added to the RunSource model.
class RunSource(str, Enum):
"""RunSource represents a source type of a run."""
Run_Source_API = "tfe-api"
Run_Source_Configuration_Version = "tfe-configuration-version"
Run_Source_UI = "tfe-ui"
Run_Source_Terraform_Cloud = "terraform+cloud"
Run_Source_Terraform = "terraform"
Run_Source_Run_Trigger = "tfe-run-trigger"
Run_Source_Infra_Lifecycle = "tfe-infrastructure-lifecycle"
# Add any other possible sources...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels