https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292022-02-23T21:58:44ZRedmineRedmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1057552022-02-23T21:58:44ZMarius BĂLTEANU
<ul><li><strong>Target version</strong> set to <i>Candidate for next major release</i></li></ul><p>Nice feature!</p> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1057572022-02-23T22:00:38ZMarius BĂLTEANU
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-1 priority-4 priority-default" href="/issues/31076">Patch #31076</a>: Issues CSV / PDF export via ActiveJob</i> added</li></ul> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1057582022-02-23T22:07:10ZMarius BĂLTEANU
<ul></ul><p>Jens, should we take into consideration also <a class="issue tracker-2 status-1 priority-4 priority-default" title="Feature: Rails 6.1 destroy async (New)" href="https://www.redmine.org/issues/34987">#34987</a>?</p> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1057592022-02-23T23:24:42ZJames H
<ul></ul><p>maybe my group members issue <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Improve performance of adding or removing members of a group (Closed)" href="https://www.redmine.org/issues/36696">#36696</a> can benefit from this as well</p> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1057612022-02-24T02:43:39ZJens Krämerjk@jkraemer.net
<ul></ul><p>Marius BALTEANU wrote:</p>
<blockquote>
<p>Jens, should we take into consideration also <a class="issue tracker-2 status-1 priority-4 priority-default" title="Feature: Rails 6.1 destroy async (New)" href="https://www.redmine.org/issues/34987">#34987</a>?</p>
</blockquote>
<p>Ah, that's interesting. If I understand correctly, that would mean the project record (plus potential child projects' records) would be deleted synchronously, but removal of all dependent objects would be pushed to the job queue.</p>
<p>I see few problems with that:</p>
<p>1. Data integrity. Before the job is finished, we have an inconsistent database (i.e. issues referencing a nonexisting project). I am not sure we handle such a situation gracefully (i.e. resulting in an HTTP 404 vs a 500) in all cases.<br />2. Two transactions instead of one. Currently, if the project deletion fails due to a problem somewhere along the way (due to a failing callback for example), the transaction is rolled back and everything is as if nothing happened. Splitting the process in two separate transactions (one for the project, one later for the dependent objects), means the project record will be gone even if some dependent object insists on not being destroyed. I do not think core has any such callbacks, but plugins might.<br />3. Does not work at all when there are foreign keys referencing `projects.id`. We do not have such in core, but again, there may be plugins that do.</p> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1057622022-02-24T07:46:12ZMarius BĂLTEANU
<ul></ul><p>Thanks Jens for your quick response.</p> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1062092022-03-28T21:08:43ZMarius BĂLTEANU
<ul><li><strong>Target version</strong> changed from <i>Candidate for next major release</i> to <i>5.1.0</i></li></ul> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1062542022-03-31T11:07:57ZJens Krämerjk@jkraemer.net
<ul></ul><p>Marius, I just have re-submitted this patch as part of a larger work on the admin projects list in <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Re-implement admin project list using ProjectQuery system (Closed)" href="https://www.redmine.org/issues/33422">#33422</a>. It would be great if you could have a look and consider integrating that one instead.</p> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1062712022-04-03T07:48:58ZMarius BĂLTEANU
<ul></ul><p>There is a random failing test, you can reproduce by running the tests using the following command: <code>TESTOPTS="--seed=42328" rake test</code></p>
<pre>
Failure:
DestroyProjectJobTest#test_should_destroy_project_and_send_email [/work/test/unit/jobs/destroy_project_job_test.rb:60]:
No enqueued job found with {:job=>ActionMailer::MailDeliveryJob, :args=>#<Proc:0x0000aaaafe3aec98 /work/test/unit/jobs/destroy_project_job_test.rb:62 (lambda)>}
</pre>
<p>Jens, can you take a look, please?</p> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1062732022-04-03T07:49:55ZMarius BĂLTEANU
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/33422">Feature #33422</a>: Re-implement admin project list using ProjectQuery system</i> added</li></ul> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1062852022-04-04T16:47:13ZMarius BĂLTEANU
<ul><li><strong>Assignee</strong> set to <i>Jens Krämer</i></li></ul> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1063062022-04-06T06:19:07ZJens Krämerjk@jkraemer.net
<ul><li><strong>File</strong> <a href="/attachments/29045">fix_failing_tests.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/29045/fix_failing_tests.diff">fix_failing_tests.diff</a> added</li></ul><p>this is really strange, looks like under some circumstances emails are processed inline and not result in a queued mailer job. I did not find the cause of this, but the attached patch would handle both cases in the tests (the same issue exists in the test case for the job that handles deletion of multiple projects).</p> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1067272022-05-17T20:53:28ZMarius BĂLTEANU
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> changed from <i>Jens Krämer</i> to <i>Marius BĂLTEANU</i></li></ul><p>Both patches from <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Re-implement admin project list using ProjectQuery system (Closed)" href="https://www.redmine.org/issues/33422">#33422</a> and the fix for tests committed, thank you for your contribution, really useful feature.</p> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1068072022-05-27T19:38:56ZMarius BĂLTEANU
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1068822022-06-06T08:57:55ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-5 priority-4 priority-default closed" href="/issues/37210">Patch #37210</a>: Make "Project" label translatable in app/views/projects/bulk_destroy.html.erb</i> added</li></ul> Redmine - Feature #36691: Background job and dedicated status for project deletionhttps://www.redmine.org/issues/36691?journal_id=1112842023-10-30T12:38:14ZGo MAEDA
<ul><li><strong>Tracker</strong> changed from <i>Patch</i> to <i>Feature</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul>