Project

General

Profile

Actions

Bug #37503

closed

Plugins are finalized before seeds are executed

Added by Adam Ruzicka 7 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Plugin integration
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

It can happen that
1) A new permission is added in foreman (as it was in https://github.com/theforeman/foreman/pull/9803)
2) A role in a plugin is extended to have the permission from 1) (as it was in https://github.com/theforeman/foreman_ansible/pull/633)
3) When the installer runs, it skips explicit seeds (foreman-rake db:seed) because explicit seeds only run when the db was migrated
4) Seeds are supposed to be seeded when the rails process boots up, but because of the load order the plugin seems to be initialized before its dependencies (the permission in core) are seeded

Actions #1

Updated by Adam Ruzicka 7 months ago

Steps to reproduce:
0) Have foreman with foreman_ansible, fully migrated and ready to go
1) Connect to postgres
2) Mangle your db
delete from filterings where permission_id in (select id from permissions where resource_type = 'LookupValue');
delete from permissions where resource_type = 'LookupValue';
update foreman_internals set value = '1';
3) start rails

Actions #2

Updated by The Foreman Bot 7 months ago

  • Status changed from New to Ready For Testing
  • Assignee set to Adam Ruzicka
  • Pull request https://github.com/theforeman/foreman/pull/10182 added
Actions #3

Updated by The Foreman Bot 5 months ago

  • Fixed in Releases 3.12.0 added
Actions #4

Updated by Adam Ruzicka 5 months ago

  • Status changed from Ready For Testing to Closed
Actions #5

Updated by Ewoud Kohl van Wijngaarden 4 months ago

  • Category set to Plugin integration
  • Triaged changed from No to Yes
Actions #6

Updated by The Foreman Bot 4 months ago

  • Fixed in Releases 3.11.2 added
Actions

Also available in: Atom PDF