mindersec / minder

Software Supply Chain Security Platform
https://minder-docs.stacklok.dev/
Apache License 2.0
295 stars 43 forks source link

Add datasources CLI stubs #5020

Closed teodor-yanev closed 1 week ago

teodor-yanev commented 1 week ago

Summary

Provide a brief overview of the changes and the issue being addressed. Explain the rationale and any background necessary for understanding the changes. List dependencies required by this change, if any.

Fixes https://github.com/stacklok/minder-stories/issues/135

Change Type

Mark the type of change your PR introduces:

Testing

Outline how the changes were tested, including steps to reproduce and any relevant configurations. Attach screenshots if helpful.

Review Checklist:

coveralls commented 1 week ago

Coverage Status

coverage: 54.585% (-0.04%) from 54.627% when pulling 41592cddbcc90af4ad20b4709d48dc174ac957ff on add-datasources-cli-stubs into c8469dde13c5e470005702f48b739f73ca5d31a0 on main.

teodor-yanev commented 1 week ago

We can ignore the "proto-breaking-changes" check as the code is not used and still under development.

teodor-yanev commented 1 week ago

---Testing locally---

Results are as expected:

./bin/minder datasource get -n something
WARNING: Running against a test environment (127.0.0.1) and may not be stable
Message: Failed to get data source
Details: The service is currently unavailable
This is a most likely a transient condition and may be corrected
by retrying with a backoff.
./bin/minder datasource get
WARNING: Running against a test environment (127.0.0.1) and may not be stable
Usage:
  minder datasource get [flags]

Flags:
  -h, --help            help for get
  -i, --id string       ID of the data source to get info from
  -n, --name string     Name of the data source to get info from
  -o, --output string   Output format (one of json,yaml,table) (default "table")

Global Flags:
      --config string            Config file (default is $PWD/config.yaml)
      --grpc-host string         Server host (default "api.stacklok.com")
      --grpc-insecure            Allow establishing insecure connections
      --grpc-port int            Server port (default 443)
      --identity-client string   Identity server client ID (default "minder-cli")
      --identity-url string      Identity server issuer URL (default "https://auth.stacklok.com")
  -v, --verbose                  Output additional messages to STDERR

Details: at least one of the flags in the group [id name] is required
./bin/minder datasource list
WARNING: Running against a test environment (127.0.0.1) and may not be stable
Message: Failed to list data sources
Details: The service is currently unavailable
This is a most likely a transient condition and may be corrected
by retrying with a backoff.
./bin/minder datasource create
WARNING: Running against a test environment (127.0.0.1) and may not be stable
Usage:
  minder datasource create [flags]

Flags:
  -f, --file stringArray   Path to the YAML defining the data source (or - for stdin). Can be specified multiple times. Can be a directory.
  -h, --help               help for create

Global Flags:
      --config string            Config file (default is $PWD/config.yaml)
      --grpc-host string         Server host (default "api.stacklok.com")
      --grpc-insecure            Allow establishing insecure connections
      --grpc-port int            Server port (default 443)
      --identity-client string   Identity server client ID (default "minder-cli")
      --identity-url string      Identity server issuer URL (default "https://auth.stacklok.com")
  -v, --verbose                  Output additional messages to STDERR

Details: required flag(s) "file" not set
./bin/minder datasource delete -n something
WARNING: Running against a test environment (127.0.0.1) and may not be stable
Message: Failed to delete data source
Details: The service is currently unavailable
This is a most likely a transient condition and may be corrected
by retrying with a backoff.

Server message

"exception.message":"rpc error: code = Unavailable desc = DataSources feature is disabled"

@JAORMX Thanks for https://github.com/mindersec/minder/pull/5025