Repository navigation
fix(desktop): use the typed DefaultsKey for onboardingStep in tests - #12035
aryanorastar wants to merge 1 commit into
Conversation
OnboardingPersistenceClearingTests reached for the raw string "onboardingStep" in two places while the lines around it already used DefaultsKey.hasCompletedOnboarding.rawValue. The custom SwiftLint rule omi_inline_userdefaults_key flags exactly that shape, and this file is not in .swiftlint-baseline.json, so both were new violations rather than baselined debt: OnboardingPersistenceClearingTests.swift:60:22: error: omi_inline_userdefaults_key Violation: Use DefaultsKey.swift for typed UserDefaults keys Desktop Swift Static & Test Contracts is red on main because of it, and every open desktop PR inherits the failure through its merge ref, so the whole desktop queue is blocked on a two-token change. DefaultsKey.onboardingStep already exists with the raw value "onboardingStep", so this is behavior-identical by construction -- the same string reaches UserDefaults either way. After the swap the rule's regex, (?<!removeValue\()forKey:\s*", no longer matches anywhere in the file.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@Git-on-my-level this one is a two-line CI repair rather than a feature, so flagging it for a merge call ahead of my other PRs.
Both are still on This is deterministic, not cosmetic. The To be precise about the blast radius: a desktop PR that changes no The fix is behavior-identical by construction. Verified against the pinned linter, not by inspection. then restored the fix and it passes again. CI agrees: all four Swift jobs are green on this PR — Build & Tests, Release Compile, Static & Test Contracts, and Detect Changes. One thing this is not: it is not blocking releases. I checked Since it is someone else's merge that introduced it, I have no stake here beyond wanting the lane green; happy for anyone to take it over or land an equivalent fix. I am not bumping the rest of my queue with this. Separately, and not a merge blocker: the same CI window keeps throwing unrelated Swift test failures, a different suite each run — |
|
Thanks @aryanorastar — closing this one as superseded, with full credit for the diagnosis. The root-cause analysis was exactly right: the two raw An equivalent fix landed on The verification discipline here was excellent: proving the check actually covered this file by restoring the raw strings and re-running the pinned preflight, the blast-radius breakdown for #12029 and #11452, and confirming the release lane was unaffected. That write-up is what made the direct fix safe to land quickly. Appreciate the explicit "happy for anyone to land an equivalent fix" note — this close is exactly that, not a rejection. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Hey @aryanorastar 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
Summary
Desktop Swift Static & Test Contractsis red onmain, and every open desktop PR inherits the failure through its merge ref. The cause is two raw UserDefaults key strings in a test file:The custom rule's regex is
(?<!removeValue\()forKey:\s*", and this file is not in.swiftlint-baseline.json, so both are new violations rather than baselined debt.DefaultsKey.onboardingStepalready exists with the raw value"onboardingStep", so this is behavior-identical by construction — the same string reachesUserDefaultseither way. The lines immediately around these two already usedDefaultsKey.hasCompletedOnboarding.rawValue; these two were simply missed.Verification
grep -P '(?<!removeValue\()forKey:\s*"'returns nothing)..swiftlint-baseline.json(grep count 0), confirming these were flagged as new rather than pre-existing.DefaultsKey.onboardingStep.rawValue == "onboardingStep".Verified with the pinned linter itself, through the repo's own lane:
desktop-swiftlintis one of those 19. To confirm the check was actually exercising this file rather than skipping it, I restored the two raw strings and re-ran:Then restored the fix and it passes again.
Product invariants affected
none
Failure-Class: none