Coder Social home page Coder Social logo

redhat-developer / app-services-cli Goto Github PK

View Code? Open in Web Editor NEW
41.0 41.0 72.0 55.99 MB

Command Line Interface for RHOAS

Home Page: https://redhat-developer.github.io/app-services-website/

License: Apache License 2.0

Shell 0.70% Makefile 0.48% Go 98.31% HTML 0.27% JavaScript 0.24%
app-services rhoas

app-services-cli's People

Contributors

aedinc avatar alexal avatar ankithans avatar avano avatar b1zzu avatar bhardesty avatar bredamc avatar craicoverflow avatar dimakis avatar gkpani97 avatar gunnarmorling avatar jackdelahunt avatar jsvigneshkanna avatar karoloslykos avatar kashifsoofi avatar lburgazzoli avatar machi1990 avatar melissaflinn avatar nickmancari avatar nolancon avatar patrikhl avatar pmuir avatar renovate-bot avatar renovate[bot] avatar rkpattnaik780 avatar rmarting avatar safarmirek avatar smccarthy-ie avatar wtrocki avatar yati1998 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

Watchers

 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

app-services-cli's Issues

Login requires url

The current experience for the command was to be able to execute rhams login but the current command requires users to specify URL.

Add a Lint config file

What we are missing is a config file to easily manage lint rules in the project.

golangci-lint is used but this can be extended by adding a config file. See their docs

`rhmas kafka list` does not display anything when there is no Kafka clusters

We should at least display a message saying that the current user has no kafka clusters.

To reproduce -

change the results in https://github.com/bf2fc6cc711aee1a0c2a/cli/blob/dd3692b9d2e993fefd90db1afcc097e45f6ce306/mas-mock/src/handlers.js#L57 to return an empty list.

Start the mock-server

cd mas-mock
yarn 
yarn start

build the cli and then ./rhmas kafka list.

see attached image
Screenshot from 2020-11-05 16-21-43

The first command corresponds to what we have when there is something returned from the list.

The second command returns blank since the list is empty (this is a bug).
/cc @craicoverflow @wtrocki

Add CI build for Windows

There is a chance users will used this CLI on a Windows computer. We should ensure this builds on Windows by adding the appropriate steps to CI.

Create connect command mock

Investigate how connect command should look like.

See: redhat-developer/app-services-operator#2

When the user performs the bind command, the CLI contacts the MK Control Plane (Service API) and obtains a list of Kafka instances and metadata for them. It then asks the user which Kafka instance they want to bind to the OSD. When the user selects a Kafka instance, the CLI then creates the ManagedKafka custom resource and creates a secret. Finally on success the CLI returns info on how to create a service binding.

Add remote installation script

It should be straightforward for users to install the CLI. A simple script can be added and referenced in the README to allow users to install the binary with a single command.

Set up local Keycloak instance to mock MAS-SSO

What

Set up a local Keycloak instance which can be deployed with Docker Compose. This is to mock SSO authentication which is not ready yet.

Requirements

  1. The CLI needs to have a client registered in order to be able to authenticate.
  2. docker-compose.yml Keycloak configuration.

Refactor credentials section to use env variables.

TL;DR - single file produced (.kafka.env or something like it)
Contains environment variables that can be referenced:

URL
USERNAME
PASSWORD

Justification

We embeed credentials in properties at the moment.
that is good for local development.. but terrible for any deployment as one do not want to have credentials embedded in container etc. (classical 12 factor app thing tells that this is very bad)
I think we can change our credentials command to produce more than single file
It will always produce an environment file (that can be later easily translated into Operator/CR secret with the same variables)
Then separate quarkus properties files that reference it

List returns error when not logged in

You must be loggen in
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x164ae08]

goroutine 1 [running]:
github.com/bf2fc6cc711aee1a0c2a/cli/cmd/kafka.runList(0xc0002ff340, 0x1d3c1c8, 0x0, 0x0)
        /Users/wtrocki/Projects/mas/mas-devexp/rhmas/cmd/kafka/list.go:45 +0x1

CLI large renames and structure

Creating as separate issue as we need to pick time for this.

We need to:

  • Move all commands from cmd folder
  • Have testing file for each command/rule etc.
  • Rename packages that doesn't reflect the folder name.
  • Use folders to reflect packages /kafka/create

All points are based on the discussion but not settled stone.

MacOS: "rhoas" cannot be opened because the developer cannot be verified

When I want to run rhoas on MacOS in console/terminal, I get this warning:

alert_screenshot

I can allow rhoas in "System Preferences -> Security & Privacy" to run, but I would like to avoid this step and run rhoas instantly after download. It can look unsafe this way.

Steps to reproduce:

  1. Have a machine with MacOS
  2. Download tar.gz with rhoas
  3. Untar archive
  4. Run ./rhoas
  5. You should get warning mentioned above

Improvements for use/status command

  • Use is not validating value passed by user - wrong cluster can be set
  • Use might fetch all clusters and allow to specify name.
  • No validation for commands that rely on the cluster.
  • status should print text instead of json

Properly handle HTTP responses

Status codes should be handled and an appropriate message should be displayed in the console.

Example:

rhmas kafka list

This command outputs Error retrieving Kafka clusters: undefined response type when the response code is a 401.

A more helpful message would be something like You are not authorized to make this request. Please login using "rhmas login" or something along those lines.

Generally we are handling two cases right now: 200 == success and everything else is a generic error.

Identify plan for testing and verification of the CLI

Questions

  1. What kind of automation we want to use?
  2. Do we need to test with REAL API?
  3. Testing with mock
  • Currently CLI has mock that can test all the commands on the CI/CD process.
  1. Do we need some external closed CI/CD process or happy with github actions (possibly github actions doing all the job very well)

How to start

  • Check all moving parts of the CLI
  • Identify commands and what API they use.
  • See what areas require improvements
  • Engage with developers/Create issues/PR's with suggestions

Dynamic completion of Kafka instance names

You can press tab tab and get results from list as ids to select.

rhmas kafka use

> 1iSY6RQ3JKI8Q0OTmjQFd3ocFRg

3iSY6RQ3JKI8Q0OTmjQFd3ocFRg
4iSY6RQ3JKI8Q0OTmjQFd3ocFRg

Clean up config

The config abstraction is mixed with some unrelated elements that should be removed.

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.