Skip to content

Import step dependecies relying on circular dependencies may result in bad order #4

@tseaver

Description

@tseaver

In https://bugs.launchpad.net/zope-cmf/+bug/314010, Bertrand Mathieu (@bmathieu?) reported:

an example is here: http://dev.plone.org/plone/ticket/8350

if 'my-step' must be executed before 'mandatory-step', and 'mandatory-step' is involved in a circular dependency chain (with 'circular-step' for example), then sorted imported steps will be: ['my-step', 'mandatory-step', 'circular-step'].

This is reproducible if you define 'my-step' with zcml, and the other steps in a profile (with import_steps.xml).

I have posted a monkey patch in plone ticket system #8350 (in order to help others with a hopefully good workaround). There is also doctest that should fail with current implementation and succeed with mine. The idea is to change final loop and insert all steps detected involved in a circular loop, and then trying to resolve remaining dependencies before eventually inserting unresolved steps.

I don't know if it is the best way to solve this problem, but at least it should be a good start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions