Bug #37503
closedPlugins are finalized before seeds are executed
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
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
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
Updated by Adam Ruzicka 5 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman|b5638c75883cf5b1b2f2718e542687cfa432ea5d.
Updated by Ewoud Kohl van Wijngaarden 4 months ago
- Category set to Plugin integration
- Triaged changed from No to Yes