-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(aci): set workflow in job when evaluating action filters #87353
Conversation
@@ -109,6 +123,8 @@ def evaluate_workflows_action_filters( | |||
if evaluation: | |||
filtered_action_groups.add(action_condition) | |||
|
|||
job.pop("workflow", None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe i don't need to pop, but not popping caused this problem in the first place
TIL dictionaries are pass by reference in Python which is why this happens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls hold on merging -- i'd like to take a quick look. |
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
we chatted a little in slack, but i'm not 100% sold on this as the fix. it feels like we're fixing a symptom rather than treating the issue. i'd like to take a closer look at how we're using the hopefully i can get some keyboard time tomorrow and i might be able to take a look around to see if there's a more holistic fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo the problem here is that we're mutating WorkflowJob
. I think it should actually be a frozen dataclass
. If we need to copy it for multiple workflows we can do that so that the original object isn't modified
i will try this again |
I wrote a test and found that
workflow.evaluate_trigger_conditions(job)
we attach theworkflow
to thejob
workflow
we evaluate remains attached to thejob
evaluate_workflows_action_filters
we end up passing that last workflow to every single filter/IF data condition group we evaluate, even if the filter/IF DCG is not actually attached to that last workflowWe should be correctly setting the workflow for each data condition group we evaluate.
(Wrote a test with a condition that should not be an allowable filter condition for demonstration purposes only)