Exec Body Fn should be passed Parent BotAction
#43
No reviewers
Labels
No labels
Automated
Backlog
Post_Prototype_1.0
Bot_Code
Core
Bot_Code
Custom
CI/CD
Complexity
Advanced
Complexity
Basic
Complexity
Expert
Complexity
Intermediate
Kind/Breaking
Kind/Bug
Kind/Bug Fix
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Nix
Ownership
Collab
Ownership
Collab with Leads
Ownership
Individual Lead
Ownership
In-Review
Ownership
Needs Owner > May Delegate
Ownership
Workshop with Leads
Phase 1.0
Requirements > Drafting
Phase 1.0
Requirements > Researching
Phase 1.0
Requirements > Review & Planning
Phase 2.0
Design > Research & Analysis
Phase 3.0
Coding > Implementation
Phase 4.0
QA > Unit Testing & Design
Phase 5.0
Resolution > Completed
Phase 5.0
Resolution > Review for Completion
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: modulatingforce/forcebot_rs#43
Loading…
Reference in a new issue
No description provided.
Delete branch "parent-botaction-to-child-fn"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Title : Exec Body Fn should be passed Parent BotAction
Passing Parent
BotAction
to Child ExecBody functions would allow child functions to access attributes of the BotAction including :At the moment, an example use case I want this is for
Chat.Say()
to validate the target channel firstThis is a small blocker of enhanced routine functionality , as Child ExecBodies may want to pull attributes from the Parent Routine . Routine core functionality can run without the changes from this PR
The change would require relatively major refactoring, I believe. In particular, I believe the following areas :
bot_actions.rs
Plan of Action :
BotAction
structure in above areas for desired functionalityChat.Say()
so it validates Module of Target ChannelBotMsgType:Notif
takes care of some recursive loops I kept seeing with newChat
validationBotAdmin
without Channel Level Elevated Role (Mod,etc), they must promote themselves first in Both Source & Destination ChannelsAt the moment, I'm able to do this (problem) scenario :
s TestChannel
to send a message to the Destination ChannelPotential way to approach,
I should have a way so the roles are checked just in the destination if say message ?
Live Tests - Passed
[x] Test Case > PASSED
Scenario
BotAdmin
roleSource
Channel, Sender does NOT have anyChannel_Elevated
rolesDestination
Channel, Sender does NOT have anyChannel_Elevated
rolesWorkflow
Say
toDestination
Channel_Elevated
Roles forDesintation
Notif
toSource
(by usingPrivMsg
)Channel_Elevated
Roles forSource
BotAdmin
RoleNotif
by passing toClient.Say()
[x] Test Case > PASSED
Scenario
BotAdmin
roleSource
Channel, Sender does have SOMEChannel_Elevated
rolesDestination
Channel, Sender does NOT have anyChannel_Elevated
rolesWorkflow
Say
toDestination
Channel_Elevated
Roles forDesintation
Notif
toSource
(by usingPrivMsg
)Channel_Elevated
Roles forSource
Notif
by passing toClient.Say()
[x] Test Case > PASSED
Scenario
BotAdmin
roleSource
Channel, Sender does NOT have anyChannel_Elevated
rolesDestination
Channel, Sender does NOT have anyChannel_Elevated
rolesWorkflow
Say
toDestination
Channel_Elevated
Roles forDesintation
Notif
toSource
(by usingPrivMsg
)Channel_Elevated
Roles forSource
BotAdmin
Rolereturn
without anyNotif
message sent[x] Test Case > PASSED
Scenario
BotAdmin
roleSource
Channel, Sender does have SOMEChannel_Elevated
rolesDestination
Channel, Sender does NOT have anyChannel_Elevated
rolesWorkflow
Say
toDestination
Channel_Elevated
Roles forDesintation
Notif
toSource
(by usingPrivMsg
)Channel_Elevated
Roles forSource
Notif
by passing toClient.Say()
[x] Test Case > PASSED
Scenario
BotAdmin
roleSource
Channel, Sender does NOT have anyChannel_Elevated
rolesDestination
Channel, Sender does have SOMEChannel_Elevated
rolesWorkflow
Say
toDestination
Channel_Elevated
Roles forDesintation
Say
by passing toClient.Say()
[x] Test Case > PASSED
Scenario
BotAdmin
roleSource
Channel, Sender does have SOMEChannel_Elevated
rolesDestination
Channel, Sender does have SOMEChannel_Elevated
rolesWorkflow
Say
toDestination
Channel_Elevated
Roles forDesintation
Say
by passing toClient.Say()
[x] Test Case > PASSED
Scenario
BotAdmin
roleSource
Channel, Sender does NOT have anyChannel_Elevated
rolesDestination
Channel, Sender does have SOMEChannel_Elevated
rolesWorkflow
Say
toDestination
Channel_Elevated
Roles forDesintation
Say
by passing toClient.Say()
[x] Test Case > PASSED
Scenario
BotAdmin
roleSource
Channel, Sender does have SOMEChannel_Elevated
rolesDestination
Channel, Sender does have SOMEChannel_Elevated
rolesWorkflow
Say
toDestination
Channel_Elevated
Roles forDesintation
Say
by passing toClient.Say()
Business Logic :
Chat
Module'senum BotMsgType
As a Custom or Core Developer, when Sending a Message, I should keep the following in mind
Send a
BotMsgType::Notif
tosend_botmsg()
if I want to ensure the Roles of the Sender in the Source Channel is Considered first before sending the Notification message to the Source ChannelBotAdmin
or Channel elevated usersSend a
say()
orsay_in_reply_to()
that's very similar toClient
API , but includes passing anExecBodyParams
send_botmsg()
, but raises aBotMsgType::Notif
in certain scenarios of access control failuresBusiness Logic :
bot_actions
module'sstruct ExecBodyParams
As a Custom or Core Developer, for
BotActions
, I could used passedparams::ExecBodyParams
to pull locks or data from common parameters such as thebot
or parentBotAction
As a Core Developer , when developing features that require enhancing (adding or adjusting) passed input parameters to ExecBodies , we can just adjust this one area at struct definition, then adjust other areas if required (generally is not required when at least adding more members)
WIP: Exec Body Fn should be passed Parentto Exec Body Fn should be passed ParentBotAction
BotAction
this
BotCommand #48