GithubHelp home page GithubHelp logo

argrelay / argrelay Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 0.0 1.31 MB

Tab-completion & CLI search server = total recall for Bash shell

Home Page: https://argrelay.org

License: Apache License 2.0

Shell 11.49% Python 83.30% JavaScript 4.06% CSS 0.45% HTML 0.70%
argument-mapping auto-complete query-service bash bash-completion command-line search-interface cli

argrelay's People

Contributors

dependabot[bot] avatar halfdata avatar uvsmtid avatar uvsmtid-gs avatar vasi-grigo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

argrelay's Issues

Compute dynamic defaults

Selection of some data_envelope-s may provide (compute-able) defaults to find subsequent ones.

For example, when ServiceEnvelopeClass.ClassCluster ~ prod (not dev) is selected
for a function which performs remote login,
it makes sense to set ServiceArgType.AccessType ~ ro as default.
Conversely, if it is ~ dev (not prod), ServiceArgType.AccessType should be assumed as rw by default.

Such defaults cannot be adquately assigned statically because it depends on the function (plugin logic),
knowledge what will be done with these data_envelope-s, and should be extensible (again, by plugins).

The idea is to add a server-side hook for InvocatorPlugin
which inspects currently selected data_envelope-s
and computes these defaults for the next data_envelope-s.

Search in different collections

At the moment, argrelay server uses single Mongo DB collection for all objects.

Server:

  • cleans this single collection completely and populates all data_envelope-s on start,
  • keeps using that single collection for all searches while alive.

It works fine for small data sets, but adds extra latency (observable with mongomock) for large ones.

The idea is to specify extra parameter indicating collection name while storing and querying data_envelopes:

  • Server will inspect this parameter to select which collection it is supposed to be stored in.
  • Selected function will provide information in search_control which collection specific data_envelop has to be searched in.

This will:

  • Reduce latency in only specific scenarios.

    This may be simingly non-serious use cases with mongomock instead of real Mongo DB.
    But mongomock is expected to be the default choice (majority of installations).

  • Enable us to setup different handling for different collections.

    Some of them might be too big to re-populate on re-start (too long).

  • Avoid MongoDB limits on number of indexes per collection.

Support array/list "coordinate" for `data_envelope`

Some objects (for example, hosts or services) can exists in multiple places of descrete space at the same time.

For example, host can be both dev and test at the same time.

Most common use case are tags/labels (of any domain-specific meaning)

where more then one tag or label can be assigned to an object.

For example, an object being tagged by "red" and "blue" at the same time, should be found by "red" or "blue".

Is there another approach?

A naive alternative is to create copies of objects in every required "descrete space coordinate" where we want to find it.

However, user will have to disambiguate these copies by explicitly providing "red" or "blue" arg on the command line.
If one object is used for both, this is not required as the search stops when single object is found.

See also

See FS_06_99_43_60.list_arg_value.md.

Completion mode: "strict script" vs HMI

At the moment, argrelay is HMI-focused (implying that Human inputs the command):

  • Arguments can be reordered (and argrelay will guess which property/type they are based on value).
  • Fewer arguments is among main features (if object can be identified with fewer, no other args are required).
  • ... other tricks.

However, this might be unreliable for scripting as scripts run without human in the control loop.

Scripts will break if new data contains overlapped value sets across properties/types or if more args needed to identify objects required (even if data does not change, but some of the arguments do, there are "places in coordinate space" which are uniquely identified with fewer args and other places where same number of args is not enough).

"Strict script" mode should address these issues.

Combine `InterpResult` and `InvocationInput`

See derived classes of BaseResponse.

Combine InvocationInput and InterpResult into one as they are similar.

Make all data_envelope-s be exchanged as part of envelope_container-s.

Make EnvelopeContainer.data_envelope a list of data_envelope-s and send them wrapped into EnvelopeContainer per search_control class. This will make EnvelopeContainer.data_envelopes (potentially) contain more than one data_envelope. But this unifies code, makes tests less different, and actually wraps data_envelope-s into metadata of EnvelopeContainer.

Basic web GUI

Although not the primary purpose, basic web GUI with async queries can show what argrelay CLI tries to do in its more constraint terminal environment.

It also allows demoing argrelay for remote users (who don't have immediate access to shell).

Client does not receive arg types in data envelopes on action invocation (all other nested data is okay)

When command line is executed (and plugin receives InvocationInput data) those data_envelope-s as dict-s do not contain top-level keys which are clearly populated on the server side. See sample dict here - these keys (SomeTypeA, ...) would be missing.

Decouple Bash-client and client-server API

Currently, there is large space of values what Bash can provide to the client (RunMode enum and CompType)
while actual space of values (their combinations) sent to the server is limited.

This:

  • creates confusion,
  • leaks meaningless data to the server,
  • complicates server logic.

Map Bash input on the client and send specific values to the server.

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.