Repository navigation
feat(cloudbuild): hide flag values the selected release doesn't support - #158
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #158 +/- ##
==========================================
+ Coverage 36.34% 36.87% +0.53%
==========================================
Files 116 116
Lines 4287 4301 +14
Branches 1037 1038 +1
==========================================
+ Hits 1558 1586 +28
+ Misses 2522 2509 -13
+ Partials 207 206 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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>
…picker Check that CloudFirmwareReleasesPicker removes the values the selected release excludes, drops flags left with no values, and keeps everything for a release without exclusions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pfeerick
force-pushed
the
feat/cloudbuild-exclude-flags
branch
from
November 17, 2026 12:09
37b971a to
9a43663
Compare
|
EdgeTX Buddy has been automatically deployed to Cloudflare. |
Release.excludeFlags reused the GraphQL Flag type, which has an `id`.
Apollo normalizes objects by __typename and id, so a release's
`{ id: "language", values: ["AR"] }` and the actual language flag became
the same cache entry (Flag:language). The language flag ended up with
only AR, which the release then excluded, so the flag disappeared from the
picker (e.g. TX12 on v2.12.5). Every release's exclusions for a flag also
shared one entry.
Use a separate ExcludedFlag type keyed by `name`, which Apollo stores
inside each release. The picker test now keeps __typename in its mocked
response, like the real server, which reproduces the bug without the fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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
Cloudbuild offers some option flag values to releases that can't build them. For example, the Arabic (
AR) language is offered for v2.10–v2.12 colour builds, but it only exists from EdgeTX 3.0, so those builds fail to compile.EdgeTX/cloudbuild#154 lets cloudbuild limit flag values to specific releases. Each release in
/api/targetsnow lists the values it can't build:Cloudbuild also refuses such jobs with an error message. This PR makes Buddy hide those values, so users can't pick them in the first place.
What
Releaseinservices/cloudbuild.tsgainsexclude_flags.Releasetype gainsexcludeFlags: [ExcludedFlag](name,values), mapped fromexclude_flags. It's an empty list when the server doesn't send the field. It's deliberately not the existingFlagtype: Apollo normalizes objects with anid, so{ id: "language", values: ["AR"] }would overwrite the reallanguageflag in the cache and make it disappear.CloudFirmwareReleasesPickerremoves the selected release's excluded values from the flag list, and drops a flag if no values remain. This works the same way as the existingexcludeTargetsfilter.CloudVersionTargetFormalready clears a selected value that's no longer offered, so switching to an older release clears it on its own.Compatibility / merge order
Until EdgeTX/cloudbuild#154 is deployed, the server doesn't send
exclude_flags, so this change hides nothing. The existing recorded-fixture test exercises exactly that case. It's safe to merge in either order, but it only takes effect once cloudbuild is updated.Testing
cloudbuild.spec.ts: the fixture test now selectsexcludeFlags, which is empty for the old response. A new test checks thatexclude_flagsis mapped per release. All 4 tests pass in lockdown mode.CloudFirmwareReleasesPicker.spec.tsx(with__typenamein the mocked response, so Apollo caches as in the app and theFlagcollision above is caught): for a release with exclusions, the excluded values are hidden and a flag left with no values is dropped. For a release without exclusions, everything is offered. Before this, the picker had no test at all.yarn test:typesare clean.yarn --immutable:lint:all,fmt:check,test:typesand the fullyarn test(289 tests) all pass.🤖 Generated with Claude Code