File obs-server-2.9-0042-frontend-Properly-remove-annotate-gem.patch of Package obs-server

From 2f21d4c8fb50bbd294ad77263ab0ba7ace18477d Mon Sep 17 00:00:00 2001
From: Christian Bruckmayer <cbruckmayer@suse.com>
Date: Thu, 7 Jun 2018 15:04:17 +0200
Subject: [PATCH] [frontend] Properly remove annotate gem

This is a follow up on 499905fac8d87e23218dd6a43262859fbfccba94.
We remove annotate until we switch to bundle-gems service or our gem packaging scripts have a way
to deal with conflicting executeables.

As the previous commit did not remove annotate properly we reverted
it and do it in this commit.
We can revert this whole commit when we want to enable annotate again.
---
 src/api/Gemfile                             |  2 -
 src/api/Gemfile.lock                        |  4 --
 src/api/lib/tasks/auto_annotate_models.rake | 48 ---------------------
 3 files changed, 54 deletions(-)
 delete mode 100644 src/api/lib/tasks/auto_annotate_models.rake

diff --git a/src/api/Gemfile b/src/api/Gemfile
index 9c757d3c7a..eccd95a1e4 100644
--- a/src/api/Gemfile
+++ b/src/api/Gemfile
@@ -137,8 +137,6 @@ end
 group :development do
   # as alternative to the standard IRB shell
   gem 'unicorn-rails' # webrick won't work
-  # for annotating models with schema info
-  gem 'annotate'
 end
 
 group :development, :test do
diff --git a/src/api/Gemfile.lock b/src/api/Gemfile.lock
index e288e0710d..535c25f0f5 100644
--- a/src/api/Gemfile.lock
+++ b/src/api/Gemfile.lock
@@ -52,9 +52,6 @@ GEM
       airbrake-ruby (~> 2.5)
     airbrake-ruby (2.5.0)
     amq-protocol (2.3.0)
-    annotate (2.7.2)
-      activerecord (>= 3.2, < 6.0)
-      rake (>= 10.4, < 13.0)
     ansi (1.5.0)
     arel (8.0.0)
     ast (2.4.0)
@@ -426,7 +423,6 @@ DEPENDENCIES
   acts_as_tree
   addressable
   airbrake
-  annotate
   bcrypt
   bullet
   bunny
diff --git a/src/api/lib/tasks/auto_annotate_models.rake b/src/api/lib/tasks/auto_annotate_models.rake
deleted file mode 100644
index 72b6529bf8..0000000000
--- a/src/api/lib/tasks/auto_annotate_models.rake
+++ /dev/null
@@ -1,48 +0,0 @@
-# NOTE: only doing this in development as some production environments (Heroku)
-# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
-# NOTE: to have a dev-mode tool do its thing in production.
-if Rails.env.development?
-  task :set_annotation_options do
-    # You can override any of these by setting an environment variable of the
-    # same name.
-    Annotate.set_defaults(
-      'routes'                  => 'false',
-      'position_in_routes'      => 'before',
-      'position_in_class'       => 'after',
-      'position_in_test'        => 'before',
-      'position_in_fixture'     => 'before',
-      'position_in_factory'     => 'before',
-      'position_in_serializer'  => 'before',
-      'show_foreign_keys'       => 'true',
-      'show_indexes'            => 'true',
-      'simple_indexes'          => 'true',
-      'model_dir'               => 'app/models',
-      'root_dir'                => '',
-      'include_version'         => 'false',
-      'require'                 => '',
-      'exclude_tests'           => 'true',
-      'exclude_fixtures'        => 'true',
-      'exclude_factories'       => 'true',
-      'exclude_serializers'     => 'true',
-      'exclude_scaffolds'       => 'true',
-      'exclude_controllers'     => 'true',
-      'exclude_helpers'         => 'true',
-      'ignore_model_sub_dir'    => 'false',
-      'ignore_columns'          => nil,
-      'ignore_routes'           => nil,
-      'ignore_unknown_models'   => 'false',
-      'hide_limit_column_types' => 'integer,boolean',
-      'skip_on_db_migrate'      => 'false',
-      'format_bare'             => 'true',
-      'format_rdoc'             => 'false',
-      'format_markdown'         => 'false',
-      'sort'                    => 'false',
-      'force'                   => 'false',
-      'trace'                   => 'false',
-      'wrapper_open'            => nil,
-      'wrapper_close'           => nil
-    )
-  end
-
-  Annotate.load_tasks
-end
-- 
2.25.3