Port bash script nunet CLI to golang
Description
Who
What
- Port the current NuNet CLI tool written in bash to golang
How
Why
- The CLI was first written as a bash script to save time but since it's being used regularly by everyone nowadays, it's best to implement it in a more efficient, maintainable and cleaner way. The commands should stay the same with the same subcommands, arguments and response format except in cases where the original format was lazy implementation like the
nunet info
command which basically passes the raw metadata file through jq. In those cases, updating the output format in a more standard manner would be best.
When
Acceptance Criteria
Click to expand
Work Breakdown Structure (WBS)
Task | Description | Duration | Status | Start Date | End Date | Comment |
---|---|---|---|---|---|---|
A | Build Go from source | 0.5 Hr | Done | June 6 | June 6 | |
B | Choose framework/tool | 0.5 Hr | Done | June 7 | June 7 | |
C | Install Cobra | 0.5 Hr | Done | June 7 | June 7 | |
D | Demo "version" function | 3 Hrs | Done | June 7 | June 13 | |
E | Research on how to properly do JSON parsing, HTTP requests and error handling in Go | 4 Hrs | In Progress | June 12 | June 13 | |
F | Research on "mitchellh/cli" library | 3 Hrs | Done | June 20 | June 21 | |
G | Demo implementation of CLI | 3 Days | Done | June 21 | June 26 | Need to change MakeInternalRequest function in order to access /swagger/doc.json. Wrote some unit tests. I was having some issues regarding imported packages, guess that was caused by developing CLI as a subdirectory instead of inside the main file. I have to move to main.go before implementing the version function |
H | Move CLI to DMS' main.go | 1 Day | Done | June 27 | June 28 | The idea is to have a single binary for the CLI. That way, when running the main file, only the CLI will be initialized. In order to run DMS, the user would have to run nunet command with the --daemon flag. Only then the DMS would run as it previously did. |
I | Write function to get DMS version | 3 Hrs | Done | June 29 | June 29 | |
J | Replace daemon subcommand with --daemon flag | 4 Hrs | Done | June 30 | July 3 |
Edited by Gustavo Silva