プロジェクト

全般

プロフィール

Vote #74203

未完了

migrate_from_trac.rake, print out validation errors when doing save

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Importers_15
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
15
version_id:
0
issue_org_id:
14593
author_id:
82783
assigned_to_id:
0
comments:
4
status_id:
1
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

In the migrate_from_trac.rake script,
the save method is called on several objects
to save them to the database. However, if these
objects fail validation, the object is not saved to the database.
The errors are not displayed to the user, and
the migrate_from_trac.rake script will skip saving
many different objects to the database.

This patch preserves the behavior of skipping saving certain
objects if they fail validation, but the patch
will at least try to print out the errors. This will
give the user a chance to scrub the data in Trac
so that it can be properly imported into Redmine.

During my test imports of a large Trac database into Redmine,
I was wondering why certain users and certain tickets were
not being imported into Redmine.

Related to #14567


journals

Note, in my patch, I change this:

Time.fake(ticket.changetime) { i.save }

to:

unless i.save

In my patch for #14567 , I got rid of Time.fake,
because I found it did not work all the time and was not necessary.

I am trying to separate my patches to migrate_from_trac.rake
into smaller pieces that can be more easily reviewed and integrated into the Redmine
codebase.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I would say the sane solution is to run the complete script in a database transaction so in case of an error everything is just rolled back. It should be a everything or nothing import strategy. see #14844
--------------------------------------------------------------------------------
Here is another version of the patch. This patch does not depend on #14567
and just adds more verbose error messages around places where it tries to save to the database.

--------------------------------------------------------------------------------


related_issues

relates,New,14567,migrate_from_trac.rake does not convert timestamps in Trac database version 23

Admin Redmine さんが約2年前に更新

  • カテゴリImporters_15 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0