• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

valkyrjaio / valkyrja-java / 30232753243
100%

Build:
DEFAULT BRANCH: 26.x
Ran 27 Jul 2026 02:41AM UTC
Jobs 1
Files 653
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Jul 2026 02:40AM UTC coverage: 99.977%. Remained the same
30232753243

push

github

web-flow
[Cli] Enforce option valid values in areValuesValid (#47)

# Description

CLI option `validValues` (the allowed values for an option) were stored,
exposed via getters/withers, and carried through the
`AttributeRouteCollector` to help output — but never actually enforced.
`areValuesValid()` only checked the option `mode` (`REQUIRED` ⇒ at least
one option present) and `valueMode` (`DEFAULT` ⇒ at most one option); it
never checked that a provided value was a member of `validValues`. As a
result an option declared with `validValues` such as `['json', 'xml']`
still accepted `--format=csv`.

This PR enforces `validValues` in `areValuesValid()`: when `validValues`
is non-empty, every bound option value must be a member of
`validValues`, otherwise `validateValues()` throws the existing
`CliRoutingOptionValuesValidationException`. An empty `validValues`
imposes no constraint (unchanged). The check composes with `valueMode`
`NONE`/`DEFAULT`/`ARRAY` (for `ARRAY`, every provided value must be
valid) and with `OptionMode` `REQUIRED`/`OPTIONAL`.

PHP is the reference implementation; the Java and TypeScript ports
mirror its behavior. This is one of three sibling PRs — see **Sibling
PRs** below.

## Types of changes

- [ ] Improvement _(non-breaking change which improves code)_
- [x] Bug fix _(non-breaking change which fixes an issue)_
- [ ] New feature _(non-breaking change which adds functionality)_
- [ ] Deprecation _(breaking change which removes functionality)_
- [ ] Breaking change _(fix or feature that would cause existing
functionality to change)_
- [ ] Documentation improvement

## Changes
- **`src/main/java/io/valkyrja/cli/routing/data/OptionParameter.java`**
— `areValuesValid()` now returns `false` (so `validateValues()` throws
`CliRoutingOptionValuesValidationException`) when any bound option value
is not a member of a non-empty `validValues` list; an empty list is
unconstrained. Mirrors the PHP reference implementation.
-
**`.github/ci/junit/src/test/jav... (continued)

1844 of 1846 branches covered (99.89%)

Branch coverage included in aggregate %.

5 of 5 new or added lines in 1 file covered. (100.0%)

6752 of 6752 relevant lines covered (100.0%)

4.34 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30232753243.1 27 Jul 2026 02:41AM UTC 653
99.98
GitHub Action Run
Source Files on build 30232753243
  • Tree
  • List 653
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #30232753243
  • b8086ee7 on github
  • Prev Build on 26.x (#30187751958)
  • Next Build on 26.x (#30235742201)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc