Repository navigation
feat: add %r placeholder for the approval requester - #534
Conversation
adcf573 to
0e6a601
Compare
|
Friendly ping @blizzz — now that the companion nextcloud/approval#449 (emitting |
|
Hey @xyonium and thanks for your contribution! If this pull request is AI assisted, please add a trailer of the format "Assisted-by: AGENT_NAME:MODEL_VERSION" to your commit (cf. https://github.com/nextcloud/.github/blob/master/AI_POLICY.md). |
When a flow reacts to a tag assignment of the approval app, the actor placeholder %a resolves to the approver on approval and rejection, while scripts typically need to act for the user who requested the approval (e.g. move the file into their space). The approval app emits an ApprovalStateChangedEvent carrying the requester right before changing its tags. The new listener stores it in the request-scoped RequesterContext, so it is substituted when the workflow engine reacts to the tag change within the same request. When no requester is known, the command is not executed and a warning is logged, consistent with the %n placeholder. Requires the approval app to emit the event, see nextcloud#363 Assisted-by: ClaudeCode:kimi-k3 Signed-off-by: xyonium <shark_xc@hotmail.com>
0e6a601 to
ff3c5d1
Compare
|
Thanks for the pointer — done. Added |
Fixes #363 — requires the approval app counterpart: nextcloud/approval#449
What this does
Adds a
%rplaceholder that is substituted with the user id of the approval requester.When a flow rule reacts to the approval app's tag assignments, the existing placeholders cannot provide the requester:
%aresolves to the approver on approve/reject and%oto the file owner. The approval app emits anApprovalStateChangedEventcarrying the requester right before it (un)assigns its tags (see the linked approval PR).Since the workflow engine reacts to the tag change synchronously within the same request, the new
ApprovalStateChangedListenerstores the requester in the request-scopedRequesterContext, andbuildCommand()substitutes%rfrom there.Behavior notes
PlaceholderNotSubstituted: the command is not executed and a warning is logged, consistent with%n.%ris also substituted on approval requests (pending tag), where it usually matches%a, but also covers (auto-)tagging scenarios without a session user.The README placeholder table is updated accordingly.