Command reconstruction - verb noun#291
Conversation
|
Would be nice to get #296 done as part of this change as well. |
|
At least one of the tests is broken: maybe a regression? |
1a2a7cc to
a8fb805
Compare
3fedcb6 to
08f5ac7
Compare
|
Black box review:
Also The former seems a bit clunky - did you consider:
|
|
In regard to single vs plural, we can one command name and then multiple aliases. It will just change the help text to have the 3 options |
e78f6d3 to
011ad49
Compare
| // TODO: this doesn't seem to get called even when an error returns from a command, but maybe urfave is doing a non zero exit anyways? nope: https://github.com/urfave/cli/issues/610 | ||
| fmt.Fprintf(os.Stderr, "ERROR: %v\n", err) | ||
| fmt.Fprintf(os.Stderr,"Client version: %s\n" , Version) | ||
| fmt.Fprintf(os.Stderr, "Client version: %s\n", commands.VersionCommand()) |
There was a problem hiding this comment.
CopyPasta - here - this shoould be commands.Version
(or just Version once you've moved the version var up to /version.go)
| @@ -15,16 +15,17 @@ import ( | |||
| // Version of Fn CLI | |||
| var Version = "0.4.106" | |||
There was a problem hiding this comment.
This is auto-set by in releases by the version bump tool - that expects a Version var in a version.goin the top level directory
Suggest creating version.go in ../ and just putting var Version = ".... in it as a global .
|
|
||
| func getWd() string { | ||
| type FnClient struct { | ||
| Client *fnclient.Fn |
There was a problem hiding this comment.
Don't see this being used anywhere - can it be deleted?
| @@ -138,7 +140,7 @@ func bumpVersion(funcfile *funcfile, t VType) (*funcfile, error) { | |||
| // cleanImageName is intended to remove any trailing tag from the image name | |||
|
|
||
| # start fn | ||
| CONTAINER_ID=$($fn start -d) | ||
| CONTAINER_ID=$($fn start server -d) |
There was a problem hiding this comment.
This is still just fn start right?
| @@ -1,7 +1,9 @@ | |||
| package main | |||
| package test | |||
There was a problem hiding this comment.
This is a unit test on common - should be under common/bump_test.go
| tctx.WithFile("func.go", goFuncDotGo, 0644) | ||
|
|
||
| tctx.Fn("--verbose", "build").AssertFailed().AssertStderrContains("Dockerfile does not exist") | ||
| tctx.Fn("--verbose", "build", "function").AssertFailed().AssertStderrContains("Dockerfile does not exist") |
There was a problem hiding this comment.
This should be fn build shouldn't it?
| @@ -0,0 +1,27 @@ | |||
| package test | |||
There was a problem hiding this comment.
No unit tests in /test (sorry should have called it "e2e_test" or something - I think this test already exists in client/call_fn_test.go (my bad)
| ) | ||
|
|
||
| type inputMap struct { | ||
| type InputMap struct { |
There was a problem hiding this comment.
Dox on all the structs in this file now their public.
| // • then generate a main.go with extensions | ||
| // • compile, throw in another container like main dockerfile | ||
| func (b *buildServerCmd) buildServer(c *cli.Context) error { | ||
| func (b *buildServerCmd) Build(c *cli.Context) error { |
There was a problem hiding this comment.
Don't see this referenced anywhere
Suggest you put this as its own top-level command rather than under the build verb
fn build-server ?
|
I did a quick scan and I think you pick up most uses of the ‘fn’ command that need changing in docs with the following grep: |
client works filter through get sub commands dumping this here re order folder structure add oracle specific context file struct and move around more files refactor apps and calls add a test folder to hold test files fix cli_config_test.go file switch around commands in crud_test.go enable bash or zsh auto completion remove bash completion for this structure change Add bash completion for commands, add aliases for lambda command and fix tests. remove old app command add nicer start command message add <image> command to creating route add both singular and plural object commands rebase with master and fix client issue add singular and plural options rebase Move version to main package to allow for auto-bump by releases. Change build-server to its own command so it does affect fn build and clutter the command. Remove some unused code. Fix tests. update context readme
1a7adf2 to
516451a
Compare
remove set command and replace with configure to set the configuration on an app/route
516451a to
3e3ddc3
Compare
| Action: cmd.buildServer, | ||
| Name: "build-server", | ||
| Usage: "build custom fn server", | ||
| Category: "DEVELOPMENT COMMANDS", |
There was a problem hiding this comment.
I think this belongs more closely to SERVER COMMANDS
rikgibson
left a comment
There was a problem hiding this comment.
Can we get "help" and "version" in an "Other Commands" group?
|
I think the help text is quite sparse at this point but that can be worked on in conjunction with @michael-w-williams and shouldn't be a blocker in any way. |
|
@rikgibson the |
2336fcb to
26d43c6
Compare
Update CLI commands to reflect new CLI verb/noun structure to follow: fnproject/cli#291
Update CLI commands to reflect new CLI verb/noun structure to follow: fnproject/cli#291
Update CLI docs to reflect new CLI verb/noun structure to follow: fnproject/cli#291
Reconstruction of the command structure within the CLI. It has been changed from a
nounverbtoverbnounstructure, as described in issue #216Folders added:
Open for suggestions: I don’t like the way the structure no handles apps and routes config.
fn list config appsI think it would be nicer to havefn list apps configbut urfave will be expecting that 4th command and thereforefn list appswill not be valid.^^ We went with
fn config [app | route] <key> <value>to set a configuration.Following changes to documentation and commands:
Fn #1031
Tutorials #87
Flow Lib Go #5
Fdk-ruby #13
Fdk-java #138