fix: export all Argo manifests (cron workflow, sensor) in --only-json#3095
Open
npow wants to merge 4 commits into
Open
fix: export all Argo manifests (cron workflow, sensor) in --only-json#3095npow wants to merge 4 commits into
npow wants to merge 4 commits into
Conversation
Contributor
Greptile SummaryThis PR expands Argo
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (5): Last reviewed commit: "fix: mirror ARGO_WORKFLOWS_USE_SCHEDULES..." | Re-trigger Greptile |
This was referenced Apr 13, 2026
|
@npow This is exactly what my team needs with our implementation of metaflow/argocd. Anything we can do to help get this over the line? Happy to carry it forward: rebase on master, get CI green, add tests while keeping your authorship to this if you're open to it. |
Previously, `argo-workflows create --only-json` only exported the WorkflowTemplate JSON, silently dropping CronWorkflow config (for @schedule flows) and Sensor config (for @trigger flows). Now the output is a JSON object with up to three keys: - "workflow_template": always present - "cron_workflow": present when @schedule is used - "sensor": present when @trigger/@trigger_on_finish is used Fixes #1730, fixes #1940.
Add subprocess-based tests that run the actual CLI with --only-json against both a plain flow and a @schedule flow, verifying the output JSON contains the expected manifest keys (workflow_template, cron_workflow). Tests skip gracefully outside the devstack. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
--only-json requires s3/azure/gs datastore. Keep METAFLOW_HOME/PROFILE so devstack config is used when available, and skip gracefully when no cloud datastore is configured. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
8a1f532 to
c416489
Compare
When ARGO_WORKFLOWS_USE_SCHEDULES=True, ArgoClient.schedule_workflow_template builds a CronWorkflow spec with "schedules" (list) instead of "schedule" (scalar). _cron_workflow_json() was hardcoding the legacy scalar form, causing exported manifests to diverge from what ArgoClient would actually deploy on clusters with the flag enabled. - Import ARGO_WORKFLOWS_USE_SCHEDULES in argo_workflows.py - Branch on the flag in _cron_workflow_json() to match ArgoClient's behavior - Add unit tests (mock.patch both True/False paths) in TestCronWorkflowJson
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
argo-workflows create --only-jsonnow exports all Argo manifests, not just the WorkflowTemplateworkflow_template(always),cron_workflow(when@scheduleis used), andsensor(when@trigger/@trigger_on_finishis used)_cron_workflow_json()now mirrorsARGO_WORKFLOWS_USE_SCHEDULES— uses"schedules": [...](list) when the flag is True, matching whatArgoClient.schedule_workflow_templateactually deploysFixes #1730, fixes #1940.
The output of
--only-jsonhas changed from a bare WorkflowTemplate JSON object to a wrapper envelope:Before:
{"apiVersion": "argoproj.io/v1alpha1", "kind": "WorkflowTemplate", ...}After:
{"workflow_template": {...}, "cron_workflow": {...}}If you have scripts parsing the old output, update them to add
.workflow_template:Test plan
test/ux/core/test_argo_manifests.pywith tests for all manifest export scenariosmock.patchtests for bothARGO_WORKFLOWS_USE_SCHEDULES=TrueandFalsepaths inTestCronWorkflowJson🤖 Generated with Claude Code