ch.vorburger.exec icon indicating copy to clipboard operation
ch.vorburger.exec copied to clipboard

sketch of a more invasive CompletableFuture patch

Open mosesn opened this issue 2 years ago • 10 comments
trafficstars

This more invasive approach (compared to #121) lets us delete a lot of code. I think it's a matter of taste whether it's better or not, but I figured this would illustrate what I meant more clearly than chatting over PRs :).

I do not think we should merge this as-is. In particular, I put a lot of logic in an anonymous lambda in the constructor, and we can likely find a better home for it. I would also completely understand you saying that you don't like this approach and simply closing the PR.

mosesn avatar May 14 '23 20:05 mosesn

🛠 Lift Auto-fix

Some of the Lift findings in this PR can be automatically fixed. You can download and apply these changes in your local project directory of your branch to review the suggestions before committing.[^1]

# Download the patch
curl https://lift.sonatype.com/api/patch/github.com/vorburger/ch.vorburger.exec/126.diff -o lift-autofixes.diff

# Apply the patch with git
git apply lift-autofixes.diff

# Review the changes
git diff

Want it all in a single command? Open a terminal in your project's directory and copy and paste the following command:

curl https://lift.sonatype.com/api/patch/github.com/vorburger/ch.vorburger.exec/126.diff | git apply

Once you're satisfied, commit and push your changes in your project. [^1]: You can preview the patch by opening the patch URL in the browser.

sonatype-lift[bot] avatar May 14 '23 20:05 sonatype-lift[bot]

@mosesn this looks interesting! I'm in principle in favour of something like this, because I like the code simplification that this seems to bring. I would need to review it in full details though. And we're both so excited that both of our work overlaps a little bit - which is totally OK! Could I propose the following next steps in this order:

  1. Do you want to review my #123 + #124 and I merge those, for now? I do understand that this PR will then remove that again - and that's totally fine with me! I just prefer getting things merged in order, and then change them again (and have a baseline to revert back to, in the unlikely event that we would have to back this out again later).

  2. I finish a PR that I have WIP to add Checkstyle, in order to settle tabs vs spaces 🤣

  3. [I go to sleep]

  4. You rebase this PR

  5. I review this PR in details, may ask some questions and feedback, and then merge it

Would this sequence be OK for you?

vorburger avatar May 14 '23 20:05 vorburger

🤦 Sorry about the tabs, I haven't set up my emacs config properly for Java on my personal laptop and I try to avoid opening my work laptop on the weekend . . . I'll get right to that. That approach sounds good to me! One nit: how about we use spotless instead of checkstyle? Spotless has an autofixer that doesn't force me to use IntelliJ haha

mosesn avatar May 14 '23 20:05 mosesn

@mosesn voilà steps 1. & 2. are done, I'll go to 😴 now and this is all yours for 4!

vorburger avatar May 14 '23 21:05 vorburger

Looks like there are still a couple of bugs in it. Interestingly, I get a couple failures locally but they're different ones:

[ERROR] Failures:
[ERROR]   ManagedProcessTest.onProcessFailedInvokedOnCustomListenerWithExitValueChecker:67 expected:<2> but was:<1>
[ERROR] Errors:
[ERROR]   ManagedProcessTest.mustTerminateExec:210 » ManagedProcess Program [sleep, 30s] (in working directory /Users/moses/projects/ch.vorburger.exec/.) failed with Exception: , last 100 lines of console:
usage: sleep seconds

I think it's just discrepancies in the sleep and ls implementations though. I'll have to do some poking to figure out what's going on with the other issues. I don't think I'll get to it tonight, I'll try to figure it out later this week.

mosesn avatar May 15 '23 01:05 mosesn

I think it's just discrepancies in the sleep and ls implementations though.

Are you on Mac locally? The tests on the main branch may well be broken on Mac. (The CI only covers Linux.)

If so, raise a small separate PR to fix that, first?

vorburger avatar May 15 '23 04:05 vorburger

I think it's just discrepancies in the sleep and ls implementations though.

Are you on Mac locally? The tests on the main branch may well be broken on Mac. (The CI only covers Linux.)

If so, raise a small separate PR to fix that, first?

#135

mosesn avatar May 20 '23 12:05 mosesn

@mosesn Hi! It's been a while... 😃 Do you want to rebase this, and we can get this in?

vorburger avatar Sep 10 '23 18:09 vorburger

Hey, I think I'll get some time in the next few weeks to take a stab at rebasing this! Sorry for the delay

mosesn avatar Dec 08 '23 23:12 mosesn

@mosesn did you still want to rebase and clean this up for re-review and possible inclusion? Or forget about & close this one?

vorburger avatar Mar 27 '24 21:03 vorburger

@mosesn ping? 👋🏽

vorburger avatar Jun 02 '24 15:06 vorburger

Sorry for the delay! Finally found some time to work on OSS stuff while flying 🙃

mosesn avatar Jun 10 '24 14:06 mosesn

@vorburger ready for your review when you get a chance!

mosesn avatar Jun 10 '24 14:06 mosesn

LGTM! Thank You so much for having gotten back to this (it's been a while). Merging ASAP!

vorburger avatar Jun 16 '24 20:06 vorburger