Coder Social home page Coder Social logo

eb's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar renovate[bot] avatar rye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

eb's Issues

Refactor

This is one big main function with all the logic in it besides clamping. This should be changed.

Add a mechanism for synchronizing delays to the start of a Slot

For example, if after #3 I specify a SlotTime of 1s and my command takes 500ms, a sleep of 0 slots of length should last 0ms, whereas a sleep of 1 should last 500ms.

I'm not sure I like this design, but it'd certainly be more real-time.

I could also see just subtracting from the delay the time that elapsed during execution, then clamping with a lower bound of 0ns to prevent panics.

Do not panic in main

This is not good behavior.

It's far better to make main return a Result that can be coerced to std::process::Termination; this is a far cleaner way of doing things anyhow.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cargo
Cargo.toml
  • anyhow 1
  • clap 4
  • simple_logger 4
  • log 0.4.20
  • rand 0.8.5
  • thiserror 1
github-actions
.github/workflows/release.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions-rs/cargo v1@844f36862e911db73fe0815f00a4a2602c279505
.github/workflows/test.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/upload-artifact v4@5d5d22a31266ced268874388b861e4b58bb5c2f3

  • Check this box to trigger a request for Renovate to run again on this repository

Call `sh -c` internally instead of spawning

It'd be far better, in my opinion, to launch sh -c with the arguments that are passed joined by a " ". This is what watch(1) does, so it wouldn't be too outlandish.

This might also let us drop the AppSettings::AllowExternalSubcommands and instead just accept all unmatched arguments as things to be joined when getting passed to sh -c.

  • Figure out what to do with clap
  • Call sh -c with arguments populated by our argv

Testing

I would like to figure out how to test this.

I think part of this will be extracting a runtime into more modular/testable code. I should also try to do integration tests.

Ability to monitor activity beyond mere process execution

Currently, all eb does is run a command.

It'd Be Niceβ„’ if, instead, eb could also watch for activity.

For example, if I run eb ssh <server that is restarting>, I'd like to be able to have it wait until some kind of trigger is hit, like new console output or network activity or something.

Currently, the loop just waits until the command fully completes and checks the status code.

Question(s)

  • Can we stop eb itself and let the child process become its own?

`eb` no longer accepts subcommands (or does... anything)

When doing prerelease testing for v0.4.0, I noticed that eb no longer accepts a command to run:

> cargo run -- --help
[...]
     Running `target/debug/eb --help`
eb 0.4.0-dev
Kristofer Rye <[email protected]>
A command executor exercising exponential backoff

USAGE:
    eb [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -x <max>        limits the number of times command is executed

Notice, in the above, that there isn't any mention of subcommands, as there is in v0.3.5:

> eb --help
eb 0.3.5
Kristofer Rye <[email protected]>
A command executor exercising exponential backoff

USAGE:
    eb [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

I believe this was caused by #82. I'll be working on a fix before releasing v0.4.0.

CI

Set up CI.

Integration Tests

I would like to have some integration tests, too, not just unit tests.

Part of this can be serviced by the tests/ subdirectory. I can write a script (or something) that monitors when and how eb calls it.

Also, I'd like to keep track of all of the user-facing parts (usage, output)

Question(s)

  • Is there a crate that allows me to test log! invocations?
  • Is there a crate that allows me to compare snapshots of text?
  • Could the most recent and its most recent questions be serviced by the same crate?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.