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

Allow interrupting continuous iteration #2291

Closed
wants to merge 0 commits into from

Conversation

ehei
Copy link

@ehei ehei commented Apr 18, 2023

Background

While running with the 'y -XXX' prompt, I found myself wanting to know how many steps had been performed, and how many were left out of how many I had authorized. Additionally, I wanted a way to interrupt the process without resorting to crashing the system or killing a process outright.

Changes

I created several variables to track both if an interrupt of the process was desired, by checking for the CTRL key being held down, and provided feedback in the output to show how many steps have been completed out of the total, and what the percentage done was.

Documentation

I add several comments like at line 472 (check for CTRL press, interrupt) and a comment where the addition to the prompt for feedback was created, as well as where the percentage done was calculated. Atomic tests for those could be pulled out, but I didn't want to continue falling being all the development. Happy to follow this up with pulling out methods and/or developing some decent tests if warranted.

Test Plan

Ran the app with several scenarios, including:

  • Run with just 'y'
  • Run with 'y -1' and let it complete
  • Run with 'y -2' and let it complete
  • Run with 'y -10' and stop with CTRL part way, then use 'c' to continue
  • Run with 'y -500' and stop someplace without continuing

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

As stated earlier, I did not add any tests for this PR, but would be happy to revisit tests and refactoring the user prompting and feedback if desired.

Looking forward to any and all feedback. Thanks!

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Apr 18, 2023
@github-actions
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@waynehamadi
Copy link
Contributor

@ehei hey sorry for the recent conflicts, if you push we'll definitely prioritize this.

@Pwuts
Copy link
Member

Pwuts commented Apr 18, 2023

Nice PR! We can't merge into stable though, so please change the base branch to master, and we'll try to get it merged asap. :)

@Pwuts Pwuts added the enhancement New feature or request label Apr 18, 2023
@Pwuts Pwuts changed the title Stable Allow interrupting continuous iteration Apr 18, 2023
@ehei
Copy link
Author

ehei commented Apr 18, 2023 via email

@Pwuts
Copy link
Member

Pwuts commented Apr 18, 2023

@ehei can you reopen when ready for review/merge?

@Pwuts
Copy link
Member

Pwuts commented Apr 18, 2023

Overlaps with #2069

@ehei
Copy link
Author

ehei commented Apr 18, 2023 via email

@Pwuts
Copy link
Member

Pwuts commented Apr 19, 2023

@ehei please reopen and @BillSchumacher will fix it

@Pwuts
Copy link
Member

Pwuts commented Apr 22, 2023

Blocked by #2481

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts Automatically applied to PRs with merge conflicts enhancement New feature or request
Projects
None yet
4 participants