Mirror of https://github.com/roostorg/osprey github.com/roostorg/osprey
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: restore delay_action_by for label arguments (#76)

Co-authored-by: ayu <ayu@ayu.dev>

authored by

Elijah Seed-Arita
ayu
and committed by
GitHub
c819200c 5310b48b

+6 -5
+2 -2
osprey_worker/src/osprey/engine/language_types/labels.py
··· 32 32 expires_after: Optional[timedelta] = None 33 33 """If set, the label effect has a timed expiration, which means that the reason will expire after this time.""" 34 34 35 - # delay_action_by: Optional[timedelta] = None 36 - # """If set, the propagation of the effect to the upstream (if configured via LabelsService.after_add or LabelsService.after_remove) will be delayed.""" 35 + delay_action_by: Optional[timedelta] = None 36 + """Osprey can be configured to respond to this duration downstream to delay when a label is applied and/or causes an effect""" 37 37 38 38 dependent_rule: Optional[RuleT] = None 39 39 """If set, the effect will only be applied if the dependent rule evaluates to true."""
+4 -3
osprey_worker/src/osprey/engine/stdlib/udfs/labels.py
··· 41 41 # that a better abstraction would be to have any sort of "external impact" come 42 42 # from verdicts, which were created to be an output (whereas labels were created 43 43 # to simply store state, thus making label webhooks a leaky abstraction) 44 - # delay_action_by: Optional[TimeDeltaT] = None 45 - # """Optional: Delays a label action by a specified `TimeDeltaT` time.""" 44 + # NOTE(@elijaharita): this is being re-added because removing it breaks backwards compatibility. 45 + delay_action_by: Optional[TimeDeltaT] = None 46 + """Optional: Delays a label action by a specified `TimeDeltaT` time if Osprey is configured to.""" 46 47 apply_if: Optional[RuleT] = None 47 48 """Optional: Conditions that must be met for the label mutation to succeed.""" 48 49 expires_after: Optional[TimeDeltaT] = None ··· 55 56 status=status, 56 57 name=arguments.label.value, 57 58 expires_after=TimeDeltaT.inner_from_optional(arguments.expires_after), 58 - # delay_action_by=TimeDeltaT.inner_from_optional(arguments.delay_action_by), 59 + delay_action_by=TimeDeltaT.inner_from_optional(arguments.delay_action_by), 59 60 dependent_rule=arguments.apply_if, 60 61 # NOTE: This is fairly significant, if this call node has an `apply_if` ast, but 61 62 # the resolved apply_if is None, that means that the evaluation of the rule failed.