poshbotio / PoshBot

Powershell-based bot framework
MIT License
536 stars 108 forks source link

Incrementally update or replace a progress message with new content on long running jobs #216

Closed sheldonhull closed 3 years ago

sheldonhull commented 4 years ago

I wanted to explore providing output of a long running step providing some feedback on overall progress. I created a PSSlack function to help with this on a long running job that would take the originating message id and then allow me to update with processed time or progress so that a long running job in Azure Pipelines would 1) not spam with new messages 2) allow a single message to get updated with a long running task details.

Expected Behavior

Suggested behavior, would be to provide easy functionality to post an initial response, and therafter allow -Append or -Replace on the original message so that instead of continual messages hitting on the progress, the existing message could be updated or replaced with the updates, allowing long running jobs to provide some context on where they are for a user.

Here's an example scenario:

Current Behavior

From what I can tell, output from the asynchronous jobs that poshbot performs only output at the end, and the only way for me to send incremental progress would be to invoke a PSSlack command directly. Does this sound right?

Currently the output occurs only at the end of the job, correct?

Context

Want to use poshbot as interface for some longer running commands. Without a way to output progress a little better it might be problematic for end users to depend on the job and require them to go to other log resources, which would defeat the point of me trying to provide a chatops solution here.

Your Environment

Related #199

If this not a good fit for chatops solution, no problem, just figured I'd post this to structure my discussion on this and get your insight when you have the time, rather than in slack. Cheers 🥂