Project

General

Profile

Actions

Bug #6922

closed

Foreman runs engine seeds.d before seeds.rb

Added by Stephen Benjamin over 9 years ago. Updated over 9 years ago.

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

Description

#6308 introduced seeds.d support for engines, however these are run before the Engine's own seeds.rb is run.


Related issues 1 (0 open1 closed)

Related to Foreman - Feature #6308: Allow plugins to hook into DB seed orderingClosedEric Helms06/20/2014Actions
Actions #1

Updated by Stephen Benjamin over 9 years ago

  • Related to Feature #6308: Allow plugins to hook into DB seed ordering added
Actions #2

Updated by Dominic Cleal over 9 years ago

Can you provide any more information about what seed files you have in the plugin?

Actions #3

Updated by Stephen Benjamin over 9 years ago

Katello doesn't use seeds.d yet. Eric and I discussed moving Satellite branding to seeds.d as something like 99-branding.rb. This lets downstream rebase Katello freely without wiping out all the branding changes constantly. It's becoming a major headache for me, as I've now had to reapply my changes 3x.

99-branding.rb doesn't work if things in seeds.rb are applied later. I can fix my problem by moving provisioning templates to seeds.d as well if we decide to do this.

But IMHO the simplest argument for this is that engines and Foreman should have the same behavior in how they handle the ordering of seeds.rb and seeds.d.

Actions #4

Updated by Dominic Cleal over 9 years ago

  • Status changed from New to Need more information

I can't reproduce any ordering issue with a file called "99-branding.rb":

Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/03-auth_sources.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/04-admin.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/05-taxonomies.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/06-architectures.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/07-config_templates.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/08-partition_tables.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/10-installation_media.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/11-permissions.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/11-roles.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/11-smart_proxy_features.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/13-compute_profiles.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/15-bookmarks.rb
Seeding /home/dcleal/code/foreman/foreman_bootdisk/db/seeds.d/99-branding.rb

Also the original PR shows a test from Greg that appears to work correctly. seeds.rb sorts all seed files by their basename.

Actions #5

Updated by Stephen Benjamin over 9 years ago

That's not the issue I'm reporting. Katello has a seeds.rb, the way #6308 was implemented, seeds.d/* is executed BEFORE seeds.rb...

Actions #6

Updated by Dominic Cleal over 9 years ago

Foreman doesn't provide any mechanism to run a seeds.rb from an engine, only seeds.d/. Maybe that's to do with enhancing the db:seed rake task from the engine. I'd recommend not using seeds.rb in an engine.

Actions #7

Updated by Stephen Benjamin over 9 years ago

  • Status changed from Need more information to Rejected

I see, we're hooking into the rake task to get our seeds.rb processed, so we'll need to move everything to seeds.d.

Actions

Also available in: Atom PDF