mudler / mudler/yip

Errors in `if` expressions go undetected

Open
#45 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
113
Forks
34
Avg merge
14h 10m
Merged PRs (30d)
5

Description

Well, turns out that #44 isn't really an improvement since false if-expressions are reported as failures.

So you can't distinguish between "if expression evaluates to false" and "if expression is syntactically wrong" in the logs.

The actual problem is in console.Run which reports a non-zero exit code as error and combines stdout+stderr.

Maybe console.Run should check for non-empty stderr instead ? 🤔
Or a separate console.If is needed ? 🤷🏻‍♂️

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pkg/console/console.go, especially console.Run at the linked location, and trace how if expressions distinguish stdout from stderr and non-zero exit codes. Reproduce both a false if-expression and a syntactically invalid one; done means the logs distinguish those outcomes without reporting a valid false result as a failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.