Bug #13772

The orchestration code uses SQL logger

Added by Ivan Necas over 1 year ago. Updated 2 months ago.

Status:Closed
Priority:Normal
Assigned To:Lukas Zapletal
Category:Orchestration
Target version:Team Daniel - iteration 3
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/4454, https://github.com/theforeman/foreman/pull/3729
Story points-
Velocity based estimate-

Description

It should have it's own logger. Ideally with using the hierarchy system,
that the Logging library provides, https://github.com/TwP/logging/blob/master/examples/hierarchies.rb
so that one could extract logging for the whole orchestration, or a part of it.


Related issues

Related to Foreman - Bug #14980: Unused_ip AJAX request fails: undefined method `from' for... Closed 05/10/2016
Related to Katello - Refactor #19002: Use ApplicationRecord instead of ActiveRecord::Base Closed 03/23/2017
Related to Discovery - Refactor #19003: Use ApplicationRecord instead of ActiveRecord::Base Closed 03/23/2017
Related to Foreman Remote Execution - Bug #19395: Failure when migrating database with foreman_remote_execu... Closed 04/26/2017

Associated revisions

Revision 4deab2f3
Added by Lukas Zapletal 2 months ago

Fixes #13772 - orchestration now uses app logger

Revision 2e7dfc3d
Added by Ivan Necas 2 months ago

Refs #13772 - ensure ApplicationRecord is loaded soon enough

In `lib/core_extensions.rb` we define as `per_page` method, that gets
called by `will_paginate` at load time of the models. The issue is
we are using `Setting` model there, that inherits from the
`ApplicationRecord` but the `ApplicationRecord` is not loaded yet at
that time, which leads to Rails not knowings it's abstract class
and therefore expecting it to be a base for STI.

After this patch, we require the `ApplicationRecord` soon enough to make
sure it's present before using any other model.

History

#1 Updated by Lukas Zapletal about 1 year ago

  • Related to Bug #14980: Unused_ip AJAX request fails: undefined method `from' for #<IPAM::Dhcp..> added

#2 Updated by The Foreman Bot 10 months ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Lukas Zapletal
  • Pull request https://github.com/theforeman/foreman/pull/3729 added

#3 Updated by Daniel Lobato Garcia 10 months ago

  • Target version set to Team Daniel - iteration 2

#4 Updated by Daniel Lobato Garcia 9 months ago

  • Target version changed from Team Daniel - iteration 2 to Team Daniel - iteration 3

#5 Updated by Lukas Zapletal 3 months ago

  • Related to Refactor #19002: Use ApplicationRecord instead of ActiveRecord::Base added

#6 Updated by Lukas Zapletal 3 months ago

  • Related to Refactor #19003: Use ApplicationRecord instead of ActiveRecord::Base added

#7 Updated by Lukas Zapletal 3 months ago

#8 Updated by Lukas Zapletal 3 months ago

The implementation uses ApplicationRecord - new feature of Rails 5. Associated tracking ticket.

#9 Updated by Dominic Cleal 3 months ago

Lukas Zapletal wrote:

The implementation uses ApplicationRecord - new feature of Rails 5. Associated tracking ticket.

An abstract base class is nothing to do with Rails 5!

#10 Updated by Lukas Zapletal 3 months ago

#11 Updated by Lukas Zapletal 3 months ago

Well it's now recommended by Rails 5, but if this makes you to type bangs, then I will unlink it. No biggie.

#12 Updated by Lukas Zapletal 2 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#13 Updated by The Foreman Bot 2 months ago

  • Pull request https://github.com/theforeman/foreman/pull/4454 added

#14 Updated by Ivan Necas about 1 month ago

  • Related to Bug #19395: Failure when migrating database with foreman_remote_executino from scratch added

Also available in: Atom PDF