Skip to content

Latest commit

 

History

History
173 lines (150 loc) · 9.41 KB

_BACKLOG.md

File metadata and controls

173 lines (150 loc) · 9.41 KB

Backlog

Back to Index

Done

  • can run scripts based on yaml hierarchy
  • can run scripts based on yaml hierarchy (using prefixes)
  • can prompt user if path not complete
  • can prompt for env from stdin (allow providing defaults)
  • prompt user with a "replayable" script
  • external env var prerequisites (e.g. must have ZIPDROP_V3_BEARER_TOKEN)
  • env vars -> resolving env vars
  • opt to list resolved env values
  • support specifying multiple environments (comma delimited)
  • keep a history log (incl timestamp)
  • don't include process.env in the --printenv
  • throw error if $cmd is missing required environment variables
  • $ask > $choices (include populate from $cmd etc)
  • env vars specific to the script being run
  • $imports - extend from other yaml configs
  • --init script (also happens if no config file)
    • Create new config > "Blank"
    • Create new config > "NPM"
    • Create new config > from existing NPM (package.json)
  • run --init if no args supplied
  • No loop on list
  • hide debug output behind an opts
  • consolidate string, $env and $resolve to behave the same way ($env is a clash!)
  • replay last command / replay from log using _log_ option
  • $imports > extend to support remote (https://) urls (and a --pull option)
  • ability to run in docker container $image: node:lts-alpine
  • ABI support
    • ABI - discover json files with { abi: [...], address: '0xabc' } up to a max depth of 5
    • ABI - support view/non-payable functions (with args)
    • ABI - support payable functions (requires wallet) => env.PRIVATE_KEY
    • ABI - support historical function calls => env.BLOCK_NUMBER
    • ABI - document options (e.g. plugins: abi: true)
  • support emoji followed by space as a script name prefix (ignored when using prefix matchers)
  • support auto adding emojis 🪝📁 plugins: icons: true/false to toggle (default: true)
  • should normalise (lowercase and diacritics) strings, when matching script names
  • swap logging for LOG_LEVEL env var (info, debug, warn, error)
  • ensure ONLY script output is captured in the j run > out.txt - so jobs can be chained
  • add non-interactive --batch mode arg
  • handling of sensitive env vars -> include env groups specify per $cmd, only for that $cmd $envIncludes: 'secretEnvGroup'
  • support JSON as input for $choices ($filter / $fieldsMapping / $sort)
  • list environments
  • add relaxed json parsing for --stdin
  • support jsonpath in $fieldsMapping
  • append a ? to indicate optional imports:
  • $cmd - add ability to show a custom error message for non-zero exits $errorMessage (+documentation, +unittests)
  • add custom warning just in time - if trying to run $image and docker is not available
  • add npm plugin (default true)
  • add make plugin (default true)
  • create an $ssh augment for $cmd, similar to $image (use a SSH_SCRIPT for overriding)
  • when run, warn if not the latest version (check using npm view @mountainpass/hooked-cli version)
  • teardown orphaned docker containers on SYSINT
  • resolve $ssh hostname
  • ensure local env is resolved, BEFORE imports (esp -> DOCKER_ARCHIVE)
  • exclude host environment variables when running $script
  • use "->" arrow to list select (because sometimes colours aren't present) (i.e. use list instead of rawlist)
  • Scripts that run scripts, should inherit the system's environment variables.

Next

  • add ability for $envChoice - prompt user for a required environment to load

  • if calling self... don't exit the environment! call within system.

  • limit history to last 1000x

  • $cmd > add ability to $timeoutMs

  • $cmd > add ability to $retries (retries on error, default 0=disabled, -1=indefinite, additional $retryDelayMs)

  • ability to add $env at any sub level in scripts

  • show success / error messages after environment?

  • show success / error messages after scripts?

  • remember where we got to last "scripts"

  • remember previous stdin (use as defaults)

  • allow $cmd only scripts to be specified as a string on the env key?

  • allow environment resolution in all *_SCRIPTS.

  • document the plugins options

  • imports > add checksum verification (similar to docker sha256)

  • imports > add github.com (shorthand for https://raw.githubusercontent.com)

  • imports > use etag to check if changed

  • scripts > add regex search to cli and inapp selection - e.g. "build zip" => "build.*zip" => "build platform image to local zip"

  • $ask > check that defaults work for text and choices

  • (cli args) > document reason we want $ask option to be explicitly defined, and not just an environment variable

  • add dynamic scripts for npm
  • add ability to specify requiredEnvNames: <ENV_NAME>: <string error message>
  • hooked.yaml version validation - yml: version: >1.0.20
  • update "rerun" command with inputs (JUST IN TIME, after $ask resolution!) (in yellow!)
  • cleanup .env and .tmp on startup

create files at given location (even remotely or in docker image)

  • make $envFromHost overridable from the top level (feature flag)

  • allow overriding default docker run script

    • build
    • document
    • write unit test
  • support openapi calls - e.g. https://api-engineering.nyc3.digitaloceanspaces.com/spec-ci/DigitalOcean-public.v2.yaml

  • publish a yaml schema definition - e.g. # yaml-language-server: $schema=https://my.url.to/the/schema vs https://www.schemastore.org/json/

  • dynamic exec paths - e.g. npm, makefile, abi files, openapi specs, etc

  • if only one possible child path, prompt user to run it straight away

  • secrets - best practice: don't import into environment, share a file instead

  • secrets - parse output stream and obfuscate e.g. *** if printed

  • provide an example of a "poll until available" script

    • e.g. curl --fail-with-body ...

Workarounds

  • add a warning on homedir/import scripts if the chmod isn't 400 (optional)
  • Inquirer > Press to continue -> important for destructive operations? (e.g. overwrite prod) (workaround: read -p "Are you sure? " -n 1 -r)

Future

  • ability to dyanmically fetch the next script's children
  • styling
    • Add description
    • Add colour (edited)
    • Add emoji support
  • Tty handling - show error message? (already handled?)
  • Inquirer > Add autocomplete plugin
  • Inquirer > Tree plugin
  • Slack runner
  • global settings > username or ssh key
  • identity, in history, use for ssh key gen and approval
  • permissions (only really enforcable on server)
  • run remotely (e.g. on build server, esp for gated access)
  • concept of prerequisites (e.g. must have 'node' installed, or $cmd must exit with 0)

Descoped

  • $inject - inject yaml from a file - nah, just use the $imports instead
    • local
    • remote (e.g. extends: https://myserver/foo.yaml)
    • global settings under user profile > env vars
  • leverage existing scripts
    • Npm - nah, just use hooked instead!
    • Makefile - nah, just use hooked instead!
    • auto detect child folders with hooked.yaml? - nah, just use the $import feature instead!
  • Input type > Remote (e.g. rest api) - just use $cmd to populate inputs (one line per choice)
  • javascript - e.g. Math.max(10, ${DATE}) - just use docker and/or $cmd
  • add more executors (e.g. javascript?) - nah, user can just leverage a container or cli tool (same as above)
  • have "shared" environment variables (env agnostic) just use multi environments
  • --init script > Create new config > "Docker" if standardised, this could be a remote file
  • --init script > Create new config > $HOME/hooked.yaml left to the user to setup
  • --init script > Create new config > from existing Makefile too obscure, wait until desired before creating
  • Inquirer > Use the Inquirer - "Defaults" parameter - already have this behaviour
  • Inquirer > Exit option -> Interrupted plugin (esc to quit) just use ctrl+c
  • opt to list all commands - unnecessary, can already prompt user
  • non-interactive mode?
  • opt to select env names? (as opposed to having a default)
  • change -in from json to -in key=val key2=val2 (var args causes clashes with script targets)
  • $imports > extend $cmd to optionally specify a $cwd (current working directory e.g. relative to an imported script?) - tricky, any imported file should parameterise this, or be agnostic of dir
  • Pipelines - couldn't that just use a script?
  • consolidate env and stdin ? - No - stdin must be a separate output, so that jobs can be replayed
  • secrets - make $secret envs, that are only imported explicitly for a single run - No need for special top level env
  • add max limit of 1000 records to history - No, simply truncate your own history e.g. echo "$(tail -50 .hooked_history.log)" > .hooked_history.log