daniel created this task.
daniel added projects: Wikidata, MediaWiki-extensions-WikibaseRepository.
Herald added subscribers: Zppix, Aklapper.

TASK DESCRIPTION

Currently, EntityStore allows entities with no ID set to be passed to saveEntity(). A fresh ID will then be assigned before saving.

In practice, this feature is only used for setting up test fixtures. In production code, the caller controls what ID is assigned and when. This seems more sensible, since if and how IDs can be assigned depends on the entity type, and perhaps also on the context / use case.

The following steps are needed to improve the situation:

  • saveEntity should require the ID to be set. This means a lot of test cases need fixing.
  • assignFreshId should be removed from the EntityStore interface. It seems like we would currently need to repeat the old logic in the following places: MockEntityStore, ModifyEntity, SpecialNewEntity, and perhaps EntitySavingHelper (once EntitySavingHelper can also create entities).
  • IdGenerator should take entity types, not content model IDs, as a parameter. The IdGenerator interface does not specify what "$type" is, but we can't change the interpretation on a live system without migrating the counters in the database table used to track ID creation. (Changing this is not strictly needed, but would allow us to use IdGenerator directly in the places that need to assign ids).

TASK DETAIL
https://phabricator.wikimedia.org/T138227

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: daniel
Cc: Aklapper, Zppix, daniel, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to