Project

General

Profile

Actions

Bug #14064

closed

Puppetclass#hostgroups_count should be excluded from auditing

Added by Dominic Cleal almost 9 years ago. Updated almost 9 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
Audit Log
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

On Rails 4.2, the hostgroups_count cached counter on Puppetclass is now getting updated when a HostgroupClass record is created. This causes the following test to fail, as an audit entry is created for the HostgroupClass and a second for the new hostgroups_count attribute update:

  1) Failure:
HostgroupClassTest#test_0001_when creating a new hostgroup class object, an audit entry needs to be added [test/unit/hostgroup_class_test.rb:13]:
"Audit.count" didn't change by 1.
Expected: 2
  Actual: 3

The second audit entry looks like:

 #<Audited::Adapters::ActiveRecord::Audit:0x0000000a6a9b68
  id: 980190964,
  auditable_id: 980190962,
  auditable_type: "Puppetclass",
  user_id: 135138680,
  user_type: nil,
  username: "Admin User",
  action: "update",
  audited_changes: {"hostgroups_count"=>[0, 1]},
  version: 1,
  comment: nil,
  associated_id: nil,
  associated_type: nil,
  request_uuid: "1ce91154-9533-44f3-9431-7842dd534ac7",
  created_at: Mon, 07 Mar 2016 09:22:12 UTC +00:00,
  remote_address: nil,
  auditable_name: "base",
  associated_name: nil>]

Related issues 2 (0 open2 closed)

Related to Foreman - Refactor #14076: Remove Puppet class host groups counterClosedDominic Cleal03/07/2016Actions
Blocks Foreman - Feature #13244: Upgrade Ruby on Rails to 4.2ClosedDominic Cleal01/15/2016Actions
Actions #1

Updated by The Foreman Bot almost 9 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3282 added
Actions #2

Updated by Dominic Cleal almost 9 years ago

Actions #3

Updated by Dominic Cleal almost 9 years ago

  • Status changed from Ready For Testing to Rejected

Will instead remove the counter under #14076.

Actions #4

Updated by Dominic Cleal almost 9 years ago

  • Related to Refactor #14076: Remove Puppet class host groups counter added
Actions

Also available in: Atom PDF