GithubHelp home page GithubHelp logo

ibm-functions / shell Goto Github PK

View Code? Open in Web Editor NEW
59.0 59.0 16.0 4.23 MB

An Electron-based development tool for IBM Cloud Functions and Composer.

License: Apache License 2.0

JavaScript 89.49% Shell 1.52% CSS 7.71% HTML 1.19% Python 0.01% Java 0.01% Dockerfile 0.07%
cli electron faas functions ibm-cloud ibm-cloud-functions openwhisk serverless shell visualization

shell's People

Contributors

kerryspchang avatar kingpong avatar lionelvillard avatar rabbah avatar starpit avatar tardieu 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  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  avatar  avatar  avatar  avatar

shell's Issues

Block loading zip actions

I'm looking at a sequence and accidentally clicked on action that is a zip. The result was not pretty...

image

Socket hang up when invoking composer apps

When invoking a long-running composer sequence (~20 sec), I get the error

Unknown Error From API: socket hang up

in both thefsh CLI and the Electron shell. A later inspection of the activation logs shows that the top-level action and all subactions completed successfully. I can retrieve the result of the top-level action in the Electron shell.

Please let me know how I can provide more information if needed.

export history to a file

i'd like to save my history to a file, is there support for this yet?
also history -h would be nice.

Loading indictators

@cfjedimaster commented on Mon Oct 09 2017

I'm testing stuff at an airport with slow wifi and there is significant lag going from one thing to another. With no loading indicators, it appears as if things are broken. I'd add loading indicators pretty much everywhere.

File completion options do not disappear

When typing into the shell, I get filename completion options below where I am typing the command. If I click on one of the filenames, it completes as expected but the filename options below the typing area do not disappear. The options remain in place even if I hit enter multiple times.

This only happens when I click on one of the options.

Support naming inline functions

The shell does a good job of handling inline functions:

image

It basically just shows a code snippet. But it would be nice if I could somehow annotate my code and have that show up instead. If I want the code I can still get it via the links at the bottom, but I'd much rather have a short name instead of a code snippet.

fsh table, but for an app

I absolutely love the detailed reports in fsh table, however, it looks to only report on the last 5 things with activity. If my thing is not on that list, I'm screwed. Also, I may not care about the actual table per se, just the activity grid for app/action X.

So I'd like to see something like: fsh table X

Table doesn't really make sense in this context, but basically, give me a report just for X, I don't care about other items.

Error report issue in table

I noticed that one of my actions had a 100% error rate (the last one):

image

However, I clicked in for details...

image

Also note in the first screen shot there are "undefined" errors.

Consider slimming the header

@cfjedimaster commented on Tue Oct 10 2017

This is probably a bit picky, but I figured I'd post it to see what other's thought. Look at the amount of space used for the header here:

image

Maybe it should be slimmed down a bit? I don't plan on doing "stuff" in the shell, but I know some folks will, so having more space to enter commands and such may be nice.


@rabbah commented on Tue Oct 10 2017

The footer seems to have expanded also in recent releases.

fast toggle to disable side car

when i'm creating a bunch of actions quickly, each one will open the side car which then i imediately dismiss to regain full scree for the terminal --- would it make sense to add a checkbox or some toggle that allows me to disable the sidecar?

Help for shell

Where is the help for commands supported by the shell? Running help loads up info on some things, but what about commands like ls, cat, clear, etc?

Also - where is the help about the shell environment in general. For example, I just found that pwd works. It shows my local directory from where I ran fsh. But ls is a list of resources. So... in some ways the file sys commands are remote, and sometimes they are local.

bugs creating actions from local zip files

the shell enters GC of Death when creating actions from existing local zip files. symptom:

fsh action update foo foo.zip

followed by a hang of the shell that can only be resolved by force-quitting (kill -9) the shell.

context retaining function name incorrectly sometimes

haven't reproduced consistently but as you can see in these screen grabs, the action is gone but the context is not updated correctly... and similarly after an invoke, landing in the activation context leaves the action name in place which leads to more errors.

screen shot 2017-10-14 at 6 37 29 am

screen shot 2017-10-14 at 6 38 48 am

displaying activation bug

@ioana-blue commented on Wed Oct 11 2017

I had this happen twice, so it seems like a consistent bug. I list activations, click on the second one, I get the result you can see in the print screen. That's a fragment of the logs (actually probably all the logs for that activation). Also, fsh shell goes to lala land and never comes back.

screen shot 2017-10-11 at 1 14 56 am


@ioana-blue commented on Wed Oct 11 2017

This print screen may help debug.

screen shot 2017-10-11 at 1 21 15 am


@ioana-blue commented on Wed Oct 11 2017

the ibm cloud token above may be a red herring. one pattern that I identified and might help debug: the action was a web action that returned something unexpected like {body: undefined} due to a bug in calling openwhisk sdk (it looks like a corner case that may be hard to reproduce). I had the same issue twice in a row. from the same fsh shell session I was able to visualize other activations just fine.

tab through clickable elements

it might be nice to avoid the mouse sometimes, and to be able to tab through a clickable context and hit enter to select

consider sidecar below terminal instead of the right

it's a better use of white space in some cases (screen shots)
and avoid the problem of changing the width of the terminal when rapidly creating actions.
maybe there's a fast switch mode to move the side car from right to bottom.

related to #21.

compact mode toggle

when the side car is open, the left side uses a compact mode which drops the context and drops some of the white space between commands. can we made that an option without the side car also?

Resizable Editor View

It would be really nice to be able to resize the editor view for code, as well as have a dedicated close button for editor view code. Or maybe a collapse button that can be toggled

does --url require --reset on a new space

i switched to a new namespace where i had not fsh app init previously.
attempted to run a composition was told there was no redis instance.
so i ran fsh app init --url to set the url, and inspect it was set with fsh app config.
then attempted to run again, but received the same error message.
inspected the setting with fsh app config there was no url set.
retried this time adding --reset and all worked as expected.

Multi-line for commands

After running /bluemix login, without specifying --user and --org, the error message
Please specify --user and --org and --space, as all three are required for logging in to Bluemix gets cut off if the window is too narrow or the editor for a function is open, because it reformat to take up multiple lines. This also applies to commands that are typed in

Also, as a feature request, the workspace name in the top right maybe could have a GUI for logins/switching workspaces.

Shell stops accepting commands if call tree visualization sends error.

Sometimes when I look at the call tree, I click on an action and get this message This activation is probably from the CLI, and so has no timeline tree to render. After that, I'm unable to enter any more commands in the shell (I can type a command but the "enter" key doesn't seem to work). I have to restart the shell to fix

list actions in single column

listing action in a single column is convenient when working with lots of actions and looking for one by name (ls -l? of course -l may be confused with --limit from the wsk cli.)

webbify not documented

@cfjedimaster commented on Tue Oct 10 2017

Typing fsh and the help screen does not mention webbify. Also, if you fsh webbify, check out the result:

"Please select an action, either via "webbify ", or by opening it in the sidecar"

That sounds like maybe it was meant for UI, not the CLI.


@cfjedimaster commented on Tue Oct 10 2017

Also note it isn't in the graphical help.

fsh does not run in Windows Git Bash environment

Running fsh in a Windows Git Bash environment does not work.
Tested version: 1.3.353
Output:

$ fsh
/c/Program Files/nodejs/node_modules/@ibm-functions/shell/bin/fsh: line 43: /c/Program Files/nodejs/node_modules/@ibm-functions/shell/bin/../dist/IBM Cloud Functions Shell-mingw64_nt-10.0-x64/IBM Cloud Functions Shell: No such file or directory

Cause: In @ibm-functions/shell/bin/fsh script the PLATFORM variable has the value of "mingw64_nt-10.0" and the platform detection does not recognize it properly.

My fix (using example from https://stackoverflow.com/a/17072017/8731727):
Replace

elif [ "${PLATFORM}" == "win32" ]; then
    BIN="$DIR/../dist/IBM Cloud Functions Shell-${PLATFORM}-x64/IBM Cloud Functions Shell.exe"

with

elif [ "${PLATFORM}" == "win32" ] || [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ] || [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
    BIN="$DIR/../dist/IBM Cloud Functions Shell-win32-x64/IBM Cloud Functions Shell.exe"

add a cli command dry run for working with apps

the wsk CLI offers a -v verbose mode to show the REST API calls it makes for CRUD operations, to invoke an action, etc. It may be useful to add the same for the shell.

working with actions, the api is the same as actions, but the schema is slightly different.
invoke an action is the same.

the dry run will be helpful for those who interface to openwhisk and functions through the rest api.

error rendering an action

i have an action where the shell's raw response is:

{
    "name": "unicode",
    "publish": false,
    "annotations": [{
        "key": "exec",
        "value": "nodejs:6"
    }, {
        "key": "web-export",
        "value": true
    }, {
        "key": "raw-http",
        "value": false
    }, {
        "key": "final",
        "value": true
    }],
    "version": "0.0.2",
    "exec": {
        "kind": "nodejs:6",
        "code": "function main(args) {\n    var str = args.delimiter + \" ☃ \" + args.delimiter;\n    console.log(str);\n    return { body: str };\n}\n",
        "binary": false
    },
    "parameters": [],
    "limits": {
        "timeout": 60000,
        "memory": 256,
        "logs": 10
    },
    "namespace": "guesr_demos"
}

and there's an error on the console and the code does not render:

Cannot read property 'value' of undefined TypeError: Cannot read property 'value' of undefined TypeError: Cannot read property 'value' of undefined
    at maybeAddWebBadge (file:///Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM%2…Functions%20Shell.app/Contents/Resources/app.asar/content/js/ui.js:931:159)
    at Object.self.showEntity (file:///Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM%2…Functions%20Shell.app/Contents/Resources/app.asar/content/js/ui.js:1102:25)
    at render (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64/IBM Cloud Functions Shell.app/Contents/Resources/app.asar/content/js/repl.js:263:32)
    at response (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64/IBM Cloud Functions Shell.app/Contents/Resources/app.asar/content/js/repl.js:287:5)
    at resolve (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64/IBM Cloud Functions Shell.app/Contents/Resources/app.asar/content/js/repl.js:603:104)
    at cmdPromise.then.then.response (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64/IBM Cloud Functions Shell.app/Contents/Resources/app.asar/content/js/repl.js:602:32)
    at process._tickCallback (internal/process/next_tick.js:103:7) TypeError: Cannot read property 'value' of undefined
    at maybeAddWebBadge (ui.js:931)
    at Object.self.showEntity (ui.js:1102)
    at render (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64…:263)
    at response (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64…:287)
    at resolve (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64…:603)
    at cmdPromise.then.then.response (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64…:602)
    at process._tickCallback (internal/process/next_tick.js:103)

bluemix login

it would be nice if bluemix login didn't require me to enter my org and space and instead if i don't provide any, the plugin should list my available org/spaces accessible for whisk.

then i can just select one (and if there's only one, then perhaps auto select it).

further, it seems that if i enter the wrong command:

[/bluemix] login
arg_without_options is not defined. Enter help to see your options.

this should perhaps skip the prefix.

and i omit the --user option, do not prompt me for my password.

lastly, i would prefer if the login was simply: login myid.

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.