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

fix: argo validate_run_id with truncated workflow names #2095

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions metaflow/plugins/argo/argo_workflows_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,27 +1016,15 @@ def validate_run_id(

if project_name is not None:
# Verify we are operating on the correct project.
# Perform match with separators to avoid substrings matching
# e.g. 'test_proj' and 'test_project' should count as a mismatch.
project_part = "%s." % sanitize_for_argo(project_name)
if (
current.get("project_name") != project_name
and project_part not in workflow_name
):
if current.get("project_name") != project_name:
raise RunIdMismatch(
"The workflow belongs to the project *%s*. "
"Please use the project decorator or --name to target the correct project"
% project_name
)

# Verify we are operating on the correct branch.
# Perform match with separators to avoid substrings matching.
# e.g. 'user.tes' and 'user.test' should count as a mismatch.
branch_part = ".%s." % sanitize_for_argo(branch_name)
if (
current.get("branch_name") != branch_name
and branch_part not in workflow_name
):
if current.get("branch_name") != branch_name:
raise RunIdMismatch(
"The workflow belongs to the branch *%s*. "
"Please use --branch, --production or --name to target the correct branch"
Expand Down
Loading