Skip to content
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

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

Closed
sheldonhull opened this issue Jun 28, 2020 · 0 comments

Comments

@sheldonhull
Copy link

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:

  • User sends invocation to AWS Systems Manager to run a command document to expand an EBS volume.
    This might take a day if it's a big volume, or minutes if small.
  • Job initiates, and provides command id and link to log
  • Thereafter the code moves onto a loop and samples the cloudwatch logs and parses some output and appends to the message
  • The job then polls periodically the EBS volume modification state and percentage complete and uses -Replace to update the existing message every 5 mins with current progress and status
  • Job completes and final message is a -Replace that gives a humanized "total time to process", link to the cloudwatch logs, new volume information, and finally mentions the original person that submitted to the command to ensure they get notified.

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

  • AWS
  • Microsoft Teams
  • Powershell 7 / docker

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 🥂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant