Repository navigation
Conversation
…urrent one Comparing this package with an SDK's manifest cannot show a REMOVED option: the package may have options of its own, so "we have it, the SDK does not" proves nothing. The SDK's own manifests can. `yarn check:options-manifests` now also fetches the manifest of the PREVIOUS pin (scripts/sdk-baseline.json) and fails on every option it has that the current pin's manifest lacks, naming the option, both versions and the accessor that still writes it. A removal is either dealt with (accessor removed or deprecated) or acknowledged in the baseline with a reason. An acknowledgement for an option that was not removed fails too, so the file cannot lie. When native-versions.json moves, the baseline must follow: the check says what to write, and an offline test fails the plain `yarn test` the moment it does not, so a bump cannot skip the comparison. This is not hypothetical: iOS 7.0.0-beta7 removed detect.kill and capture.mach-exceptions, and their accessors lingered until noticed. Pointing the baseline at beta6 reproduces exactly those two findings. For the current pins (Android 7.4.1 -> 7.4.2, iOS 7.0.0-beta7 -> 7.0.0) nothing was removed. Human guided, AI implemented
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 58 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Claude finished @krassx's task in 40s —— View job Review of #191: SDK option-removal check
I read the code only. I did not run the test suite or the check against the network. Findings (1 inline, P3):
Observations that are not blocking:
Overall risk: Low Merge recommendation: Approve once you've decided on the P3, or merge as is. I found no correctness bugs in the comparison logic. Most important item to fix: Decide how hidden-option removals with no accessor should be treated (the inline comment). Positives:
|
| const removed = previous.options | ||
| .filter((option) => !currentKeys.has(option.key)) | ||
| .sort((a, b) => a.key.localeCompare(b.key)); |
There was a problem hiding this comment.
Severity: P3 Low
Problem: removed includes options with hidden: true. checkAccessors deliberately ignores hidden options (line 279), so React Native has no accessor and no obligation for them. A removal of an internal option here still fails the check, and the message offers only two exits: "remove or deprecate its accessor" (none exists) or "acknowledge it ... if React Native keeps it as an option of its own" (false).
Impact: A pin bump where the SDK drops an internal ($$.../hidden) option with no accessor forces a baseline entry whose only honest reason is "nothing in RN uses this". That is noise in the file and trains people to write boilerplate reasons. The next bump then fails again on the stale entry until it is deleted.
Scenario: Android bumps 7.4.2 -> 7.5.0 and the SDK drops one of the 3 hidden options in android-options-manifest.json. CI fails with REMOVED OPTION ... (an internal option), although no RN code can be affected.
Fix: Either skip hidden options with no accessor in accessorsByKey (report a hidden removal only when an accessor still writes it), or adjust the message for the (an internal option) case so an acknowledgement reason such as "internal, no accessor" is explicitly an accepted answer.
There was a problem hiding this comment.
Partly agreed, fixed in the latest push. You are right that $$DEBUG and $$WRAPPER should not fail a bump: nothing in this package uses them as options (the wrapper registers itself through setWrapper). But hidden is not the same as irrelevant: $$ENDPOINT is internal and the package depends on it (the endpoint accessor, the Expo plugin and the Android meta-data path), so losing it must fail. Skipping every hidden option with no accessor would miss exactly that, because the endpoint accessor reads its key through a constant and is not found by the accessor parser. NO_ACCESSOR is no use as the criterion either, since it only catalogues known internal keys. So there is now an explicit RELIES_ON_INTERNAL list (key and reason; $$ENDPOINT only), and a removed internal option is reported only if it is listed or an accessor writes it, with the message 'an internal option this package relies on'. Checked by hand: dropping $$DEBUG and $$WRAPPER is silent, dropping $$ENDPOINT fails. A test requires each listed key to be an internal option of both pinned SDKs.
…ge uses it A removed internal (hidden) option was reported like any other, although the package has no accessor for it and the only exits offered did not fit. But internal options are also the wrapper contract, and one of them matters: the endpoint override (`$$ENDPOINT`) is used by the endpoint accessor, the Expo plugin and the Android meta-data path. NO_ACCESSOR is only a catalogue of known internal keys (nothing uses `$$DEBUG` or `$$WRAPPER` as an option), so it is not the criterion. RELIES_ON_INTERNAL now lists the internal options the code really depends on, with the reason. A removed internal option is reported only when it is listed there or an accessor writes it; the message says "an internal option this package relies on". Dropping `$$DEBUG` and `$$WRAPPER` is silent; dropping `$$ENDPOINT` fails. A test requires every listed key to be a real internal option of both pinned SDKs. Human guided, AI implemented
|
Claude finished @krassx's task in 46s —— View job Review of #191 (re-review after
|
| } | ||
| const left = accessor === undefined ? '' : ` ${accessor} still writes it.`; | ||
| const internal = option.hidden === true ? ' (an internal option this package relies on)' : ''; | ||
| problems.push( |
There was a problem hiding this comment.
Severity: P2 Medium
Problem: A removed ordinary option is reported even after it has been dealt with. accessor is looked up only to word the message (line 473). It never decides whether to report. So removing or deprecating the accessor and re-extracting the fixtures, which is exactly what the message asks for, does not clear the failure. The previous pin's manifest still has the option and the current one still lacks it. No test covers a "removal dealt with, so it passes" case. The tests cover only "acknowledged" and "nothing removed".
Impact: The PR description and docs/launch-options.md say a removal is "either dealt with (accessor removed or deprecated) or acknowledged". In the code only acknowledgement can pass. A contributor who does the right thing, deleting the accessor, still has a red CI. The only exit is an acknowledgement whose message wording ("if React Native keeps it as an option of its own") is false for them. That teaches people to write boilerplate reasons, and the entry must then be deleted at the next bump.
Scenario: iOS 7.0.0 → 7.1.0 drops com.bugsee.option.foo. The contributor deletes foo from the options class, re-extracts the fixtures and regenerates the docs. yarn check:options-manifests still prints REMOVED OPTION com.bugsee.option.foo ... absent from 7.1.0. (without "still writes it"). It fails until acknowledgedRemovals gets an entry.
Fix: Decide what "dealt with" means and implement it. One option is to report a removal only while an accessor on that platform still writes the key and that accessor is not deprecated. AccessorInfo already has deprecated. Pass accessorsFor(accessors, platform) (it is already used for checkAccessors) rather than all accessors, so another platform's accessor cannot count. A removal with no live accessor then passes. Acknowledgement stays for the case where React Native keeps the key as its own option. The alternative is to change the docs, PR text and message to say acknowledgement is the only exit. Either way, add a test for it.
There was a problem hiding this comment.
Agreed, and it was a real gap: the text said 'dealt with or acknowledged' but only acknowledgement could pass. Fixed in the latest push, taking your first option. A removed option is now reported only while this package still has something for its key on that platform: a live accessor (not deprecated, and only the platform's own accessors count) or an entry in option-keys.json. Remove or deprecate the accessor and re-extract the fixtures and it clears; the message says what is left (captureAVPlayer still writes it / option-keys.json still lists it). Acknowledgement remains for a key React Native keeps as its own option. Tests added for: accessor gone, only a key-list entry left, a live accessor left, and that only the removed key's own leftovers count. Checked through the real CLI with a tampered iOS manifest: dropping capture.avplayer fails naming captureAVPlayer; acknowledged passes; and the historic beta6 removals (detect.kill, capture.mach-exceptions) now pass because RN has nothing left for them.
The docs, PR text and message said a removal is "either dealt with (accessor removed
or deprecated) or acknowledged", but only acknowledgement could pass: the accessor
was looked up only to word the message, so deleting it and re-extracting the
fixtures, exactly what the message asks for, left CI red.
A removed option is now reported only while this package still has something for its
key on that platform: a live accessor (one that is not deprecated) or an entry in
option-keys.json. Remove or deprecate the accessor and re-extract the fixtures and
it clears; acknowledgement stays for the case where React Native keeps the key as
an option of its own. The message says what is left ("captureAVPlayer still writes
it" or "option-keys.json still lists it"). The accessors considered are those of
the platform being checked, so another platform's cannot count. Internal options
keep their own rule (reported when relied on).
Human guided, AI implemented
|
Claude finished @krassx's task in 50s —— View job Review of #191 (re-review after
|
| problems.push( | ||
| `REMOVED OPTION ${option.key}${internal} was in the ${platform} ${previousVersion} manifest and is absent ` + | ||
| `from ${currentVersion}.${left === undefined ? '' : ` ${left}.`} Remove or deprecate its accessor and re-extract the fixtures, or, if ` + | ||
| 'React Native keeps it as an option of its own, acknowledge it in scripts/sdk-baseline.json with the reason.', |
There was a problem hiding this comment.
Severity: P3 Low
Problem: live is built from accessorsFor(accessors, platform), which includes owner: 'base' accessors (cli-options-sources.ts:59). A base accessor serves both platforms. When only one SDK removes the option, the base accessor stays live for that platform, and the message offers two exits that are both wrong for it. "Remove or deprecate its accessor" would break the other platform, where the option still exists. The acknowledgement wording, "RN keeps it as an option of its own", is false. The correct fix is to re-own the accessor to the platform that still has the option, and the message never says so.
Impact: A contributor handling a one-platform removal gets pushed toward deprecating a working accessor or writing a boilerplate acknowledgement. The entry then goes stale at the next bump.
Scenario: Android 7.4.2 → 7.5.0 drops com.bugsee.option.foo, which iOS still has and a base accessor foo writes. Re-extracting moves the key out of shared into the ios list, so the key list no longer counts. The base accessor still counts for android, so CI reports REMOVED OPTION ... foo still writes it and nothing in the message mentions changing the owner.
Fix: When the live accessor has owner === 'base', say so in left, for example foo is shared with the other platform; make it ios-only, or add "or, for a shared accessor, move it to the platform that still has it" to the message. A test for a base-owned accessor would pin this.
Separately, the PR text says that pointing the iOS baseline at beta6 "reproduces exactly the two historic removals". After this commit it no longer can: detect.kill and capture.mach-exceptions appear nowhere in packages/react-native/src, so by the new rule they are dealt with and pass. That was checked by grep, not by running the check. The description should say so, or the example in the message should change.
There was a problem hiding this comment.
Fixed in the latest push. The message for a leftover accessor now depends on who owns it (describeLiveAccessor, pure and tested): a platform's own accessor 'still writes it'; a shared one (BugseeLaunchOptions) says it is shared by both platforms and, if only the dropping SDK removed the option, must be moved to the other platform's class (AndroidLaunchOptions / IOSLaunchOptions), or removed if both did. Checked through the real CLI with iOS dropping capture.logs (a base accessor): the message names captureLogs and says to move it to AndroidLaunchOptions. On your second point, the beta6 example: that was already corrected in the PR description in the previous round, which now says the two historic removals pass because RN has since deleted their accessors and that the check would have caught them at the time; I confirmed the behaviour by running it (a beta6 baseline is silent), not just by grep.
A removed option can still be written by a SHARED accessor (BugseeLaunchOptions). When only one SDK dropped it, "remove or deprecate its accessor" breaks the platform that still has the option, and the acknowledgement wording is false. The message now says the accessor is shared by both platforms and must be moved to the class of the platform that still has the option, or removed if both SDKs dropped it. The wording is a pure, tested function (describeLiveAccessor) used by the check. Human guided, AI implemented
|
Claude finished @krassx's task in 29s —— View job Review of #191 (re-review after
|
| const internal = option.hidden === true ? ' (an internal option this package relies on)' : ''; | ||
| problems.push( | ||
| `REMOVED OPTION ${option.key}${internal} was in the ${platform} ${previousVersion} manifest and is absent ` + | ||
| `from ${currentVersion}.${left === undefined ? '' : ` ${left}.`} Remove or deprecate its accessor and re-extract the fixtures, or, if ` + |
There was a problem hiding this comment.
Severity: P3 Low
Problem: The new shared-accessor text (describeLiveAccessor) says to move the accessor or remove it, but the fixed suffix here still follows it with "Remove or deprecate its accessor and re-extract the fixtures". For a base-owned accessor, the full message reads "...move it to IOSLaunchOptions...; if both did, remove it. Remove or deprecate its accessor...". The last sentence tells the reader to do the thing the previous one says breaks the other platform.
Impact: Only wording, but this is the case the last commit set out to fix. A contributor who reads to the end may still deprecate a shared accessor that the other SDK still needs.
Scenario: Android drops com.bugsee.option.foo and iOS keeps it. The base accessor foo stays live for android. The report ends with the generic "Remove or deprecate its accessor", which is wrong for this accessor.
Fix: Keep the generic suffix only when the accessor is not shared. For example, have describeLiveAccessor return the whole instruction, or make the suffix depend on owner. The "or, if React Native keeps it as an option of its own, acknowledge it" tail can stay. A checkRemovals test with a base-owned live entry would pin the full message. The current tests cover only describeLiveAccessor in isolation.
Why
The published-manifest gate (#189) compares this package with the SDKs' manifests, and it deliberately never complains about an option this package has that an SDK lacks, because the package can have options of its own. That means it cannot see an option the SDK removed: "we have it, the SDK does not" proves nothing. The SDKs' own manifests can.
This is not hypothetical. iOS 7.0.0-beta7 removed
detect.killandcapture.mach-exceptions, and their accessors lingered in RN until someone noticed.What
yarn check:options-manifests(run in CI and before every publish) now also fetches the published manifest of the previous pin and fails on every option it has that the current pin's manifest lacks:scripts/sdk-baseline.jsonnames the previous and current version per platform (now Android7.4.1to7.4.2, iOS7.0.0-beta7to7.0.0), plus the removals already dealt with. Comparing against the previous pin (not just the previous release) covers every release in between.option-keys.json): remove or deprecate the accessor and re-extract the fixtures. If React Native keeps the key as an option of its own, acknowledge it in the baseline with a reason. An acknowledgement for an option that was not removed fails too, so the file cannot lie.native-versions.jsonmoves, the baseline must follow. The check says exactly what to write (Set "previous" to X and "current" to Y), and an offline test (sdk-baseline.test.ts) fails the plainyarn testthe moment it does not, so a pin bump cannot skip the comparison by forgetting the baseline.Verified
capture.avplayer(RN still hascaptureAVPlayerand a key-list entry) it fails naming the accessor; acknowledging passes; a removal RN has nothing left for passes (so the two historic iOS removals, whose accessors RN has since deleted, now pass; the check would have caught them at the time); a stale acknowledgement, a pin that moved without the baseline, and a malformed baseline each fail with a clear message (checked by hand).Limits
download.bugsee.com(immutable, so only the network can fail); an unreachable one fails the check, as for the current pin.Human guided, AI implemented