Repository navigation
feat(targets): limit option flag values to specific releases - #154
Merged
Merged
Conversation
…ints Option flag definitions (global or per tag) can now carry `value_constraints`, a map of value -> semver constraint. A constrained value is only accepted for releases matching the constraint: - build requests using it on other releases are rejected with "option flag not supported by release: <flag>=<value> requires release <constraint>, got <release>" - each release exposes the values it excludes as `exclude_flags`, computed at load time like `exclude_targets` - constraints on values not listed in `values` fail to load targets.json limits AR (Arabic, colorlcd) to >= 3.0.0-0, since it does not exist before EdgeTX 3.0 and older color builds fail to compile. The UI hides excluded values for the selected release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per EdgeTX's RADIO_LANGUAGES (radio/src/CMakeLists.txt): - HE first appears in 2.9.0 - RU and UA first appear in 2.10.0 - KO first appears in 2.11.0 v2.8.5 and v2.9.4 are still offered, so builds with these languages on older releases are now refused. 2.12 added no new radio languages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Korean support (EdgeTX/edgetx#6118, "feat(color): ...") only added LVGL fonts; there is no B&W (stdlcd) Korean font, so B&W builds can't render it. Move KO from the global language values to the colorlcd tag, keeping its >= 2.11.0-0 limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pfeerick
added a commit
to EdgeTX/buddy
that referenced
this pull request
Nov 17, 2026
cloudbuild now reports, per release, the option flag values that release cannot build as `exclude_flags` (EdgeTX/cloudbuild#154), e.g. the Arabic language before EdgeTX 3.0. Expose it as `Release.excludeFlags` and drop those values (and flags left with no values) from the cloud build flag picker, the same way `excludeTargets` filters targets. Servers that don't send `exclude_flags` yet yield an empty list, so nothing is hidden. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pfeerick
marked this pull request as ready for review
November 18, 2026 05:22
Use the same name for flag value limits as for target limits, so targets.json reads consistently: `version_supported` is a constraint on a target, and a map from value to constraint on a flag. Document version_supported, exclude_targets and exclude_flags in the README and the public API doc, including the `-0` rule for constraints that should match pre-releases and how to remove a whole flag from some releases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m 3.0 A flag's `version_supported` is now a single constraint for the whole flag, like a target's, so a flag can be removed from some releases without listing every value. Per-value limits move to `values_version_supported`. The two can be combined: a value is supported only if both allow the release. A flag with every value excluded is reported in exclude_flags with all its values, so clients drop it without any change. POWER_LED_BLUE was removed in EdgeTX 3.0, so limit power_led_blue to releases before 3.0.0 (nightly included in the exclusion). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KCX_BTAUDIO was added to the TX15 and TX16S MK3 targets on main (EdgeTX/edgetx#6777, #7056) and isn't in any 2.12 release; the 2.12.6 backports (EdgeTX/edgetx#8070) note it's main-only. On 2.12, CMake ignores the unknown option, so the build succeeds without the feature. Limit the flag to releases from 3.0.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Option flags and their values in
targets.jsonapply to every release. #153 addedARto the colour LCD languages, but Arabic only exists from EdgeTX 3.0 (EdgeTX/edgetx#8031). As a result, cloudbuild and Buddy offer AR for v2.10–v2.12 colour builds, and those builds fail to compile, becauseTRANSLATIONSis only defined for languages in that release'sRADIO_LANGUAGES.The same problem affects older languages (v2.8.5 and v2.9.4 are still listed) and whole options that only exist in some releases.
What
Flag definitions, either global or under a tag, can now be limited to releases with semver constraints, the same way targets already are:
version_supportedversion_supportedvalues_version_supportedThe two flag fields can be combined: a value is supported only if both allow the release.
option flag not supported by release: language=AR requires release >=3.0.0-0, got v2.12.5.exclude_flags(flag → values). It's computed at load time, the same wayexclude_targetsis. A whole-flag limit lists all of the flag's values, so clients drop the flag without any change.values_version_supportedkey that isn't invaluesfails the load, which catches typos.BuildRequestErrornow hasUnwrap, soerrors.Isworks on it.-0rule.doc/PublicAPI.mddescribesexclude_targetsandexclude_flagsfor clients.Use
-0in constraints (>= 3.0.0-0,< 3.0.0-0) so pre-releases follow the same rule as releases. Without it, a constraint never matches pre-releases.nightly(sem_verv3.0.0) isn't a pre-release.Limits in
targets.jsonLanguage limits come from
RADIO_LANGUAGESand the translation headers present at each release tag. 2.12 added no new radio languages.languageHE (colour)>= 2.9.0-0languageRU, UA>= 2.10.0-0languageKO (colour)>= 2.11.0-0languageAR (colour)>= 3.0.0-0power_led_blue< 3.0.0-0POWER_LED_BLUEwas removed on mainkcx_btaudio>= 3.0.0-0KO also moves from the global language list to the
colorlcdtag. Korean support (EdgeTX/edgetx#6118,feat(color)) only added LVGL fonts, and there is no B&W Korean font, so B&W builds can't render it.Compatibility
targets.jsonbefore the server update is harmless but doesn't enforce the limits.Testing
I ran the
build-n-test.ymljobs locally in Docker:go test ./...against Postgres 13.3npm run lintin ui/, plusnpm run buildAll pass. The new tests cover:
exclude_flags, JSON output, and invalid constraintstargets.json: each limited language,power_led_blueandkcx_btaudioagainst every listed release, and colour-only languages offered to colour targets onlyFollow-up
The matching Buddy change is EdgeTX/buddy#158, which hides the values in
exclude_flagsfor the selected release and drops flags with none left. It does nothing until this PR is deployed, so the two can merge in either order.🤖 Generated with Claude Code