Skip to content

Commit

Permalink
Merge pull request #5 from Wind-River/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ThinCrustt authored Feb 17, 2024
2 parents f27dd39 + 1c12c2e commit 69da33a
Show file tree
Hide file tree
Showing 30 changed files with 1,833 additions and 808 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ccli
ccli.exe
*.yml
*.yaml
log.txt
!ccli_config.DEFAULT.yml
data/*
data/*
ccli_config.yml
6 changes: 4 additions & 2 deletions ccli_config.DEFAULT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
##
## catalog address
server_addr: "http://localhost/api/graphql"
server_port: 80
##
## logging
## there are 2 log levels:
## 1 - debugger
## 2 - debugger with source data
log_file: 'log.txt'
log_level: 2
log_level: 1
##
##
## How much to indent the json format of an output file.
Expand Down
8 changes: 5 additions & 3 deletions ccli_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
##
## catalog address
server_addr: "http://localhost/api/graphql"
server_port: 80
##
## logging
log_file: 'log.txt'
log_level: 2
## there are 2 log levels:
## 1 - debugger
## 2 - debugger with source data
log_file: "log.txt"
log_level: 1
##
##
## How much to indent the json format of an output file.
Expand Down
42 changes: 21 additions & 21 deletions docs/ccli_manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,61 @@ We present an overview and user manual for the Catalog Command Line interface (c
operations on the Software Parts Catalog (SPC) such as adding new and updating parts and part profiles, uploading archives, and retrieving part and profile data.
The following operations are supported:

- **add** --part <file.yml> - adds a new part record to the catalog. See the 'add' section below for the format the required yml file. For example:
- **add** part <file.yml> - adds a new part record to the catalog. See the 'add' section below for the format the required yml file. For example:
```
$ ccli add --part openssl-1.1.1n.yml
$ ccli add part openssl-1.1.1n.yml
```
- **add** --profile <file.yml> - adds a new part profile document to the catalog. See the 'add' section below for the format the required yml file. For example:
- **add** profile <file.yml> - adds a new part profile document to the catalog. See the 'add' section below for the format the required yml file. For example:
```
$ ccli add --profile profile_openssl-1.1.1n.yml
$ ccli add profile profile_openssl-1.1.1n.yml
```
- **query** <string> - enables one to query the catalog for part data. For example:
```
$ ccli query '...'
```
- **export**
--fvc <file_verification_code>| --sha256 \<Sha256>| --id <catalog_id> -o <file.yml>
part fvc <file_verification_code>| sha256 \<Sha256>| id <catalog_id> -o <file.yml>
Export out data for a given part.
```
$ ccli export --id sdl3ga-naTs42g5-rbow2A -o file.yml
$ ccli export part id sdl3ga-naTs42g5-rbow2A -o file.yml
```
- **export**
--template <part | security | quality | licensing> -o <Path.yaml>
template <part | security | quality | licensing> -o <Path.yaml>
Export template for part or profile
```
ccli export --template security -o file.yml
ccli export template security -o file.yml
```
- **update** --part <file.yml> - enables one to update selective data fields of a part record. See the 'update' section below for the format the
- **update** <file.yml> - enables one to update selective data fields of a part record. See the 'update' section below for the format the
required yml file. For example:
```
$ ccli update --part openssl-1.1.1n.v4.yml
$ ccli update openssl-1.1.1n.v4.yml
```
- **upload** <source archive> - uploads the specified source archive. A a new part record will be created if it does not correspond part record exists otherwise
it will be associated with an existing part if it already exists.
```
$ ccli upload openssl-1.1.1n.tar.gz
```
- **find**
--part \<query> - searches catalog for matching part names and displays corresponding data
--id \<catalog_id> - retrieves a part from catalog using id
--sha256 \<sha256> - returns part id using given sha256
--fvc \<file_verification_code> - returns part id using given file verification code
part \<query> - searches catalog for matching part names and displays corresponding data
id \<catalog_id> - retrieves a part from catalog using id
sha256 \<sha256> - returns part id using given sha256
fvc \<file_verification_code> - returns part id using given file verification code
```
$ ccli find -part busybox
$ ccli find -sha256 <sha256>
$ ccli find part busybox
$ ccli find sha256 <sha256>
```
- **find**
--profile <security|quality|licensing> -id <catalog_id> - retrieves a profile from the catalog based on type and part id.
profile <security|quality|licensing> <catalog_id> - retrieves a profile from the catalog based on type and part id.
```
ccli find -profile security -id werS12-da54FaSff-9U2aef
ccli find profile security werS12-da54FaSff-9U2aef
```
- **delete**
--id <catalog_id> - deletes a part from the catalog using part id if the part has no related parts. Recursive flag can be used to delete a part and its sub-parts as long as they have no other related parts.
<catalog_id> - deletes a part from the catalog using part id if the part has no related parts. Recursive flag can be used to delete a part and its sub-parts as long as they have no other related parts.
```
ccli delete -id adjb23-A4D3faTa-d95Xufs
ccli deleteadjb23-A4D3faTa-d95Xufs
```
```
ccli delete -id adjb23-A4D3faTa-d95Xufs --recursive
ccli delete adjb23-A4D3faTa-d95Xufs --recursive
```

## Add
Expand Down
9 changes: 4 additions & 5 deletions docs/issues.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Issues


ccli $ ccli export 465643320081167825395ea940844e6bced516a178954a2abb302e22e924707575b4291a5f -o openssh-9.1.yml
*** ERROR - Path required to export data

above I forgot the --fvc yet the error talks about path
## Recursive and forced delete are currently disabled to reduce delete times and protect wrongfull deletion of files.
- Recursive delete can be done but results in an error even though the package is removed from the catalog since the files are not deleted.
- Forced delete is disabled on the backend completely and calling it acts similarly to a normal/recursive delete.


32 changes: 26 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,35 @@ module wrs/catalog/ccli
go 1.19

require (
bitbucket.wrs.com/scm/weststar/graphql-upload-go.git v0.5.0-rc.1
github.com/google/uuid v1.3.0
bitbucket.wrs.com/scm/weststar/graphql-upload-go.git v1.0.0-rc.0
github.com/google/uuid v1.4.0
github.com/hasura/go-graphql-client v0.9.2
github.com/rs/zerolog v1.14.0
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.2
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/klauspost/compress v1.10.3 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/compress v1.17.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
nhooyr.io/websocket v1.8.7 // indirect
)
Loading

0 comments on commit 69da33a

Please sign in to comment.