Skip to content

Expose Argo only-json workflow template on DeployedFlow#3220

Merged
talsperre merged 1 commit into
masterfrom
argo-only-json-deployed-flow
May 31, 2026
Merged

Expose Argo only-json workflow template on DeployedFlow#3220
talsperre merged 1 commit into
masterfrom
argo-only-json-deployed-flow

Conversation

@talsperre

@talsperre talsperre commented May 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve existing argo-workflows create --only-json stdout behavior
  • Attach the compiled Argo WorkflowTemplate to Deployer additional_info for only_json=True
  • Expose it as ArgoWorkflowsDeployedFlow.workflow_template
  • Add unit coverage and a UX/core Argo compilation integration test

@talsperre
talsperre force-pushed the argo-only-json-deployed-flow branch 3 times, most recently from d86204f to 20bbb8b Compare May 31, 2026 07:10
@greptile-apps

greptile-apps Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR exposes the compiled Argo WorkflowTemplate from an only_json=True create via the ArgoWorkflowsDeployedFlow.workflow_template property. It achieves this by refactoring the inline deployer-attribute-file write into a shared _write_deployer_attributes helper and wiring additional_info through the existing deployer payload mechanism.

  • Extracts _write_deployer_attributes helper and writes the attribute file at different points depending on whether only_json is True (after make_flow(), so the compiled template is available) or False (before deployment, preserving original timing).
  • Adds ArgoWorkflowsDeployedFlow.workflow_template property that reads additional_info["workflow_template"] from the deployer, returning None for normal deployments or from_deployment reconstructions.
  • Adds unit tests for the new property and a UX/integration test for the end-to-end compilation path.

Confidence Score: 5/5

The change is safe to merge — it adds a read-only property and wires a new optional payload through an existing, well-tested mechanism without altering any existing code paths.

The refactoring is minimal and surgical: the only_json=False path is functionally unchanged (attribute file still written before deployment), and the only_json=True path now correctly writes the attribute file after make_flow() so the compiled template is available. The new workflow_template property is purely additive and returns None gracefully for all pre-existing usage.

No files require special attention.

Important Files Changed

Filename Overview
metaflow/plugins/argo/argo_workflows_cli.py Extracts _write_deployer_attributes helper; for only_json=True writes after make_flow() to include the compiled WorkflowTemplate in additional_info; for only_json=False writes before deployment, preserving original timing.
metaflow/plugins/argo/argo_workflows_deployer_objects.py Adds workflow_template property to ArgoWorkflowsDeployedFlow that reads from deployer.additional_info; uses getattr defensively for unit-test-friendly SimpleNamespace mocks.
test/unit/test_argo_workflows_cli.py Adds two unit tests covering the happy path (additional_info present) and the None path (additional_info absent) for the workflow_template property.
test/ux/core/test_argo_compilation.py New UX integration test that verifies workflow_template is populated and has the expected shape after an only_json=True deployer create; correctly guarded behind exec_mode and scheduler_type checks.
test/ux/pytest.ini Adds argo_compilation marker registration to match the new pytestmark in test_argo_compilation.py.

Reviews (2): Last reviewed commit: "feat: expose Argo only-json workflow tem..." | Re-trigger Greptile

Comment thread metaflow/plugins/argo/argo_workflows_deployer_objects.py
@talsperre
talsperre force-pushed the argo-only-json-deployed-flow branch from 20bbb8b to df14eee Compare May 31, 2026 07:17
@talsperre
talsperre merged commit 90ea1d3 into master May 31, 2026
45 checks passed
@talsperre
talsperre deleted the argo-only-json-deployed-flow branch May 31, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant