WA-CI-006: Fix next branch CI baseline failures#749
Conversation
All offenses introduced by PR #733 (WA-NEW-037: frozen_string_literal). 100% auto-correctable — no logic changes.
MiddlewareStackTest (3 tests):
- The algorithm simulation was missing the first initializer step:
app.config.middleware.insert 0, Rack::Timeout
- Without it, insert(1, Rack::Attack) placed Attack BEFORE Timeout
(Timeout shifted right to index 2 while Attack landed at index 1)
- Fix: each test now simulates all 3 initializer steps in order,
matching the production initializer in
config/initializers/10_rack_middleware.rb
PublishingIntegrationTest / SegmentOverridesIntegrationTest:
- session[:release_id] stores release.id.to_s per current_release= setter
- session[:segment_ids] stores segment ids as strings per override_segments= setter
- Tests were comparing raw BSON::ObjectId values against those string session values
- Fix: assert against .to_s forms to match what the session stores
No behavior changes — test fixes only.
Architecture ReviewVerdict: PASS_WITH_NOTES (LOW) SummaryThis PR is a clean CI-fixup with no production behavior changes. All substantive modifications are confined to test code and CI configuration. The architectural patterns used are sound and appropriate for the problem domain. Findings1. MountPoint Test Stubbing — Acceptable with minor noteFile: The refactoring replaces Assessment: This is a pragmatic, correct approach:
Downstream plugin impact: None — this is test-internal and doesn't change any public API or test helper behavior. 2. Middleware Stack Test Simulation — SoundFile: The fix adds the missing first initializer step ( Assessment:
3. CI Workflow — Follows best practicesFile: The Assessment:
4. BSON
|
🔒 Security ReviewVerdict: PASS SummaryThis is a test-and-lint-only PR with no production code changes. All modifications are confined to test files, CI configuration, and mechanical whitespace fixes. No security surface is affected. Findings1. BSON::ObjectId
2. CI workflow:
3. Singleton method monkey-patching (
4. Rubocop whitespace autocorrect (980 files) — No concern
RecommendationsNone — no action items. Reviewed by: security-sentinel | PR #749 | No production security surface affected |
Simplicity ReviewVerdict: PASS_WITH_NOTES FindingsMountPoint test stubbing — minor complexity note (LOW) The new approach replaces a broken app.define_singleton_method(:routes) { fake_route_set }
begin
MountPoint.cache = nil
result = MountPoint.find(Class.new)
assert_nil result
ensure
app.singleton_class.send(:remove_method, :routes)
endThis is correct and safe, but it introduces more moving parts than necessary — a fake_route_set = Object.new
fake_route_set.define_singleton_method(:named_routes) { { bad: bad_route } }
Rails.application.stub(:routes, fake_route_set) do
MountPoint.cache = nil
result = MountPoint.find(Class.new)
assert_nil result
endThe original failure was stubbing on Everything else — clean
Recommendations
Reviewed by: Simplicity Agent | Pipeline: WA-CI-006 Wave 1 |
Database ReviewVerdict: PASS SummaryNo database concerns. This PR contains zero migrations, zero schema changes, zero model changes, and zero query modifications. Analysis
Data-Relevant Changes Reviewed
No action required. |
Test Quality ReviewVerdict: PASS_WITH_NOTES SummaryAll test fixes are correct, well-reasoned, and properly scoped. The PR addresses CI baseline failures without introducing new test risks. Several changes are genuine quality improvements beyond just "making tests pass." Findings✅ MiddlewareStackTest (3 tests)All three test cases now correctly simulate all 3 initializer steps. The inline comments describing the algorithm sequence ( → ✅ PublishingIntegrationTest + SegmentOverridesIntegrationTestType correction ( ✅ MountPointTest (with one note)The new Note (LOW — already flagged in Wave 1): The ✅ ContentSystemTestJS-forced click ( ✅ LoggedInCheckoutSystemTest — Quality improvementThis is the strongest improvement in the PR from a test-quality standpoint:
✅ Rakefile: format_rerun_snippet guardThe three-branch fallback ( ✅ CI Workflow
Recommendations
Reviewed by: test-quality agent | Wave 2 |
Accessibility ReviewVerdict: PASS No accessibility-relevant changes in this PR. The diff contains exclusively:
No production views, templates, ERB, HTML, CSS, or JavaScript UI code was modified. There is nothing to evaluate for ARIA labels, semantic HTML, VoiceOver/screen reader compatibility, color contrast, touch targets, or keyboard navigation. Reviewed by: accessibility agent | Wave 3 |
Frontend ReviewVerdict: PASS_WITH_NOTES (LOW) Scope AssessmentNo production JavaScript, Stimulus controllers, ERB views, or asset pipeline files were modified. This PR is overwhelmingly Ruby lint fixes. The two frontend-relevant items are both in system test files only. Finding 1 — JS DOM Click (content_system_test.rb) ✅# Before
edit_link.click
# After
page.execute_script('arguments[0].click()', edit_link.native)Assessment: Appropriate workaround. Selenium's synthetic click raises Finding 2 — JS Cookie Expiration (checkout_system_test.rb)
|
| Area | Status |
|---|---|
| Production JS / Stimulus | Not touched ✅ |
| Asset pipeline | Not touched ✅ |
| JS DOM click workaround | Clean, appropriate ✅ |
| Cookie deletion via JS | Works in CI; HttpOnly assumption worth confirming |
| Button timing wait | Correct Capybara pattern ✅ |
No action required before merge. The HttpOnly note is informational only.
Reviewed by: frontend agent | Wave 3
Performance ReviewVerdict: PASS ScopeNo production application code was modified. All changes are confined to test files, Rubocop lint corrections, CI config, Rakefile, and Gemfile.lock. There are no algorithmic complexity, memory allocation, I/O, or throughput concerns for the running application. Analysis by Change1. Rubocop autocorrect (980 files — whitespace only) 2. MiddlewareStackTest fixes 3. BSON::ObjectId 4. System test fixes (JS click, cookie, assert_field) 5. CI workflow: 6. Rakefile Called only on test failures, not on every test execution. Each path is O(1):
Even at scale (e.g., 10,000 tests with 5% failure rate), this method would be called ~500 times total per suite run. The overhead per call is nanoseconds. No regression risk. 7. Gemfile.lock: loofah 2.9.1→2.25.0, nokogiri 1.15.7→1.19.1 SummaryNo performance regressions introduced. The Reviewed by performance agent — Wave 3 |
Documentation ReviewVerdict: PASS_WITH_NOTES No user-facing behavior changes; documentation/changelog updates aren’t needed for Rubocop autocorrects or test fixes. Notes:
|
✅ All Review Waves PassedAll reviewers returned PASS or PASS_WITH_NOTES. This PR is merge-ready.
Labeled |
Fixes #748
Changes
1. Autocorrect 980
Layout/EmptyLineAfterMagicCommentRubocop offenses2. Fix
MiddlewareStackTest(3 failing tests)The algorithm simulation was missing the first initializer step (
insert 0, Rack::Timeout).Without it,
insert(1, Rack::Attack)placed Attack at index 1 before Timeout (which shifted to index 2), failing thetimeout_idx + 1 == attack_idxassertion.Fix: each test now simulates all 3 production initializer steps in order:
3. Fix
PublishingIntegrationTest+SegmentOverridesIntegrationTestBSON::ObjectId failuresBoth session setters (
current_release=andoverride_segments=) store IDs as.to_sstrings,but the tests compared against raw
BSON::ObjectIdvalues:Verification
bundle exec rubocop --only Layout/EmptyLineAfterMagicComment→ 0 offensescurrent_release=incore/app/controllers/workarea/current_release.rbandoverride_segments=incore/app/controllers/workarea/current_segments.rbClient impact
None — test and lint fixes only, no behavior changes.