Katello/katello — pull request #1259 by lzap (2012-12-14 15:50:51+00:00)
Title: 885261 - org deletion should remove rh provider

Basically, our organization deletion no longer works. We are blocking REDHAT provider to be deleted and since org deletion was refactored to be a backgound process and organization was immediately hidden from the database, we thought it was deleted correctly.

This fixes the cause of the provider that was not being deleted and it adds a "repair" upgrade script. Please note after applying this errata, users must execute it manually:

/usr/share/katello/install/upgrade-scripts/0701_delete_undeleted_providers.rb

It will be executed once during the next upgrade as well.

Now, I need help with testing the "repair" script. We (me and inecas) are not 100% sure if this was the only one data corruption. I need you to try to reproduce the bug, apply the patch, repair the database and then test Katello on various conditions to catch possible data corruption.

Steps to reproduce:

* create an org1
* import a (real) manifest, enable repos, sync, promote content
* delete the org1
* create an org2 (different name)
* repeat the same steps with the same manifest, try also different manifest
* delete the org2
* apply the patch, repair db, test katello (or try the same scenario again)

I will follow with a patch that will vastly improve our orchestraion logging, my plan is to move all the important info about orchestratioin (each particular step that was or was not executed) out of rails logs into a separate log and we will fill the information there by default with a correlation id, so we will be able to deduce what was going on during broken orchestration. This improvement will be separate of this fix.