Skip to content

[8.x] Get 8.x passing again in CI (address failed checks caused by updates to Rubocop, Solr, ViewComponent) - #3883

Open
seanaery wants to merge 12 commits into
release-8.xfrom
fix-8x-ci
Open

[8.x] Get 8.x passing again in CI (address failed checks caused by updates to Rubocop, Solr, ViewComponent)#3883
seanaery wants to merge 12 commits into
release-8.xfrom
fix-8x-ci

Conversation

@seanaery

@seanaery seanaery commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
  • fix rubocop violations
  • add Solr 10 support
  • fix a helper spec that had started failing with view_component 3.x with 3.25.0+

seanaery added 2 commits July 17, 2026 12:27
- autocorrected new issues
- regenerated a fresh .rubocop_todo.yml via `--auto-gen-config`
- In Solr 10, `handleSelect="true"` in `<requestDispatcher>` was removed.
- That was the old mechanism that forwarded `/select` requests to the `default="true"`
  handler (named `"search"`). In Solr 10 you must have an explicit `/select` handler.
@seanaery
seanaery force-pushed the fix-8x-ci branch 4 times, most recently from 63669c6 to 1d02317 Compare July 17, 2026 21:25
- test had begun failing w/VC 3.25.0 release (Jun 2026)
- specific VC change `Fix stale render context on reused component instances` is the
  culprit; it resets helpers on every render, causing collection components rendered
  from a plain ActionView template to fall back to controller#view_context, which lacks the
  `blacklight_config` stub, so it raises a `NameError`
- stubbing `controller#view_context` to return helper ensures it resolves correctly
@seanaery seanaery changed the title [8.x] Fix rubocop violations causing failed lint jobs in CI for 8.x [8.x] Get 8.x passing again in CI (address failed checks caused by updates to Rubocop, Solr, ViewComponent) Jul 20, 2026
@seanaery
seanaery marked this pull request as ready for review July 20, 2026 12:25

@cjcolvar cjcolvar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! I see the build is green but I'm slightly concerned about a drift in configuration between main and the 8.x branch. Would it be possible to backport #3806 and #3819 so the solr configs and rubocop configs stay aligned?


<requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />

<requestDispatcher handleSelect="true" >

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW main still has this handleSelect="true" in its solrconfig. Maybe it should be removed it from there too?

Comment on lines +175 to +180
# In ViewComponent 3.25.0+, collection components rendered from a plain
# ActionView template fall back to controller.view_context for helpers
# instead of the stubbed helper. Workaround not needed on 2.x or 4.x.
if ViewComponent::VERSION::MAJOR == 3
allow(controller).to receive(:view_context).and_return(helper)
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@seanaery
seanaery force-pushed the fix-8x-ci branch 2 times, most recently from efcb154 to 13b7c12 Compare July 22, 2026 13:45
@seanaery
seanaery force-pushed the fix-8x-ci branch 3 times, most recently from 441d0c6 to 45e217c Compare July 22, 2026 19:00
… an asset manifest.

- fixes CI test failures impacting Rails 8.x without `--css=bootstrap`:
  Expected to find a manifest file in `app/assets/config/manifest.js` (Sprockets::Railtie::ManifestNeededError)
@seanaery

Copy link
Copy Markdown
Contributor Author

Thanks @cjcolvar for the good feedback. I have made more changes in response (including cherry-picking a few relevant commits from main) to address those drift concerns and get this more aligned with what’s currently on main. That of course has turned this into a much bigger PR (now 78 files changed) :-)

Solr Configs

  • schema.xml is now identical to what's on main.
  • solrconfig.xml is now almost identical to main. I left in the BL8 /advanced requestHandler, as BL9 included a lot of Advanced Search refactoring that likely shouldn’t be backported. And yes, <requestDispatcher handleSelect="true"> should be removed from main, as that has been obsolete since Solr 7.

Rubocop

  • .rubocop.yml is now identical to what’s on main.

Test Matrix

  • I added some Ruby 3.4 & Rails 8.1 scenarios to the matrix and dropped Ruby 3.1.
  • I also added a scenario that verifies that a Rails 8.x + BL8 app generation still works without the --css=bootstrap option; this required some shims in the ImportmapGenerator to ensure the Sprockets fallbacks for CSS actually work.
  • Since BL8 is naturally more permissive than BL9 on some dependency versions (esp. Bootstrap 4-5; ViewComponent 2-4; Sprockets still semi-supported) it was a little tricky to get all tests passing, but it is now green again.

@cjcolvar cjcolvar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work! ✨

This definitely was a lot more than I was originally thinking when I suggested the cherry-picking. Thanks for devoting this much to it! I think this puts the community in a good position for helping those who are still on 8.x (including me 🙂).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants