Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflows API broke for CronWorkflows on AW<3.6 using Hera 5.19 #1312

Open
3 of 7 tasks
elliotgunton opened this issue Feb 14, 2025 · 0 comments
Open
3 of 7 tasks

Workflows API broke for CronWorkflows on AW<3.6 using Hera 5.19 #1312

elliotgunton opened this issue Feb 14, 2025 · 0 comments
Labels
type:bug A general bug

Comments

@elliotgunton
Copy link
Collaborator

Pre-bug-report checklist

1. This bug can be reproduced using pure Argo YAML

If yes, it is more likely to be an Argo bug unrelated to Hera. Please double check before submitting an issue to Hera.

2. I have searched for existing issues

  • Yes

3. This bug occurs in Hera when...

  • exporting to YAML
  • submitting to Argo
  • running on Argo with the Hera runner
  • other: using the Workflows client

Bug report

Describe the bug
A clear and concise description of what the bug is:

Error log if applicable:

  File "/app/main.py", line 121, in cron
    cron_workflow.create()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/app/.venv/lib/python3.13/site-packages/hera/workflows/cron_workflow.py", line 99, in create
    wf = self.workflows_service.create_cron_workflow(
        CreateCronWorkflowRequest(cron_workflow=self.build()),  # type: ignore
        namespace=self.namespace,
    )
  File "/app/.venv/lib/python3.13/site-packages/hera/workflows/service.py", line 509, in create_cron_workflow
    return CronWorkflow(**resp.json())
  File "/app/.venv/lib/python3.13/site-packages/pydantic/v1/main.py", line 341, in __init__
    raise validation_error
pydantic.v1.error_wrappers.ValidationError: 3 validation errors for CronWorkflow
status -> failed
  field required (type=value_error.missing)
status -> phase
  field required (type=value_error.missing)
status -> succeeded
  field required (type=value_error.missing)

To Reproduce

  • Install Argo Workflows < 3.6
  • Install hera==5.19
  • Try to create a CronWorkflow using the create method, with a valid WorkflowsService
  • The response will fail to decode

Full Hera code to reproduce the bug:

from hera.workflows import Container, CronWorkflow, WorkflowsService

with CronWorkflow(
    name="hello-world",
    entrypoint="hello-world-with-time",
    schedule="* * * * *",
    timezone="America/Los_Angeles",
    starting_deadline_seconds=0,
    concurrency_policy="Replace",
    successful_jobs_history_limit=4,
    failed_jobs_history_limit=4,
    cron_suspend=False,
    workflows_service=WorkflowsService(
        host="https://localhost:2746",
        namespace="argo",
        verify_ssl=False,
    ),
) as w:
    print_message = Container(
        name="hello-world-with-time",
        image="busybox",
        command=["echo"],
        args=["🕓 hello world. Scheduled on: {{workflow.scheduledTime}}"],
    )

w.create()

Expected behavior
A clear and concise description of what you expected to happen:

  • The response should be able to decode as an AW 3.5 object

Environment

  • Hera Version: 5.19.0
  • Python Version: 3.X.X
  • Argo Version: 3.5.X

Additional context
Add any other context about the problem here.

Seen in https://cloud-native.slack.com/archives/C03NRMD9KPY/p1739305360122419

@elliotgunton elliotgunton added the type:bug A general bug label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant