Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vexctl generate #150

Merged
merged 8 commits into from
Dec 15, 2023
Merged

vexctl generate #150

merged 8 commits into from
Dec 15, 2023

Conversation

puerco
Copy link
Member

@puerco puerco commented Dec 15, 2023

This PR introduces a new subcommand to vexctl: generate

With vexctl generate, users can automate the generation of VEX data from golden templates with known vex statements:

Usage:
  vexctl generate [flags] [product_id]

Examples:
vexctl generate "pkg:apk/wolfi/git

Flags:
      --author string        author to record in the new document (default "Unknown Author")
      --author-role string   optional author role to record in the new document
      --file string          file to write the document to (default is STDOUT)
  -h, --help                 help for generate
      --id string            ID string for the new VEX document (autogenerated by default)
      --init                 initialize a new templates directory in the path specified with -t
  -p, --product string       main identifier of the product, a package URL or another IRI
  -t, --templates string     path to templates directory (default ".openvex/templates")

The subcommand --help flag display a longer help explaining how generation works.

vexctl generate also includes a --init flag to scaffold a new templates directory, it writes an empty openvex document ready to append data and a README.

I will follow up this PR with documentation in the examples repo.

Signed-off-by: Adolfo García Veytia (Puerco) [email protected]

This commit adds a function to read the golden templates
to the ctl implementation

Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
This commit adds a generate() method to vexctl that generates
/data from a golden templates set

Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
This commit adds the vexctl generate command.

Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
@puerco puerco added the enhancement New feature or request label Dec 15, 2023
@puerco puerco requested a review from cpanato December 15, 2023 07:42
internal/cmd/generate.go Outdated Show resolved Hide resolved
pkg/ctl/implementation.go Outdated Show resolved Hide resolved
This commimt adds a --init flag that creates a new tempaltes directory

Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
@puerco
Copy link
Member Author

puerco commented Dec 15, 2023

OK, I've const'd away the readme contents. PTAL @cpanato :)

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool thanks

@cpanato cpanato merged commit 13fa934 into openvex:main Dec 15, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants