File obs-server-2.9-0044-frontend-Require-some-dependencies-explicitly.patch of Package obs-server

From 0b5cd0bd7b0af1c282a576eaa0e76e60c8096d95 Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Sun, 28 Jun 2020 18:33:36 +0100
Subject: [PATCH] [frontend] Require some dependencies explicitly.

Loading some modules started breaking for some reason in Fedora 32
using bundler_ext with "Undefined constant" error for some class names
that are defined in a different module.

This results in immediate error when eager loading is used
(if class name causing error is defined in a module eager loaded later)
or delayed error is eager loading is not used.

The cause of this problem is unclear. Probably, this could be because
Fedora 32 switched from bundler 1 to bundler 2 (2.1.4 to be exact).

Anyway, this change adds explicit requires to work around this problem.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
---
 src/api/app/models/build_reason_file.rb  | 2 ++
 src/api/app/models/package_file.rb       | 2 ++
 src/api/lib/backend/api/build/project.rb | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/src/api/app/models/build_reason_file.rb b/src/api/app/models/build_reason_file.rb
index 8f440cc1ad..4bfa425cd2 100644
--- a/src/api/app/models/build_reason_file.rb
+++ b/src/api/app/models/build_reason_file.rb
@@ -4,6 +4,8 @@
 #   _project/_pubkey (just for read and delete),
 #   _history (readonly),
 #   _config
+require_dependency 'backend/file'
+
 class BuildReasonFile < Backend::File
   attr_accessor :project_name, :package_name, :repo, :arch
 
diff --git a/src/api/app/models/package_file.rb b/src/api/app/models/package_file.rb
index c2bcd6bf87..6b27fa13b6 100644
--- a/src/api/app/models/package_file.rb
+++ b/src/api/app/models/package_file.rb
@@ -1,4 +1,6 @@
 # Backend::File model to represent files that belongs to the package in the backend
+require_dependency 'backend/file'
+
 class PackageFile < Backend::File
   attr_accessor :project_name, :package_name
 
diff --git a/src/api/lib/backend/api/build/project.rb b/src/api/lib/backend/api/build/project.rb
index 3d4caebb9e..34c3e3a0ad 100644
--- a/src/api/lib/backend/api/build/project.rb
+++ b/src/api/lib/backend/api/build/project.rb
@@ -1,3 +1,5 @@
+require_dependency 'backend/connection_helper'
+
 module Backend
   module Api
     module Build
-- 
2.25.4