Repository navigation
Conversation
The factory_bot version used by the test suite requires observer, which is no longer a default gem on Ruby 3.4 and newer. Keep this compatibility dependency in the test group. AI assistance: Codex.
Member
|
@theforeman/packaging |
This branch has not been 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.
What
Declare
observerin the test-only dependency group, with automatic requiring disabled like the existingfactory_bot_railsdeclaration.Why
Foreman's current factory_bot 5.x test dependency requires
observer. Ruby 3.4 moved that library out of its default gems, so the test suite cannot load on newer Ruby even when the application itself boots successfully.This keeps the existing factory API and production dependency set unchanged. A major factory_bot upgrade is a separate change, not required to fix this missing test dependency.
Reproduction: https://github.com/jakduch/foreman/actions/runs/38786115767/job/116598424745
Testing
observerLoadError: Rubocop, boot, migrations, schema restoration, the targeted Foreman logging tests and standalone factory_bot loading all passed. The full Ruby 4 unit suite is running next; full application compatibility is not claimed by this dependency-only fix.Tested revision:
abfbc57d3b6f1f9ffe71e6774d93d41fc13f141d.Issue: https://projects.theforeman.org/issues/39913
Related tracking: https://projects.theforeman.org/issues/39910
AI assistance: Codex.