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

Second stab at deploy time trigger on finish bugs #2212

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

talsperre
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@saikonen saikonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure which change causes this, but there is also an issue with the following example on argo workflows:

def flow_names_func(ctx):
    return ["DeployTimeTriggerParams"]


@trigger_on_finish(flows=flow_names_func)
class DeployTimeTriggerOnFinishFlow2(FlowSpec):

as for whatever reason the trigger now becomes just a string, leading to:

argo_workflows.py", line 635, in _process_triggers
    event.get("project") or current.get("project_name"),
AttributeError: 'str' object has no attribute 'get'

Comment on lines +624 to +631
if "project" not in trigger:
raise MetaflowException(
f"Trigger: {trigger} parsed at deploy time is missing the *project* key."
)
if "project_branch" not in trigger:
raise MetaflowException(
f"Trigger: {trigger} parsed at deploy time is missing the *project_branch* key."
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like a clear change in behaviour. previously partial dictionaries were accepted, though supplying a project without a branch lead to nothing being triggered. a dict with only a name used to be valid though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes -- @talsperre , why are we forcing this now? It should be auto-filled with current project/branch if not provided right?

@npow
Copy link

npow commented Jan 16, 2025

Can we add some unit tests for this logic? It's really complicated and hard to verify correctness just by eyeballing

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.

4 participants