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

feat: set exit code 2 on validation failure; restore debug log file #150

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

TylerGillson
Copy link
Member

Issue

Resolves #138

Description

  • Set exit code 2 for validator rules check if validation fails for any rule.
  • Document exit codes.
  • Re-enable logging to disk under unique log directory per validatorctl execution.

Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
@TylerGillson TylerGillson requested a review from a team as a code owner August 9, 2024 14:06
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. new-feature Net-new feature labels Aug 9, 2024
Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
@TylerGillson TylerGillson requested review from ahmad-ibra and removed request for arturshadnik August 9, 2024 14:08
Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
Copy link

codecov bot commented Aug 9, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 21 lines in your changes missing coverage. Please review.

Files Patch % Lines
cmd/root.go 0.00% 6 Missing ⚠️
cmd/validator.go 57.14% 6 Missing ⚠️
pkg/cmd/validator/validator.go 83.33% 3 Missing and 2 partials ⚠️
pkg/logging/logger.go 75.00% 1 Missing and 1 partial ⚠️
tests/integration/common/cli_commands.go 50.00% 1 Missing and 1 partial ⚠️
@@            Coverage Diff             @@
##             main     #150      +/-   ##
==========================================
+ Coverage   38.96%   39.33%   +0.37%     
==========================================
  Files          41       41              
  Lines        5371     5417      +46     
==========================================
+ Hits         2093     2131      +38     
- Misses       2893     2899       +6     
- Partials      385      387       +2     
Files Coverage Δ
pkg/config/constants.go 100.00% <ø> (ø)
...integration/_validator/testcases/test_validator.go 92.88% <100.00%> (ø)
pkg/logging/logger.go 60.00% <75.00%> (+3.47%) ⬆️
tests/integration/common/cli_commands.go 75.00% <50.00%> (+3.57%) ⬆️
pkg/cmd/validator/validator.go 57.99% <83.33%> (+1.05%) ⬆️
cmd/root.go 72.41% <0.00%> (-5.37%) ⬇️
cmd/validator.go 81.33% <57.14%> (+0.96%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e7ab9a6...ed5b7d0. Read the comment docs.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 9, 2024
@TylerGillson TylerGillson merged commit 2a3fe4d into main Aug 9, 2024
8 checks passed
@TylerGillson TylerGillson deleted the feat/exit-codes branch August 9, 2024 17:14
ahmad-ibra pushed a commit that referenced this pull request Aug 19, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.1.2](v0.1.1...v0.1.2)
(2024-08-19)


### Features

* add maas plugin
([#160](#160))
([ab9f21a](ab9f21a))
* allow selecting aws creds from filesystem
([#171](#171))
([c3a714c](c3a714c))
* allow specifying Azure cloud to connect to
([#170](#170))
([6a4a704](6a4a704))
* read vCenter privileges from local file or editor
([#152](#152))
([94ddd90](94ddd90))
* set exit code 2 on validation failure; restore debug log file
([#150](#150))
([2a3fe4d](2a3fe4d))
* support configuring oci validationType on a rule
([#161](#161))
([8dfc501](8dfc501))
* support direct oci validation of private registries
([#173](#173))
([9cfeab9](9cfeab9))


### Bug Fixes

* correct TUI flow for `validator install -o --apply`
([#169](#169))
([0912f6e](0912f6e))
* export creds for aws and azure direct check
([#167](#167))
([5d569de](5d569de))


### Dependency Updates

* **deps:** update anchore/sbom-action action to v0.17.1
([#163](#163))
([416d23c](416d23c))
* **deps:** update github.com/validator-labs/validator-plugin-azure
digest to b4687e5
([#149](#149))
([e7ab9a6](e7ab9a6))
* **deps:** update github.com/validator-labs/validator-plugin-vsphere
digest to a93cb70
([#147](#147))
([79304b9](79304b9))
* **deps:** update module github.com/vmware/govmomi to v0.40.0
([#162](#162))
([acf4a25](acf4a25))


### Refactoring

* lazy configuration of oci auth and signature verification secrets
([#168](#168))
([cc2c056](cc2c056))
* remove explicit TypeMetas; use vapi constants
([#154](#154))
([28b321c](28b321c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer new-feature Net-new feature size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🌱 Set exit code for validator check --direct according to validation results
2 participants