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

docs(validate): add ruleset example and option categories #569

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

KellyMerrick
Copy link
Contributor

@KellyMerrick KellyMerrick commented Jun 17, 2024

Added an example for ruleset data usage.

7. Validate a pipeline with ruleset data $ vela validate pipeline --branch dev --event push

Added categories to options to help organize the long list. Due to sorting alpha, prepended with a number to control the category sorting.

OPTIONS:
   --help, -h  show help

   1. Repo:

   --org value, -o value              provide the organization for the pipeline [$VELA_ORG, $REPO_ORG]
   --pipeline-type value, --pt value  type of pipeline for the compiler to render (default: "yaml") [$VELA_PIPELINE_TYPE, $PIPELINE_TYPE]
   --repo value, -r value             provide the repository for the pipeline [$VELA_REPO, $REPO_NAME]

   2. Pipeline:

   --compiler-starlark-exec-limit value, --starlark-exec-limit value, --sel value  set the starlark execution step limit for compiling starlark pipelines (default: 7500) [$VELA_COMPILER_STARLARK_EXEC_LIMIT, $COMPILER_STARLARK_EXEC_LIMIT]
   --file value, -f value                                                          provide the file name for the pipeline (default: ".vela.yml") [$VELA_FILE, $PIPELINE_FILE]
   --max-template-depth value                                                      set the maximum depth for nested templates (default: 3) [$VELA_MAX_TEMPLATE_DEPTH, $MAX_TEMPLATE_DEPTH]
   --path value, -p value                                                          provide the path to the file for the pipeline [$VELA_PATH, $PIPELINE_PATH]
   --ref value                                                                     provide the repository reference for the pipeline (default: "main") [$VELA_REF, $PIPELINE_REF]
   --remote                                                                        enables validating a pipeline on a remote server (default: false) [$VELA_REMOTE, $PIPELINE_REMOTE]
   --template                                                                      DEPRECATED (Vela CLI will attempt to fetch templates if they exist) (default: false) [$VELA_TEMPLATE, $PIPELINE_TEMPLATE]
   --template-file value [ --template-file value ]                                 enables using a local template file for expansion [$VELA_TEMPLATE_FILE, $PIPELINE_TEMPLATE_FILE]

   3. Ruleset:

   --branch value, -b value                                                     provide the build branch for the pipeline [$VELA_BRANCH, $PIPELINE_BRANCH, $VELA_BUILD_BRANCH]
   --comment value, -c value                                                    provide the build comment for the pipeline [$VELA_COMMENT, $PIPELINE_COMMENT, $VELA_BUILD_COMMENT]
   --event value, -e value                                                      provide the build event for the pipeline [$VELA_EVENT, $PIPELINE_EVENT, $VELA_BUILD_EVENT]
   --file-changeset value, --fcs value [ --file-changeset value, --fcs value ]  provide a list of files changed for ruleset matching [$VELA_FILE_CHANGESET, $FILE_CHANGESET]
   --status value                                                               provide the expected build status for the local validation (default: "success") [$VELA_STATUS, $PIPELINE_STATUS, $VELA_BUILD_STATUS]
   --tag value                                                                  provide the build tag for the pipeline [$VELA_TAG, $PIPELINE_TAG, $VELA_BUILD_TAG]
   --target value                                                               provide the build target for the pipeline [$VELA_TARGET, $PIPELINE_TARGET, $VELA_BUILD_TARGET]

   4. Compiler:

   --clone-image value                        the clone image to use for the injected clone step (default: "target/vela-git:v0.8.0@sha256:02de004ae9dbf184c70039cb9ce431c31d6e7580eb9e6ec64a97ebf108aa65cb") [$VELA_CLONE_IMAGE, $COMPILER_CLONE_IMAGE]
   --compiler.github.token value, --ct value  github compiler token [$VELA_COMPILER_GITHUB_TOKEN, $COMPILER_GITHUB_TOKEN]
   --compiler.github.url value, --cgu value   github url, used by compiler, for pulling registry templates [$VELA_COMPILER_GITHUB_URL, $COMPILER_GITHUB_URL]

@KellyMerrick KellyMerrick self-assigned this Jun 17, 2024
@KellyMerrick KellyMerrick requested a review from a team as a code owner June 17, 2024 19:10
Copy link
Member

@wass3rw3rk wass3rw3rk left a comment

Choose a reason for hiding this comment

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

TIL about the Category field :D

Copy link

codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.26%. Comparing base (fab1d59) to head (6eff0d6).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #569   +/-   ##
=======================================
  Coverage   75.26%   75.26%           
=======================================
  Files         167      167           
  Lines        4359     4359           
=======================================
  Hits         3281     3281           
  Misses        848      848           
  Partials      230      230           
Files Coverage Δ
command/pipeline/validate.go 71.42% <ø> (ø)

@KellyMerrick KellyMerrick merged commit 0ffa368 into main Jun 18, 2024
16 of 19 checks passed
@KellyMerrick KellyMerrick deleted the docs/validate branch June 18, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants