bottlerocket-os / bottlerocket-os/bottlerocket-test-system

TestSys CLI does not return useful yaml formatting errors

Open
#517 3 comments 0 reactions 0 assignees View on GitHub
blocked
Dominant language
Rust
Stars
18
Forks
27
PR merge metrics
No merged PRs in 30d

Description

Given a test yaml that looks like:

```yaml
---
apiVersion: testsys.bottlerocket.aws/v1
kind: Test
metadata:
name: hello-bones
namespace: testsys-bottlerocket-aws
spec:
agent:
name: hello-agent
image: "example-test-agent:demo"
keep_running: false
configuration:
mode: Fast
person: Bones the Cat
helloCount: 3
helloDurationMilliseconds: 500
resources: []
dependsOn: []
```

and attempting to run it:

```
❯ cli run file example_test_agent.yaml
Unable to read manifest
```

_*Note that the `keep_running` key should be `keepRunning`*_. The CRD key error isn't bubbled up from the underlying `read_manifest`

https://github.com/bottlerocket-os/bottlerocket-test-system/blob/e4c6d22e76cacde344ef0765ed5630edf15ea58e/cli/src/run_file.rs#L17

Still new to rust, but it would be great if a more descriptive error was returned.

Contributor guide

Open the contributing guide

Research direction

Start with cli/src/run_file.rs at the run_file entry point and reproduce the failure with `cli run file example_test_agent.yaml`. Trace how read_manifest reports the invalid keep_running key and determine where its underlying error is discarded. Done means the CLI surfaces a descriptive YAML or CRD validation error instead of only reporting “Unable to read manifest.”

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.